#425 support empty loginShell

This commit is contained in:
Roland Gruber 2025-04-07 07:40:03 +02:00
parent 37b0f15379
commit 9dd6eda474

View file

@ -558,7 +558,7 @@ class posixAccount extends baseModule implements passwordService, AccountStatusP
if (!isset($this->attributes['gidNumber'][0]) || ($this->attributes['gidNumber'][0] == '')) { if (!isset($this->attributes['gidNumber'][0]) || ($this->attributes['gidNumber'][0] == '')) {
return false; return false;
} }
return isset($this->attributes['loginShell'][0]) && ($this->attributes['loginShell'][0] != ''); return true;
} }
/** /**
@ -3540,9 +3540,9 @@ class posixAccount extends baseModule implements passwordService, AccountStatusP
// shell // shell
if (in_array('loginShell', $fields) && !in_array('loginShell', $readOnlyFields)) { if (in_array('loginShell', $fields) && !in_array('loginShell', $readOnlyFields)) {
$shelllist = $this->getShells(); // list of all valid shells $shelllist = $this->getShells(); // list of all valid shells
if (in_array($_POST['posixAccount_loginShell'], $shelllist) if (in_array($_POST['posixAccount_loginShell'], $shelllist)) {
&& (!isset($attributes['loginShell']) || ($attributes['loginShell'][0] != $_POST['posixAccount_loginShell']))) { $this->checkSimpleSelfServiceTextField($return, 'loginShell', $attributes, $fields,
$return['mod']['loginShell'][0] = $_POST['posixAccount_loginShell']; $readOnlyFields);
} }
} }
return $return; return $return;