Exemple #1
0
 public function register($email, $password, $password_again, $token = null, $street, $number, $zip, $ip)
 {
     $Email = Antiexploit::detectExploit($email, $ip);
     $Password = Antiexploit::detectExploit($password, $ip);
     $PasswordAgain = Antiexploit::detectExploit($password_again, $ip);
     $Token = $token !== null ? Antiexploit::detectNumericExploit($token, $ip) : null;
     $Street = strip_tags($street);
     $Number = Antiexploit::detectNumericExploit($number, $ip);
     $Zip = Antiexploit::detectExploit($zip, $ip);
     /* first check if user exists */
     $handle = Database::checkColumn("SELECT * FROM users WHERE email = ?", array($email));
     if ($handle == true) {
         return false;
     } else {
         /* user doesnt exist, lets insert into the database */
         if ($Password == $PasswordAgain) {
             $_pass = $this->betterCrypt($Password);
             Database::query("INSERT INTO users (email, password, id_code, street_name, house_number, zip_code, ip_address) VALUES (?, ?, ?, ?, ?, ?, ?)", "insert", array($Email, $_pass, $Token, $Street, $Number, $Zip, $ip));
             return true;
         }
     }
 }