mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 12:51:52 +02:00
can now grant groups you are not associated with
This commit is contained in:
parent
0cd0e810ad
commit
bd18c2ef93
@ -74,7 +74,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$acct = CreateObject('phpgwapi.accounts',$owner);
|
$acct = CreateObject('phpgwapi.accounts',$owner);
|
||||||
$groups = $acct->memberships($owner);
|
$groups = $acct->get_list('groups');
|
||||||
|
$users = $acct->get_list('accounts');
|
||||||
unset($acct);
|
unset($acct);
|
||||||
$acl = CreateObject('phpgwapi.acl',intval($owner));
|
$acl = CreateObject('phpgwapi.acl',intval($owner));
|
||||||
$acl->read_repository();
|
$acl->read_repository();
|
||||||
@ -155,11 +156,11 @@
|
|||||||
|
|
||||||
if(!isset($totalentries))
|
if(!isset($totalentries))
|
||||||
{
|
{
|
||||||
$totalentries = count($groups);
|
$totalentries = count($groups) + count($users);
|
||||||
$db = $phpgw->db;
|
if($totalentries < $maxm)
|
||||||
$db->query("SELECT count(*) FROM phpgw_accounts WHERE account_type='u'");
|
{
|
||||||
$db->next_record();
|
$maxm = $totalentries;
|
||||||
$totalentries += intval($db->f(0));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$p = CreateObject('phpgwapi.Template',$phpgw_info['server']['app_tpl']);
|
$p = CreateObject('phpgwapi.Template',$phpgw_info['server']['app_tpl']);
|
||||||
@ -236,7 +237,7 @@
|
|||||||
|
|
||||||
if($query)
|
if($query)
|
||||||
{
|
{
|
||||||
if(!strpos(' '.$group['account_id'].' ',$query))
|
if(!strpos(' '.$group['account_lid'].' ',$query))
|
||||||
{
|
{
|
||||||
$go = False;
|
$go = False;
|
||||||
}
|
}
|
||||||
@ -245,7 +246,7 @@
|
|||||||
if($go)
|
if($go)
|
||||||
{
|
{
|
||||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||||
display_row($tr_color,'g_',$group['account_id'],$group['account_name']);
|
display_row($tr_color,'g_',$group['account_id'],$group['account_lid']);
|
||||||
$s_groups++;
|
$s_groups++;
|
||||||
$processed[] = $group['account_id'];
|
$processed[] = $group['account_id'];
|
||||||
$total++;
|
$total++;
|
||||||
@ -257,15 +258,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($total <> $maxm)
|
|
||||||
{
|
|
||||||
if(!is_object($db))
|
|
||||||
{
|
|
||||||
$db = $phpgw->db;
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->query("select account_id, account_firstname, account_lastname, account_lid FROM phpgw_accounts WHERE account_type='u' ORDER BY account_lastname, account_firstname, account_lid ".$db->limit(intval($s_users),$maxm),__LINE__,__FILE__);
|
|
||||||
$users = $db->num_rows();
|
|
||||||
if($total <> $maxm)
|
if($total <> $maxm)
|
||||||
{
|
{
|
||||||
if($users)
|
if($users)
|
||||||
@ -273,12 +265,13 @@
|
|||||||
$p->set_var('string',ucfirst(lang('Users')));
|
$p->set_var('string',ucfirst(lang('Users')));
|
||||||
$p->parse('row','row_colspan',True);
|
$p->parse('row','row_colspan',True);
|
||||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||||
while($db->next_record())
|
for($k=$s_users;$k<$total || $k==count($users);$k++)
|
||||||
{
|
{
|
||||||
|
$user = $users[$k];
|
||||||
$go = True;
|
$go = True;
|
||||||
if($query)
|
if($query)
|
||||||
{
|
{
|
||||||
$name = ' '.$db->f('account_firstname').' '.$db->f('account_lastname').' '.$db->f('account_lid').' ';
|
$name = ' '.$user['account_firstname'].' '.$user['account_lastname'].' '.$user['account_lid'].' ';
|
||||||
if(!strpos($name,$query))
|
if(!strpos($name,$query))
|
||||||
{
|
{
|
||||||
$go = False;
|
$go = False;
|
||||||
@ -288,10 +281,9 @@
|
|||||||
if($go)
|
if($go)
|
||||||
{
|
{
|
||||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||||
$id = $db->f('account_id');
|
display_row($tr_color,'u_',$user['account_id'],$phpgw->common->display_fullname($user['account_lid'],$user['account_firstname'],$user['account_lastname']));
|
||||||
display_row($tr_color,'u_',$id,$phpgw->common->grab_owner_name($id));
|
|
||||||
$s_users++;
|
$s_users++;
|
||||||
$processed[] = $id;
|
$processed[] = $user['account_id'];
|
||||||
$total++;
|
$total++;
|
||||||
if($total == $maxm)
|
if($total == $maxm)
|
||||||
{
|
{
|
||||||
@ -301,7 +293,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$extra_parms = '&s_users='.$s_users.'&s_groups='.$s_groups.'&maxm='.$maxm.'&totalentries='.$totalentries.'&total='.($start + $total).'&owner='.$owner;
|
$extra_parms = '&s_users='.$s_users.'&s_groups='.$s_groups.'&maxm='.$maxm.'&totalentries='.$totalentries.'&total='.($start + $total).'&owner='.$owner;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user