From 3ee8f6ac2515ac92858145a4968b7f4042be33ab Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 12 Jan 2015 20:24:55 +0100 Subject: [PATCH] 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) --- admin_customers.php | 2 +- scripts/jobs/cron_tasks.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/admin_customers.php b/admin_customers.php index edc0577c..5056d4ea 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -632,7 +632,7 @@ if ($page == 'customers' } if ($password == '') { - $password = substr(md5(uniqid(microtime(), 1)), 12, 6); + $password = generatePassword(); } $_theme = Settings::Get('panel.default_theme'); diff --git a/scripts/jobs/cron_tasks.php b/scripts/jobs/cron_tasks.php index 395c91e3..d1e2f657 100644 --- a/scripts/jobs/cron_tasks.php +++ b/scripts/jobs/cron_tasks.php @@ -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'))); + } } }