Show
Ignore:
Timestamp:
02/25/10 15:56:33 (2 years ago)
Author:
gbastien
Message:
  • Added possibility to have a deployed geolocated node not show on map (quick fix) (#706)
  • When producing anonymised data export, two files are produced, one for the geolocated nodes and one for the connections (#705)
  • Additions and bug fixes to web service: can now logout and auth returns both error code and message
  • Starting work on #707 as needed
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/classes/Authenticators/AuthenticatorLocalUser.php

    r1428 r1453  
    101101     * @param string $password Clear text password. 
    102102     * @param string $errmsg   Reference of error message 
     103     * @param int $errno       Reference to error code 
    103104     * 
    104105     * @return object The actual User object if login was successfull, false 
    105106     *                otherwise. 
    106107     */ 
    107     public function login($username, $password, &$errmsg = null) 
     108    public function login($username, $password, &$errmsg = null, &$errno = 0) 
    108109    { 
    109110        //echo "DEBUG:  login($username, $password, $errmsg)<br/>"; 
     
    115116        $username = $db->escapeString($username); 
    116117        if (empty($username)) { 
    117             $errmsg .= sprintf(_("Fatal error:  Username cannot be empty")); 
     118            $errmsg .= sprintf(getErrorText(ERR_NO_USERNAME)); 
     119            $errno = ERR_NO_USERNAME; 
    118120            $retval = false; 
    119121        } 
     
    131133                $user = User::getObject($user_info['user_id']); 
    132134 
    133                 if ($user->isUserValid($errmsg)) { 
     135                if ($user->isUserValid($errmsg, $errno)) { 
    134136                    $retval = &$user; 
    135137                    $errmsg = _("Login successfull"); 
     
    147149 
    148150                if ($user_info == null) { 
    149                     $errmsg = _('Unknown username or email'); 
     151                    $errmsg = getErrorText(ERR_UNKNOWN_USERNAME); 
     152                    $errno = ERR_UNKNOWN_USERNAME; 
    150153                } else { 
    151                     $errmsg = _('Incorrect password (Maybe you have CAPS LOCK on?)'); 
     154                    $errmsg = getErrorText(ERR_WRONG_PASSWORD); 
     155                    $errno = ERR_WRONG_PASSWORD; 
    152156                } 
    153157