Changeset 221

Show
Ignore:
Timestamp:
01/16/07 23:42:17 (2 years ago)
Author:
syrus
Message:

correction du signup

Files:

Legend:

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

    r183 r221  
    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, $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) 
    218218    { 
    219219        global $db; 
     
    222222        $id_str = $db->escapeString($id); 
    223223        $username_str = $db->escapeString($username); 
    224         $account_origin_str = $db->escapeString($account_origin->getId()); 
     224        $account_origin_str = $account_origin->getAuthenticatorConstructorParams(); 
    225225        $email_str = $db->escapeString($email); 
    226226 
     
    237237        $token = User :: generateToken(); 
    238238 
    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')"); 
    240240 
    241241        $object = new self($id); 
  • wifidog/wifidog-auth/wifidog/signup.php

    r183 r221  
    190190$smarty->assign('SelectNetworkUI', ""); 
    191191 
     192$network_node = Network::getCurrentNetwork(); 
     193 
     194 
    192195if (isset ($_REQUEST["form_request"]) && $_REQUEST["form_request"] == "signup") { 
    193196    // Secure entered values 
     
    217220 
    218221    $network = Network::getObject($_REQUEST['auth_source']); 
    219     $network_node = Network::getCurrentNetwork(); 
     222 
     223  
    220224         
    221225    try { 
     
    251255        // Validate entered values 
    252256        validate_username($username); 
    253                validate_field($realname,"A realname is required."); 
     257        validate_field($realname,"A realname is required."); 
    254258        validate_email($email); 
    255259        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); 
    263267 
    264268        // Check if user exists 
     
    385389} 
    386390 
     391 
    387392// Pass the account_origin along, if it's set 
    388393if (isset($_REQUEST["auth_source"])) { 
    389394    $smarty->assign('selected_auth_source', $_REQUEST["auth_source"]); 
    390395} 
     396else $smarty->assign('selected_auth_source', $network_node->getId()); 
    391397 
    392398$smarty->assign('SelectNetworkUI', Network::getSelectNetworkUI('auth_source')); 
  • wifidog/wifidog-auth/wifidog/templates/sites/signup.tpl

    r175 r221  
    7979        <form name="signup_form" method="post" onsubmit="return false" action="{$base_ssl_path}signup.php"> 
    8080        <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}"> 
    8282                <!--{if $SelectNetworkUI} 
    8383                        {$SelectNetworkUI}