This commit is contained in:
skeeter 2001-11-10 21:20:52 +00:00
parent 5767f4f2a3
commit 96e4fc63e8
3 changed files with 20 additions and 12 deletions

View File

@ -84,7 +84,7 @@
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'))
{ {
$ui = createobject('admin.uiaccounts'); $ui = createobject('admin.uiaccounts');
$ui->list_groups(); $ui->list_groups();
return False; return False;
} }
@ -131,7 +131,7 @@
if (isset($GLOBALS['HTTP_POST_VARS']['cancel']) || $GLOBALS['phpgw']->acl->check('account_access',32,'admin')) if (isset($GLOBALS['HTTP_POST_VARS']['cancel']) || $GLOBALS['phpgw']->acl->check('account_access',32,'admin'))
{ {
$ui = createobject('admin.uiaccounts'); $ui = createobject('admin.uiaccounts');
$ui->list_users(); $ui->list_users();
return False; return False;
} }
elseif($GLOBALS['HTTP_POST_VARS']['delete_account']) elseif($GLOBALS['HTTP_POST_VARS']['delete_account'])

View File

@ -25,6 +25,10 @@
$querymethod = " AND (account_firstname LIKE '%$query%' OR account_lastname LIKE " $querymethod = " AND (account_firstname LIKE '%$query%' OR account_lastname LIKE "
. "'%$query%' OR account_lid LIKE '%$query%') "; . "'%$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->query("SELECT COUNT(*) FROM phpgw_accounts WHERE account_type='".$account_type."'".$querymethod,__LINE__,__FILE__);
$GLOBALS['phpgw']->db->next_record(); $GLOBALS['phpgw']->db->next_record();

View File

@ -50,6 +50,8 @@
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/admin/index.php')); $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/admin/index.php'));
} }
$query = (isset($GLOBALS['HTTP_POST_VARS']['query'])?$GLOBALS['HTTP_POST_VARS']['query']:'');
$GLOBALS['cd'] = ($GLOBALS['HTTP_GET_VARS']['cd']?$GLOBALS['HTTP_GET_VARS']['cd']:0); $GLOBALS['cd'] = ($GLOBALS['HTTP_GET_VARS']['cd']?$GLOBALS['HTTP_GET_VARS']['cd']:0);
unset($GLOBALS['phpgw_info']['flags']['noheader']); unset($GLOBALS['phpgw_info']['flags']['noheader']);
@ -68,8 +70,8 @@
if ($GLOBALS['phpgw']->acl->check('group_access',2,'admin')) if ($GLOBALS['phpgw']->acl->check('group_access',2,'admin'))
{ {
$total = $this->bo->account_total('g'); $total = $this->bo->account_total('g',$query);
$account_info = $GLOBALS['phpgw']->accounts->get_list('groups',$start,$sort, $order, '', $total); $account_info = $GLOBALS['phpgw']->accounts->get_list('groups',$start,$sort, $order, $query, $total);
} }
else else
{ {
@ -90,7 +92,7 @@
); );
$p->set_var($var); $p->set_var($var);
if (!count($account_info)) if (!$total)
{ {
$p->set_var('message',lang('No matchs found')); $p->set_var('message',lang('No matchs found'));
$p->parse('rows','row_empty',True); $p->parse('rows','row_empty',True);
@ -174,7 +176,9 @@
{ {
$cd = $param_cd; $cd = $param_cd;
} }
$query = (isset($GLOBALS['HTTP_POST_VARS']['query'])?$GLOBALS['HTTP_POST_VARS']['query']:'');
unset($GLOBALS['phpgw_info']['flags']['noheader']); unset($GLOBALS['phpgw_info']['flags']['noheader']);
unset($GLOBALS['phpgw_info']['flags']['nonavbar']); unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
@ -192,16 +196,16 @@
if ($GLOBALS['phpgw']->acl->check('account_access',2,'admin')) if ($GLOBALS['phpgw']->acl->check('account_access',2,'admin'))
{ {
$total = $this->bo->account_total('u'); $total = $this->bo->account_total('u',$query);
$account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,''); $account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$query,$total);
} }
else else
{ {
$total = $this->bo->account_total('u',$query); $total = $this->bo->account_total('u',$query);
$account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$query); $account_info = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,$order,$query,$total);
} }
$url = $GLOBALS['phpgw']->link('/index.php'); $url = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users');
$var = Array( $var = Array(
'bg_color' => $GLOBALS['phpgw_info']['theme']['bg_color'], 'bg_color' => $GLOBALS['phpgw_info']['theme']['bg_color'],
@ -228,10 +232,10 @@
if (! $GLOBALS['phpgw']->acl->check('account_access',2,'admin')) if (! $GLOBALS['phpgw']->acl->check('account_access',2,'admin'))
{ {
$p->set_var('input_search',lang('Search') . '&nbsp;<input name="query">'); $p->set_var('input_search',lang('Search') . '&nbsp;<input type="text" name="query">');
} }
if (! count($account_info)) if (!$total)
{ {
$p->set_var('message',lang('No matchs found')); $p->set_var('message',lang('No matchs found'));
$p->parse('rows','row_empty',True); $p->parse('rows','row_empty',True);