- Timestamp:
- 02/25/10 15:56:33 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/wifidog/classes/Authenticators/AuthenticatorLocalUser.php
r1428 r1453 101 101 * @param string $password Clear text password. 102 102 * @param string $errmsg Reference of error message 103 * @param int $errno Reference to error code 103 104 * 104 105 * @return object The actual User object if login was successfull, false 105 106 * otherwise. 106 107 */ 107 public function login($username, $password, &$errmsg = null )108 public function login($username, $password, &$errmsg = null, &$errno = 0) 108 109 { 109 110 //echo "DEBUG: login($username, $password, $errmsg)<br/>"; … … 115 116 $username = $db->escapeString($username); 116 117 if (empty($username)) { 117 $errmsg .= sprintf(_("Fatal error: Username cannot be empty")); 118 $errmsg .= sprintf(getErrorText(ERR_NO_USERNAME)); 119 $errno = ERR_NO_USERNAME; 118 120 $retval = false; 119 121 } … … 131 133 $user = User::getObject($user_info['user_id']); 132 134 133 if ($user->isUserValid($errmsg )) {135 if ($user->isUserValid($errmsg, $errno)) { 134 136 $retval = &$user; 135 137 $errmsg = _("Login successfull"); … … 147 149 148 150 if ($user_info == null) { 149 $errmsg = _('Unknown username or email'); 151 $errmsg = getErrorText(ERR_UNKNOWN_USERNAME); 152 $errno = ERR_UNKNOWN_USERNAME; 150 153 } else { 151 $errmsg = _('Incorrect password (Maybe you have CAPS LOCK on?)'); 154 $errmsg = getErrorText(ERR_WRONG_PASSWORD); 155 $errno = ERR_WRONG_PASSWORD; 152 156 } 153 157
