When using the CLI, only set a user password if it's changed.

This is mainly to prevent session invalidation for the 'admin' user when 'ADMIN_USER_PASS' is defined and the container starts up.  Even if 'ADMIN_USER_PASS' hadn't changed, 'UserHelper::user_modify()' would get invoked and change 'pwd_hash', which would result in 'Sessions::validate_session()' invalidating the session.
This commit is contained in:
supahgreg 2026-04-12 02:49:43 +00:00
parent 5cbcc14224
commit 63c71bad91
No known key found for this signature in database

View File

@ -459,7 +459,7 @@
Debug::log("Changing password of user $login...");
if (UserHelper::user_modify($uid, $password)) {
if (UserHelper::user_has_password($uid, $password) || UserHelper::user_modify($uid, $password)) {
Debug::log("Success.");
} else {
Debug::log("Operation failed, check the logs for more information.");