mirror of
https://github.com/opnsense/core.git
synced 2026-10-12 02:20:36 +00:00
system: clear password change session flag only after password was changed
PR: GHSA-x3q7-cc7h-gj3v
This commit is contained in:
@@ -110,14 +110,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
} elseif (isset($config['system']['user'][$userindex[$username]]['language'])) {
|
||||
unset($config['system']['user'][$userindex[$username]]['language']);
|
||||
}
|
||||
if (!empty($_SESSION['user_shouldChangePassword'])) {
|
||||
session_start();
|
||||
unset($_SESSION['user_shouldChangePassword']);
|
||||
session_write_close();
|
||||
}
|
||||
if ($pconfig['passwordfld1'] !== '' || $pconfig['passwordfld2'] !== '') {
|
||||
local_user_set_password($config['system']['user'][$userindex[$username]], $pconfig['passwordfld1']);
|
||||
local_user_set($config['system']['user'][$userindex[$username]]);
|
||||
|
||||
if (!empty($_SESSION['user_shouldChangePassword'])) {
|
||||
session_start();
|
||||
unset($_SESSION['user_shouldChangePassword']);
|
||||
session_write_close();
|
||||
}
|
||||
}
|
||||
|
||||
write_config();
|
||||
|
||||
Reference in New Issue
Block a user