Fixes #613. Add correctly users to all users group.

This commit is contained in:
Ermal 2010-06-22 14:29:45 +00:00
parent b009b15330
commit e879fc815e
2 changed files with 12 additions and 2 deletions

View File

@ -409,7 +409,7 @@ function local_user_set_groups($user, $new_groups = NULL ) {
/* determine which memberships to remove */
foreach ($cur_groups as $groupname) {
if (in_array($groupname,$new_groups))
continue;
continue;
$group = & $config['system']['group'][$groupindex[$groupname]];
$index = array_search($user['uid'], $group['member']);
array_splice($group['member'], $index, 1);

View File

@ -174,7 +174,6 @@ if (isAllowedPage("system_usermanager")) {
}
if ($_POST) {
conf_mount_rw();
unset($input_errors);
$pconfig = $_POST;
@ -253,6 +252,7 @@ if (isAllowedPage("system_usermanager")) {
}
if (!$input_errors) {
conf_mount_rw();
$userent = array();
if (isset($id) && $a_user[$id])
$userent = $a_user[$id];
@ -303,6 +303,16 @@ if (isAllowedPage("system_usermanager")) {
$userent['cert'][] = $cert;
}
$userent['uid'] = $config['system']['nextuid']++;
/* Add the user to All Users group. */
if (!is_array($config['system']['group']['member']))
$config['system']['group']['member'] = array();
foreach ($config['system']['group'] as $gidx => $group) {
if ($group['name'] == "all") {
$config['system']['group'][$gidx]['member'][] = $userent['uid'];
break;
}
}
$a_user[] = $userent;
}