Changeset 168
- Timestamp:
- 12/22/06 16:08:45 (2 years ago)
- Files:
-
- wifidog/wifidog-auth/wifidog/classes/User.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wifidog/wifidog-auth/wifidog/classes/User.php
r143 r168 215 215 * @return the newly created User object, or null if there was an error 216 216 */ 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) 218 218 { 219 219 global $db; … … 225 225 $email_str = $db->escapeString($email); 226 226 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 227 236 $password_hash = $db->escapeString(User :: passwordHash($password)); 228 237 $status = ACCOUNT_STATUS_VALIDATION; 229 238 $token = User :: generateToken(); 230 239 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')"); 232 241 233 242 $object = new self($id); … … 395 404 { 396 405 $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 ); 398 407 for ($i = 0 ; $i < count($account_status_array) ; $i++) 399 408 { … … 423 432 $retval = false; 424 433 $account_status = $this->getAccountStatus(); 425 if ($account_status == ACCOUNT_STATUS_ALLOWED )434 if ($account_status == ACCOUNT_STATUS_ALLOWED || $account_status == ACCOUNT_STATUS_MEMBER) 426 435 { 427 436 $retval = true; … … 674 683 case ACCOUNT_STATUS_ALLOWED: 675 684 return "Validé"; 685 break; 686 case ACCOUNT_STATUS_MEMBER: 687 return "Membre"; 676 688 break; 677 689 case ACCOUNT_STATUS_VALIDATION: … … 864 876 $name = "user_".$this->getId()."_username"; 865 877 $this->setUsername($_REQUEST[$name]); 878 879 // realname to code 880 866 881 } 867 882 }
