Commit a2381e6c authored by Franco Fichtner's avatar Franco Fichtner

system: do not prompt for password on user edit

PR: https://lists.opnsense.org/pipermail/users/2017-March/000062.html
parent 122deaf9
......@@ -235,10 +235,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$input_errors[] = gettext('Cannot set random password due to explicit input.');
}
if (empty($pconfig['passwordfld1']) && empty($pconfig['gen_new_password'])) {
$input_errors[] = gettext('A password is required.');
}
if (!empty($pconfig['disabled']) && $_SESSION['Username'] === $a_user[$id]['name']) {
$input_errors[] = gettext('You cannot disable yourself.');
}
......@@ -246,8 +242,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (isset($id)) {
$oldusername = $a_user[$id]['name'];
} else {
$oldusername = "";
$oldusername = '';
if (empty($pconfig['passwordfld1']) && empty($pconfig['gen_new_password'])) {
$input_errors[] = gettext('A password is required.');
}
}
/* make sure this user name is unique */
if (count($input_errors) == 0) {
foreach ($a_user as $userent) {
......@@ -257,6 +258,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
}
/* also make sure it is not reserved */
if (count($input_errors) == 0) {
$system_users = explode("\n", file_get_contents("/etc/passwd"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment