Changeset 169

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

--

Files:

Legend:

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

    r145 r169  
    146146 
    147147/** 
    148  * Validate RealName 
     148 * Validate field 
     149 * 
     150 * @param string $field 
     151 * @param string $errmsg 
     152 
     153 * return void 
     154 * 
     155 * @throws Execption if no field value was given 
    149156 * 
    150157**/ 
     158function validate_field($field,$errmsg) 
     159{ 
     160        if (!isset($field) || !$field) { 
     161                throw new Exception(_($errmsg)); 
     162        } 
     163} 
     164 
     165/** 
     166 * Validate certification honnor  
     167**/ 
     168function validate_honnor($certifhonnor) 
     169{ 
     170        if (!isset($certifhonnor) || $certifhonnor == 0) { 
     171                throw new Exception(_("Vous devez certifié votre déclaration.")); 
     172        } 
     173} 
    151174 
    152175/** 
     
    173196    $password_again = trim($_REQUEST['password_again']); 
    174197    $realname = trim($_REQUEST['realname']); 
    175     $age = trim($_REQUEST['age']); 
     198    $birthday = trim($_REQUEST['birthday']); 
    176199    $address = trim($_REQUEST['address']); 
    177200    $postalcode = trim($_REQUEST['postalcode']); 
     
    183206    $smarty->assign('email', $email); 
    184207    $smarty->assign('realname', $realname); 
    185     $smarty->assign('age', $age); 
     208    $smarty->assign('birthday', $birthday); 
    186209    $smarty->assign('address', $address); 
    187210    $smarty->assign('postalcode', $postalcode); 
     
    223246        // Validate entered values 
    224247        validate_username($username); 
     248                validate_field($realname,"A realname is required."); 
    225249        validate_email($email); 
    226250        validate_passwords($password, $password_again); 
     251                validate_field($birthday,"A birthday date is required."); 
     252                validate_field($address,"An address is required."); 
     253                validate_field($postalcode,"A postal code is required."); 
     254                validate_field($city,"A city is required."); 
     255                validate_field($country,"A country is required."); 
     256                validate_field($phone,"A phone number is required."); 
     257                validate_honor($certifhonnor); 
    227258 
    228259        // Check if user exists 
     
    236267 
    237268        // Create user and send him the validation email 
    238         $created_user = User::createUser(get_guid(), $username, $network, $email, $password); 
     269        $created_user = User::createUser(get_guid(), $username, $network, $email, $password, $realname, $age, $address, $postalcode, $city, $country, $phone); 
    239270        $created_user->sendValidationEmail(); 
    240271