Changeset 168

Show
Ignore:
Timestamp:
12/22/06 16:08:45 (2 years ago)
Author:
syrus
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wifidog/wifidog-auth/wifidog/classes/User.php

    r143 r168  
    215215     * @return the newly created User object, or null if there was an error 
    216216     */ 
    217     static function createUser($id, $username, Network $account_origin, $email, $password
     217    static function createUser($id, $username, Network $account_origin, $email, $password, $realname, $birthday, $address, $postalcode, $city, $country, $phone
    218218    { 
    219219        global $db; 
     
    225225        $email_str = $db->escapeString($email); 
    226226 
     227                $realname_str = $db->escapeString($realname); 
     228                $birthday_str = $db->escapeString($birthday); 
     229                $address_str = $db->escapeString($address); 
     230                $postalcode_str = $db->escapeString($postalcode); 
     231                $city_str = $db->escapeString($city); 
     232                $country_str = $db->escapeString($country); 
     233                $phone_str = $db->escapeString($phone); 
     234                 
     235 
    227236        $password_hash = $db->escapeString(User :: passwordHash($password)); 
    228237        $status = ACCOUNT_STATUS_VALIDATION; 
    229238        $token = User :: generateToken(); 
    230239 
    231         $db->execSqlUpdate("INSERT INTO users (user_id,username, account_origin,email,pass,account_status,validation_token,reg_date) VALUES ('$id_str','$username_str','$account_origin_str','$email_str','$password_hash','$status','$token',NOW())"); 
     240        $db->execSqlUpdate("INSERT INTO users (user_id,username, account_origin,email,pass,account_status,validation_token,reg_date,real_name,birthday,address,postalcode,city,country,phone) VALUES ('$id_str','$username_str','$account_origin_str','$email_str','$password_hash','$status','$token',NOW(),'$realname_str','$birthday_str','$address_str','$postalcode_str','$city_str','$country_str','$phone_str')"); 
    232241 
    233242        $object = new self($id); 
     
    395404        { 
    396405                $html = "<select name='$n'>\n"; 
    397                 $account_status_array = array ( ACCOUNT_STATUS_ERROR , ACCOUNT_STATUS_DENIED, ACCOUNT_STATUS_ALLOWED , ACCOUNT_STATUS_VALIDATION , ACCOUNT_STATUS_VALIDATION_FAILED , ACCOUNT_STATUS_LOCKED ); 
     406                $account_status_array = array ( ACCOUNT_STATUS_ERROR , ACCOUNT_STATUS_DENIED, ACCOUNT_STATUS_ALLOWED , ACCOUNT_STATUS_MEMBER, ACCOUNT_STATUS_VALIDATION , ACCOUNT_STATUS_VALIDATION_FAILED , ACCOUNT_STATUS_LOCKED ); 
    398407                for ($i = 0 ; $i < count($account_status_array) ; $i++) 
    399408                { 
     
    423432        $retval = false; 
    424433        $account_status = $this->getAccountStatus(); 
    425         if ($account_status == ACCOUNT_STATUS_ALLOWED
     434        if ($account_status == ACCOUNT_STATUS_ALLOWED || $account_status == ACCOUNT_STATUS_MEMBER
    426435        { 
    427436            $retval = true; 
     
    674683                        case ACCOUNT_STATUS_ALLOWED: 
    675684                                return "Valid&eacute;"; 
     685                                break; 
     686                        case ACCOUNT_STATUS_MEMBER: 
     687                                return "Membre"; 
    676688                                break; 
    677689                        case ACCOUNT_STATUS_VALIDATION: 
     
    864876        $name = "user_".$this->getId()."_username"; 
    865877        $this->setUsername($_REQUEST[$name]); 
     878                 
     879                // realname to code 
     880 
    866881 } 
    867882    }