mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
system: avoid error on installer user creation
pw: no such user 'installer'
This commit is contained in:
parent
c626b96117
commit
073dd2ec6d
@ -356,18 +356,20 @@ function local_user_set(&$user, $force_password = false, $userattrs = null)
|
||||
// XXX: primary group id can only be wheel or nobody, otherwise we should map the correct numbers for comparison
|
||||
$user_gid = $user_group == 'wheel' ? 0 : 65534;
|
||||
|
||||
/* passwords only when integrated auth is disabled or forced */
|
||||
if (!$force_password && empty($config['system']['disableintegratedauth'])) {
|
||||
$user_pass = '*';
|
||||
}
|
||||
if (!$force_password) {
|
||||
/* passwords only when integrated auth is disabled or forced */
|
||||
if (empty($config['system']['disableintegratedauth'])) {
|
||||
$user_pass = '*';
|
||||
}
|
||||
|
||||
/* read from pw db if not provided (batch mode) */
|
||||
if ($userattrs === null) {
|
||||
$fd = popen("/usr/sbin/pw usershow -n {$user_name}", 'r');
|
||||
$pwread = fgets($fd);
|
||||
pclose($fd);
|
||||
if (substr_count($pwread, ':')) {
|
||||
$userattrs = explode(':', trim($pwread));
|
||||
/* read from pw db if not provided (batch mode) */
|
||||
if ($userattrs === null) {
|
||||
$fd = popen("/usr/sbin/pw usershow -n {$user_name}", 'r');
|
||||
$pwread = fgets($fd);
|
||||
pclose($fd);
|
||||
if (substr_count($pwread, ':')) {
|
||||
$userattrs = explode(':', trim($pwread));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user