mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
system: more of the same for #8221
This commit is contained in:
parent
43cf2fccea
commit
ad358ed999
@ -243,7 +243,7 @@ function local_sync_accounts()
|
||||
$config_map[$section] = [];
|
||||
if (is_array($config['system'][$section])) {
|
||||
foreach ($config['system'][$section] as $item) {
|
||||
if ($section == 'user' && empty($item['shell'])) {
|
||||
if ($section == 'user' && (empty($item['shell']) || $user['uid'] != 0)) {
|
||||
/* no shell, no local user */
|
||||
continue;
|
||||
}
|
||||
@ -293,7 +293,7 @@ function local_user_set(&$user, $force_password = false, $userattrs = null)
|
||||
if (empty($user['password'])) {
|
||||
auth_log("Cannot set user {$user['name']}: password is missing");
|
||||
return;
|
||||
} elseif (empty($user['shell'])) {
|
||||
} elseif (empty($user['shell']) || $user['uid'] != 0) {
|
||||
/* no shell, no local user */
|
||||
return;
|
||||
}
|
||||
|
||||
@ -489,9 +489,10 @@ function core_run()
|
||||
function core_user_changed_groups($unused, $username)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (is_array($config['system']['user'])) {
|
||||
foreach ($config['system']['user'] as $user) {
|
||||
if ($user['name'] == $username && !empty($user['shell'])) {
|
||||
if ($user['name'] == $username && (!empty($user['shell']) || $user['uid'] == 0)) {
|
||||
exec("/usr/bin/groups " . escapeshellarg($username) . ' 2>/dev/null', $out, $ret);
|
||||
$current_groups = [];
|
||||
if (!$ret) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user