When performing a user configuration upgrade, make sure the all group gets

created before syncing accounts to the system.
This commit is contained in:
Matthew Grooms 2008-08-01 23:20:28 +00:00
parent 97b8e3fc89
commit 613cf46cdf

View File

@ -93,6 +93,15 @@ function & getGroupEntry($name) {
return $config['system']['group'][$groupindex[$name]];
}
function & getGroupEntryByGID($gid) {
global $config;
foreach ($config['system']['group'] as & $group)
if ($group['gid'] == $gid)
return $group;
return false;
}
function sync_local_accounts() {
global $config;
@ -129,6 +138,10 @@ function sync_local_accounts() {
pclose($fd);
}
/* make sure the all group exists */
$allgrp = getGroupEntryByGID(1998);
set_local_group($allgrp);
/* sync all local users */
if (is_array($config['system']['user']))
foreach ($config['system']['user'] as $user)