Changeset 791


Ignore:
Timestamp:
Apr 7, 2023 11:13:53 PM (13 months ago)
Author:
anonymous
Message:

Log authentication failures because of 'multiple users with username'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Auth_SQL.inc.php

    r780 r791  
    429429            WHERE " . $this->_params['db_username_column'] . " = '" . $db->escapeString($username) . "'
    430430        ");
    431         if (mysql_num_rows($qid) !== 1 || !$user_data = mysql_fetch_assoc($qid)) {
    432             $app->logMsg(sprintf('Username %s not found for authentication', $username), LOG_NOTICE, __FILE__, __LINE__);
     431        if (mysql_num_rows($qid) === 0 || !$user_data = mysql_fetch_assoc($qid)) {
     432            $app->logMsg(sprintf('Authentication failed; username %s not found', $username), LOG_NOTICE, __FILE__, __LINE__);
     433            return false;
     434        }
     435        if (mysql_num_rows($qid) !== 1) {
     436            $app->logMsg(sprintf('Authentication failed; multiple users with username "%s"', $username), LOG_WARNING, __FILE__, __LINE__);
    433437            return false;
    434438        }
Note: See TracChangeset for help on using the changeset viewer.