mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-10 16:08:34 +01:00
Allow group or account permissions, do not require both
This commit is contained in:
parent
a9fe0f0b0d
commit
e2f8d96a81
@ -201,14 +201,16 @@
|
|||||||
$apps->account_type = 'u';
|
$apps->account_type = 'u';
|
||||||
$apps->account_id = $_userData['account_id'];
|
$apps->account_id = $_userData['account_id'];
|
||||||
$apps->account_apps = Array(Array());
|
$apps->account_apps = Array(Array());
|
||||||
while($app = each($_userData['account_permissions']))
|
if ($_userData['account_permissions']) {
|
||||||
{
|
while($app = each($_userData['account_permissions']))
|
||||||
if($app[1])
|
|
||||||
{
|
{
|
||||||
$apps->add($app[0]);
|
if($app[1])
|
||||||
if(!$apps_before[$app[0]])
|
|
||||||
{
|
{
|
||||||
$apps_after[] = $app[0];
|
$apps->add($app[0]);
|
||||||
|
if(!$apps_before[$app[0]])
|
||||||
|
{
|
||||||
|
$apps_after[] = $app[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -218,10 +220,11 @@
|
|||||||
$account = CreateObject('phpgwapi.accounts');
|
$account = CreateObject('phpgwapi.accounts');
|
||||||
$allGroups = $account->get_list('groups');
|
$allGroups = $account->get_list('groups');
|
||||||
|
|
||||||
reset($_userData['account_groups']);
|
if ($_userData['account_groups']) {
|
||||||
while (list($key,$value) = each($_userData['account_groups']))
|
reset($_userData['account_groups']);
|
||||||
{
|
while (list($key,$value) = each($_userData['account_groups'])) {
|
||||||
$newGroups[$value] = $value;
|
$newGroups[$value] = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$acl = CreateObject('phpgwapi.acl',$_userData['account_id']);
|
$acl = CreateObject('phpgwapi.acl',$_userData['account_id']);
|
||||||
@ -280,7 +283,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!count($_userData['account_permissions']) || !count($_userData['account_groups']))
|
if (!count($_userData['account_permissions']) && !count($_userData['account_groups']))
|
||||||
{
|
{
|
||||||
$error[$totalerrors] = lang('You must add at least 1 permission or group to this account');
|
$error[$totalerrors] = lang('You must add at least 1 permission or group to this account');
|
||||||
$totalerrors++;
|
$totalerrors++;
|
||||||
|
Loading…
Reference in New Issue
Block a user