Removed the account_total function. Very messy cause if using LDAP, the data is not stored in the phpgw_accounts table.

This commit is contained in:
skeeter 2001-11-16 04:09:21 +00:00
parent d71a835b2d
commit f4c9cdb34c
3 changed files with 20 additions and 42 deletions

View File

@ -74,11 +74,6 @@
} }
} }
function account_total($account_type,$query='')
{
return $this->so->account_total($account_type,$query);
}
function delete_group() function delete_group()
{ {
if (!@isset($GLOBALS['HTTP_POST_VARS']['account_id']) || !@$GLOBALS['HTTP_POST_VARS']['account_id'] || $GLOBALS['phpgw']->acl->check('group_access',32,'admin')) if (!@isset($GLOBALS['HTTP_POST_VARS']['account_id']) || !@$GLOBALS['HTTP_POST_VARS']['account_id'] || $GLOBALS['phpgw']->acl->check('group_access',32,'admin'))

View File

@ -18,24 +18,6 @@
{ {
} }
function account_total($account_type,$query='')
{
if ($query)
{
$querymethod = " AND (account_firstname LIKE '%$query%' OR account_lastname LIKE "
. "'%$query%' OR account_lid LIKE '%$query%') ";
}
else
{
$querymethod = '';
}
$GLOBALS['phpgw']->db->query("SELECT COUNT(*) FROM phpgw_accounts WHERE account_type='".$account_type."'".$querymethod,__LINE__,__FILE__);
$GLOBALS['phpgw']->db->next_record();
return $GLOBALS['phpgw']->db->f(0);
}
function add_user($userData) function add_user($userData)
{ {
$userData['account_expires'] = $userData['expires']; $userData['account_expires'] = $userData['expires'];

View File

@ -70,13 +70,13 @@
if ($GLOBALS['phpgw']->acl->check('group_access',2,'admin')) if ($GLOBALS['phpgw']->acl->check('group_access',2,'admin'))
{ {
$total = $this->bo->account_total('g',$query);
$account_info = $GLOBALS['phpgw']->accounts->get_list('groups',$start,$sort, $order, $query, $total); $account_info = $GLOBALS['phpgw']->accounts->get_list('groups',$start,$sort, $order, $query, $total);
$total = $GLOBALS['phpgw']->accounts->total;
} }
else else
{ {
$total = $this->bo->account_total('g',$query);
$account_info = $GLOBALS['phpgw']->accounts->get_list('groups',$start,$sort, $order, $query, $total); $account_info = $GLOBALS['phpgw']->accounts->get_list('groups',$start,$sort, $order, $query, $total);
$total = $GLOBALS['phpgw']->accounts->total;
} }
$url = $GLOBALS['phpgw']->link('/index.php'); $url = $GLOBALS['phpgw']->link('/index.php');
@ -172,12 +172,13 @@
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/admin/index.php')); $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/admin/index.php'));
} }
if(!$param_cd) if($param_cd)
{ {
$cd = $param_cd; $cd = $param_cd;
} }
$query = (isset($GLOBALS['HTTP_POST_VARS']['query'])?$GLOBALS['HTTP_POST_VARS']['query']:''); $GLOBALS['query'] = (isset($GLOBALS['HTTP_POST_VARS']['query'])?$GLOBALS['HTTP_POST_VARS']['query']:'');
$start = (isset($GLOBALS['HTTP_POST_VARS']['start'])?intval($GLOBALS['HTTP_POST_VARS']['start']):'');
unset($GLOBALS['phpgw_info']['flags']['noheader']); unset($GLOBALS['phpgw_info']['flags']['noheader']);
unset($GLOBALS['phpgw_info']['flags']['nonavbar']); unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
@ -196,13 +197,13 @@
if ($GLOBALS['phpgw']->acl->check('account_access',2,'admin')) if ($GLOBALS['phpgw']->acl->check('account_access',2,'admin'))
{ {
$total = $this->bo->account_total('u',$query); $account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$GLOBALS['query'],$total);
$account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$query,$total); $total = $GLOBALS['phpgw']->accounts->total;
} }
else else
{ {
$total = $this->bo->account_total('u',$query); $account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$GLOBALS['query'],$total);
$account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$query,$total); $total = $GLOBALS['phpgw']->accounts->total;
} }
$url = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'); $url = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users');
@ -213,9 +214,9 @@
'left_next_matchs' => $this->nextmatchs->left($url,$start,$total,'menuaction=admin.uiaccounts.list_users'), 'left_next_matchs' => $this->nextmatchs->left($url,$start,$total,'menuaction=admin.uiaccounts.list_users'),
'lang_user_accounts' => lang('user accounts'), 'lang_user_accounts' => lang('user accounts'),
'right_next_matchs' => $this->nextmatchs->right($url,$start,$total,'menuaction=admin.uiaccounts.list_users'), 'right_next_matchs' => $this->nextmatchs->right($url,$start,$total,'menuaction=admin.uiaccounts.list_users'),
'lang_loginid' => $this->nextmatchs->show_sort_order($sort,'account_lid',$order,$url,lang('LoginID'),'menuaction=admin.uiaccounts.list_users'), 'lang_loginid' => $this->nextmatchs->show_sort_order($sort,'account_lid',$order,$url,lang('LoginID')),
'lang_lastname' => $this->nextmatchs->show_sort_order($sort,'account_lastname',$order,$url,lang('last name'),'menuaction=admin.uiaccounts.list_users'), 'lang_lastname' => $this->nextmatchs->show_sort_order($sort,'account_lastname',$order,$url,lang('last name')),
'lang_firstname' => $this->nextmatchs->show_sort_order($sort,'account_firstname',$order,$url,lang('first name'),'menuaction=admin.uiaccounts.list_users'), 'lang_firstname' => $this->nextmatchs->show_sort_order($sort,'account_firstname',$order,$url,lang('first name')),
'lang_edit' => lang('edit'), 'lang_edit' => lang('edit'),
'lang_delete' => lang('delete'), 'lang_delete' => lang('delete'),
'lang_view' => lang('view'), 'lang_view' => lang('view'),