Changeset 221
- Timestamp:
- 01/16/07 23:42:17 (2 years ago)
- Files:
-
- wifidog/wifidog-auth/wifidog/classes/User.php (modified) (3 diffs)
- wifidog/wifidog-auth/wifidog/signup.php (modified) (4 diffs)
- wifidog/wifidog-auth/wifidog/templates/sites/signup.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wifidog/wifidog-auth/wifidog/classes/User.php
r183 r221 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, $realname, $birthday, $address, $postalcode, $city, $country, $phone, $network_id)217 static function createUser($id, $username, $account_origin, $email, $password, $realname, $birthday, $address, $postalcode, $city, $country, $phone, $network_id) 218 218 { 219 219 global $db; … … 222 222 $id_str = $db->escapeString($id); 223 223 $username_str = $db->escapeString($username); 224 $account_origin_str = $ db->escapeString($account_origin->getId());224 $account_origin_str = $account_origin->getAuthenticatorConstructorParams(); 225 225 $email_str = $db->escapeString($email); 226 226 … … 237 237 $token = User :: generateToken(); 238 238 239 $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,network) 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','$network_id')");239 $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,network) 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','$network_id')"); 240 240 241 241 $object = new self($id); wifidog/wifidog-auth/wifidog/signup.php
r183 r221 190 190 $smarty->assign('SelectNetworkUI', ""); 191 191 192 $network_node = Network::getCurrentNetwork(); 193 194 192 195 if (isset ($_REQUEST["form_request"]) && $_REQUEST["form_request"] == "signup") { 193 196 // Secure entered values … … 217 220 218 221 $network = Network::getObject($_REQUEST['auth_source']); 219 $network_node = Network::getCurrentNetwork(); 222 223 220 224 221 225 try { … … 251 255 // Validate entered values 252 256 validate_username($username); 253 validate_field($realname,"A realname is required.");257 validate_field($realname,"A realname is required."); 254 258 validate_email($email); 255 259 validate_passwords($password, $password_again); 256 validate_field($birthday,"A birthday date is required.");257 validate_field($address,"An address is required.");258 validate_field($postalcode,"A postal code is required.");259 validate_field($city,"A city is required.");260 validate_field($country,"A country is required.");261 validate_field($phone,"A phone number is required.");262 validate_honnor($certifhonnor);260 validate_field($birthday,"A birthday date is required."); 261 validate_field($address,"An address is required."); 262 validate_field($postalcode,"A postal code is required."); 263 validate_field($city,"A city is required."); 264 validate_field($country,"A country is required."); 265 validate_field($phone,"A phone number is required."); 266 validate_honnor($certifhonnor); 263 267 264 268 // Check if user exists … … 385 389 } 386 390 391 387 392 // Pass the account_origin along, if it's set 388 393 if (isset($_REQUEST["auth_source"])) { 389 394 $smarty->assign('selected_auth_source', $_REQUEST["auth_source"]); 390 395 } 396 else $smarty->assign('selected_auth_source', $network_node->getId()); 391 397 392 398 $smarty->assign('SelectNetworkUI', Network::getSelectNetworkUI('auth_source')); wifidog/wifidog-auth/wifidog/templates/sites/signup.tpl
r175 r221 79 79 <form name="signup_form" method="post" onsubmit="return false" action="{$base_ssl_path}signup.php"> 80 80 <input type="hidden" name="form_request" value="signup"> 81 <input type="hidden" name="auth_source" value=" default-network">81 <input type="hidden" name="auth_source" value="{$selected_auth_source}"> 82 82 <!--{if $SelectNetworkUI} 83 83 {$SelectNetworkUI}
