use generatePassword() for generating passwords as it respects the settings; fix user-modification under freebsd as there is no 'usermod'

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2015-01-12 20:24:55 +01:00
parent b78729319c
commit 3ee8f6ac25
2 changed files with 6 additions and 2 deletions

View File

@@ -98,7 +98,11 @@ while ($row = $result_tasks_stmt->fetch(PDO::FETCH_ASSOC)) {
&& !in_array(Settings::Get('system.httpuser'), $groupinfo['members'])
) {
// webserver has no access, add it
safe_exec('usermod -a -G ' . escapeshellarg(Settings::Get('phpfpm.vhost_httpgroup'))." ".escapeshellarg(Settings::Get('system.httpuser')));
if (isFreeBSD()) {
safe_exec('pw user mod '.escapeshellarg(Settings::Get('system.httpuser')).' -G '.escapeshellarg(Settings::Get('phpfpm.vhost_httpgroup')));
} else {
safe_exec('usermod -a -G ' . escapeshellarg(Settings::Get('phpfpm.vhost_httpgroup')).' '.escapeshellarg(Settings::Get('system.httpuser')));
}
}
}