system: clear password change session flag only after password was changed

PR: GHSA-x3q7-cc7h-gj3v
This commit is contained in:
Franco Fichtner
2026-09-22 07:52:14 +02:00
parent 4e03c6ea43
commit c2bbd69954
+6 -5
View File
@@ -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();