diff --git a/admin/inc/class.boaccounts.inc.php b/admin/inc/class.boaccounts.inc.php index 55d3a05656..635a406e61 100755 --- a/admin/inc/class.boaccounts.inc.php +++ b/admin/inc/class.boaccounts.inc.php @@ -74,11 +74,6 @@ } } - function account_total($account_type,$query='') - { - return $this->so->account_total($account_type,$query); - } - 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')) @@ -304,7 +299,7 @@ if ($GLOBALS['phpgw']->acl->check('account_access',4,'admin')) { $ui = createobject('admin.uiaccounts'); - $ui->list_users(); + $ui->list_users(); return False; } @@ -336,7 +331,7 @@ { $this->so->add_user($userData); $ui = createobject('admin.uiaccounts'); - $ui->list_users(); + $ui->list_users(); return False; } else @@ -519,7 +514,7 @@ $GLOBALS['phpgw']->db->unlock(); $ui = createobject('admin.uiaccounts'); - $ui->list_groups(); + $ui->list_groups(); return False; } @@ -528,7 +523,7 @@ if ($GLOBALS['phpgw']->acl->check('account_access',16,'admin')) { $ui = createobject('admin.uiaccounts'); - $ui->list_users(); + $ui->list_users(); return False; } @@ -565,20 +560,20 @@ if (!$menuClass->createHTMLCode('edit_user')) { $ui = createobject('admin.uiaccounts'); - $ui->list_users(); + $ui->list_users(); return False; } else { $ui = createobject('admin.uiaccounts'); - $ui->edit_user($GLOBALS['HTTP_GET_VARS']['account_id']); + $ui->edit_user($GLOBALS['HTTP_GET_VARS']['account_id']); return False; } } else { $ui = createobject('admin.uiaccounts'); - $ui->create_edit_user($userData['account_id'],$userData,$errors); + $ui->create_edit_user($userData['account_id'],$userData,$errors); } } } diff --git a/admin/inc/class.soaccounts.inc.php b/admin/inc/class.soaccounts.inc.php index df5292ab10..1af63d7fbf 100755 --- a/admin/inc/class.soaccounts.inc.php +++ b/admin/inc/class.soaccounts.inc.php @@ -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) { $userData['account_expires'] = $userData['expires']; diff --git a/admin/inc/class.uiaccounts.inc.php b/admin/inc/class.uiaccounts.inc.php index 86c8d6624b..4d59311492 100755 --- a/admin/inc/class.uiaccounts.inc.php +++ b/admin/inc/class.uiaccounts.inc.php @@ -70,13 +70,13 @@ 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); + $total = $GLOBALS['phpgw']->accounts->total; } else { - $total = $this->bo->account_total('g',$query); $account_info = $GLOBALS['phpgw']->accounts->get_list('groups',$start,$sort, $order, $query, $total); + $total = $GLOBALS['phpgw']->accounts->total; } $url = $GLOBALS['phpgw']->link('/index.php'); @@ -172,13 +172,14 @@ $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/admin/index.php')); } - if(!$param_cd) + if($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']['nonavbar']); $GLOBALS['phpgw']->common->phpgw_header(); @@ -196,13 +197,13 @@ 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,$query,$total); + $account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$GLOBALS['query'],$total); + $total = $GLOBALS['phpgw']->accounts->total; } else { - $total = $this->bo->account_total('u',$query); - $account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$query,$total); + $account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$GLOBALS['query'],$total); + $total = $GLOBALS['phpgw']->accounts->total; } $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'), 'lang_user_accounts' => lang('user accounts'), '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_lastname' => $this->nextmatchs->show_sort_order($sort,'account_lastname',$order,$url,lang('last name'),'menuaction=admin.uiaccounts.list_users'), - 'lang_firstname' => $this->nextmatchs->show_sort_order($sort,'account_firstname',$order,$url,lang('first name'),'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')), + 'lang_firstname' => $this->nextmatchs->show_sort_order($sort,'account_firstname',$order,$url,lang('first name')), 'lang_edit' => lang('edit'), 'lang_delete' => lang('delete'), 'lang_view' => lang('view'),