core_second/functions/functions.register.php
/******************************************************
 * SET OF FUNCTIONS USED TO MANAGE REGISTER PROCEDURE *
 ******************************************************/
SET OF FUNCTIONS USED TO MANAGE REGISTER PROCEDURE
SET OF FUNCTIONS USED TO MANAGE REGISTER PROCEDURE
function check_register($login, $mail, $checkmail, $password, $checkpassword, $config, $dbsocket)
 {
   $insert_db = true;
   $check_result = array(
     "message" => "",
     "valid" => "",
     "loginmessage" => "",
     "loginclass" => "",
     "login" => "",
     "mailmessage" => "",
     "mailclass" => "",
     "mail" => "",
     "passwordmessage" => "",
     "passwordclass" => ""
   );
   $vlogin = check_login($login, $config, $dbsocket);
   $vmail = check_mails($mail, $checkmail, $config, $dbsocket);
   $vpassword = check_passwords($password, $checkpassword, $config);
   if(gettype($vlogin) != 'boolean')
   {
     $check_result['loginmessage'] = $vlogin;
     $check_result['loginclass'] = 'badinput';
     $insert_db = false;
   }
   else
   {
     $check_result['login'] = $login;
     $check_result['loginclass'] = 'correctinput';
   }
   if(gettype($vmail) != 'boolean')
   {
     $check_result['mailmessage'] = $vmail;
     $check_result['mailclass'] = 'badinput';
     $insert_db = false;
   }
   else
   {
     $check_result['mail'] = $mail;
     $check_result['mailclass'] = 'correctinput';
   }
   if(gettype($vpassword) != 'boolean')
   {
     $check_result['passwordmessage'] = $vpassword;
     $check_result['passwordclass'] = 'badinput';
     $insert_db = false;
   }
   if($insert_db == true)
   {
     $check_result['message'] = '<span class="success_msg"> Inscription réussie, veuillez valider celle-ci via le lien envoyé à votre mail. </span><br/>';
     $check_result['valid'] = true;
   }
   else
   {
     $check_result['message'] = '<span class="error_msg"> Une erreur est surevenue lors de votre inscription ! </span><br/>';
     $check_result['valid'] = false;
   }
   return $check_result;
 }
function check_register ( $ login , $ mail , $ checkmail , $ password , $ checkpassword , $ config , $ dbsocket ) { $ insert_db = true ; $ check_result = array ( " message " => " " , " valid " => " " , " loginmessage " => " " , " loginclass " => " " , " login " => " " , " mailmessage " => " " , " mailclass " => " " , " mail " => " " , " passwordmessage " => " " , " passwordclass " => " " ) ; $ vlogin = check_login ( $ login , $ config , $ dbsocket ) ; $ vmail = check_mails ( $ mail , $ checkmail , $ config , $ dbsocket ) ; $ vpassword = check_passwords ( $ password , $ checkpassword , $ config ) ; if ( gettype ( $ vlogin ) != 'boolean' ) { $ check_result [ 'loginmessage' ] = $ vlogin ; $ check_result [ 'loginclass' ] = 'badinput' ; $ insert_db = false ; } else { $ check_result [ 'login' ] = $ login ; $ check_result [ 'loginclass' ] = 'correctinput' ; } if ( gettype ( $ vmail ) != 'boolean' ) { $ check_result [ 'mailmessage' ] = $ vmail ; $ check_result [ 'mailclass' ] = 'badinput' ; $ insert_db = false ; } else { $ check_result [ 'mail' ] = $ mail ; $ check_result [ 'mailclass' ] = 'correctinput' ; } if ( gettype ( $ vpassword ) != 'boolean' ) { $ check_result [ 'passwordmessage' ] = $ vpassword ; $ check_result [ 'passwordclass' ] = 'badinput' ; $ insert_db = false ; } if ( $ insert_db == true ) { $ check_result [ 'message' ] = '<span class="success_msg"> Inscription réussie, veuillez valider celle-ci via le lien envoyé à votre mail. </span><br/>'; $ check_result [ 'valid' ] = true ; } else { $ check_result [ 'message' ] = '<span class="error_msg"> Une erreur est surevenue lors de votre inscription ! </span><br/>' ; $ check_result [ 'valid' ] = false ; } return $ check_result ; }
SET OF FUNCTIONS USED TO MANAGE REGISTER PROCEDURE
SET OF FUNCTIONS USED TO MANAGE REGISTER PROCEDURE