Login handlers respect the account state
site.ini [UserSettings] LoginHandler[] may list handlers besides standard. The standard handler refuses an
account that is disabled, locked after too many failed sign-ins, or has no account settings record. A handler that
verifies the password elsewhere (a directory, a text file) used to sign the account in without looking at that state:
an administrator could disable an account, and its owner still signed in through the other handler.
Who is affected
Sites that list LDAP or textfile in LoginHandler[]. Sites with only standard (and the two-factor handler) see no change.
LDAP (LoginHandler[]=LDAP)
After the directory has accepted the user's own credentials, the handler checks the account it is about to sign in
(eZUser::accountCanSignIn(), protected):
- its content object exists and is published;
- its
ezuser_settingrecord exists and is enabled; - it is not locked by failed sign-ins (
eZUser::isEnabledAfterFailedLogin(), soTrustedIPList[]andMaxNumberOfFailedLoginwork as for the standard handler).
For an account that already exists the check runs before the group mapping and before the account is updated from the directory; for a new account it runs after the account was created.
A refused sign-in behaves like a refused standard sign-in:
- the handler returns
false, the session stays anonymous; - the login view shows its warning for the account (
$GLOBALS['eZFailedLoginAttemptUserID']); - the failed-attempt counter grows by one (not for a disabled account, a trusted address or
MaxNumberOfFailedLogin=0, as with the standard handler); - one warning naming the user id is written to the debug log;
- an existing account is not updated: its name, e-mail address and group placement stay as they were.
An account without a settings record is treated as not enabled on every path of this handler, also when the typed password matches a local password hash; before, that path stopped the request with an error.
Text file (LoginHandler[]=textfile)
The handler applies the same check (eZUser::accountCanSignIn()) and the same refusal as the LDAP handler.
- An existing account is checked after the text file accepted the password and before anything is written: a refused account is not updated from the file (name, e-mail address, group placement stay as they were).
- A new account is created and published first; it signs in (last visit, session, reset of the failed-attempt counter) only after that transaction was committed and the check passed. Before, the session was changed inside the open transaction, before the publish ran. If the publish left the account unusable (for example a disabled settings row that existed already), the sign-in is refused and the account stays as the publish left it.
- An account without a settings record is treated as not enabled on every path, also when the typed password matches a local password hash; before, that path stopped the request with an error.
Legacy hash (password_hash_type=4)
Both handlers used to send the typed password to MySQL (PASSWORD('...')) to check an account whose hash is of the
legacy MySQL type. The query is gone: it put the password into the query text (query log, slow log, debug output) and
fails on MySQL versions that no longer have the function. The handlers now run the same lookup on every database and
do not check such a hash locally.
- Find the accounts:
SELECT contentobject_id, login FROM ezuser WHERE password_hash_type=4. - They keep working through the standard handler, which is first in the default chain; its check is unchanged.
- For these two handlers the directory (LDAP) or the text file decides: the account signs in only when it accepts the typed credentials. With the directory off, or a different password in the text file, the sign-in is refused.
- A sign-in through the directory or the text file replaces the local hash with an empty one.
Password placeholder
The edit form of a user account posts the value _ezpassword for both password fields when the password is not to be
changed. It used to be accepted for every account, including one that was still being created: a registration, a new
user in the administration, or an account that exists only as a draft. Posting the placeholder there stored it as the
password of the new account without any check of the password policy.
Now the placeholder is accepted only for an account that is already stored (an ezuser row with a login). On a new
account it is refused with "The password cannot be empty.", whatever MinPasswordLength and GeneratePasswordIfEmpty
say. Stored accounts keep working as before, including directory and text-file accounts with an empty local password
hash: editing them keeps the placeholder and gives them no local password.
Node move
Moving a node changes the groups, and so the roles, of every account below it. The cached rights of those accounts
([RoleSettings] EnableCaching=true) stayed valid after a move of a user group until the cache expired by itself,
so the members kept the rights of the old parent group. The purge of a moved account also ran before the move was
committed, so a request in between could rebuild the cache from the old tree.
Now eZContentObjectTreeNodeOperations::move() expires the cached rights after the move was committed: the cache of a
moved account is purged, and when a moved node that is not an account holds at least one account anywhere below it,
the rights cache of all users is expired. A refused or rolled back move expires nothing, and neither does a move of a
node without accounts. Nothing to configure; after a large move the next request of each user rebuilds its cache once.
What to check
- Accounts that should sign in through the directory or the text file are enabled (Administration, the user's account settings), and each has a settings record. Accounts created by an import or a migration without the record cannot sign in any more; create the record (enabled) for those that should.
- If
MaxNumberOfFailedLoginis set, a directory account that exceeded it is now locked like any other account until an administrator resets the counter or enables it again. - After moving a user group, its members have the rights of the new parent group on their next request.