Allow group or account permissions, do not require both

This commit is contained in:
Miles Lott 2001-03-14 20:09:13 +00:00
parent a9fe0f0b0d
commit e2f8d96a81

View File

@ -201,6 +201,7 @@
$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());
if ($_userData['account_permissions']) {
while($app = each($_userData['account_permissions'])) while($app = each($_userData['account_permissions']))
{ {
if($app[1]) if($app[1])
@ -212,17 +213,19 @@
} }
} }
} }
}
$apps->save_repository(); $apps->save_repository();
$account = CreateObject('phpgwapi.accounts'); $account = CreateObject('phpgwapi.accounts');
$allGroups = $account->get_list('groups'); $allGroups = $account->get_list('groups');
if ($_userData['account_groups']) {
reset($_userData['account_groups']); reset($_userData['account_groups']);
while (list($key,$value) = each($_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++;