- Timestamp:
- 10/30/09 14:21:05 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/wifidog/classes/Authenticators/AuthenticatorLocalUser.php
r1419 r1428 119 119 } 120 120 else{ 121 /* gbastien: this is not reusable!!, why not use password directly? */ 122 //$password_hash = User::passwordHash($_REQUEST['password']); 123 $password_hash = User::passwordHash($password); 121 124 $password = $db->escapeString($password); 122 $password_hash = User::passwordHash($_REQUEST['password']);123 124 $sql = "SELECT user_id FROM users WHERE (username ='$username' OR email='$username') AND account_origin='".$this->getNetwork()->getId()."' AND pass='$password_hash'";125 126 $comparison = ($this->getNetwork()->getUsernamesCaseSensitive()? ' = ': ' ILike '); 127 $sql = "SELECT user_id FROM users WHERE (username$comparison'$username' OR email$comparison'$username') AND account_origin='".$this->getNetwork()->getId()."' AND pass='$password_hash'"; 125 128 $db->execSqlUniqueRes($sql, $user_info, false); 126 129 … … 141 144 */ 142 145 $user_info = null; 143 $db->execSqlUniqueRes("SELECT * FROM users WHERE (username ='$username' OR email='$username') AND account_origin='".$this->getNetwork()->getId()."'", $user_info, false);146 $db->execSqlUniqueRes("SELECT * FROM users WHERE (username$comparison'$username' OR email$comparison'$username') AND account_origin='".$this->getNetwork()->getId()."'", $user_info, false); 144 147 145 148 if ($user_info == null) {
