Files
zoneminder/web/api/app/Model
Nic Boet fd93780425 fix: refuse the password admin wherever a password is set refs #5287
The login page's change form and the first-run page refused admin as a
new password, but the user page (Options, Users, and a user's own page
with ZM_USER_SELF_EDIT) and the API (users/add, users/edit) still stored
it. Every login then refused that account.

Check a new password in one place, passwordProblem() in auth.php, and
call it from all four:

- includes/actions/user.php, for an admin's edit and a self edit: the
  save stops with the reason shown on the page. A Password sent as an
  array is refused too (it reached password_hash() before).
- api/app/Model/User.php: an "acceptable" validation rule, so add and
  edit answer with the reason as the validation message. The API loads
  no language file, so passwordProblemText() gives it the English.
- newPasswordProblem() (both login-page forms) checks the confirmation,
  then passwordProblem().

Tests: tests/php/test_default_password.php covers passwordProblem() and
passwordProblemText().
2026-10-16 10:12:53 -05:00
..
2021-02-02 23:19:52 -05:00
2019-12-20 14:56:14 -05:00
2018-03-13 22:28:38 -04:00
2014-11-15 19:03:40 +00:00
2016-05-02 10:41:25 -04:00
2023-02-26 17:04:05 -05:00
2018-05-07 14:09:05 -07:00
2023-11-03 13:33:28 -04:00
2020-09-10 13:31:39 -04:00