getFirst("UserModel",array("email"=>$email)); $notUser = GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName)); if(is_null($notEmail) || strcmp($email, $notEmail)!=0){ if(is_null($notUser) || strcmp($userName, $notUser)!=0){ if(strcmp($pass, $confPass)==0){ // GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName)); // GlobalVariables::get("dao")->getFirst("UserModel",array("email"=>$email)); // GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName)); $user = new stdClass(); $user->email = $email; $user->password = sha1($pass); $user->username = $userName; $user->newsletter = $newsletter; $userModel = new UserModel($user); // GlobalVariables::get("dao")->save($userModel); echo 'Registrazione avvenuta con successo.A breve riceverai una mail per confermare la tua registrazione'; } else{ // trigger_error("Le due password non coincidono (trigger)"); echo 'Le due password non coincidono'; } } else{ echo 'Questo username è già in uso da un altro utente.'; } } else{ echo 'Questa email risulta già in utilizzo.'; } }catch(Exception $exec){ $msg = LogModel::fromException($exec); GlobalVariables::get("dao")->save($msg); } ?>