Esempio n. 1
0
 /**
  * 
  * @param type $email
  * @return type boolean ritorna true se l' email non è già nel database
  */
 public function VerificaEmailUnica($email)
 {
     $Bool = false;
     $UtenteDAO = new FUtente();
     if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
         if (!$UtenteDAO->VerificaEmail($email)) {
             //la funz è true se l' email c'è >> voglio invertire il risultao
             $Bool = true;
         }
     }
     return $Bool;
 }
Esempio n. 2
0
 /**
  * 
  * @param type $email identifica l' utente
  * @param type $passwd chiave per accedere
  * @return type array nome & cognome se andata a buon fine, boolan false se fallisce
  */
 public function LogIn($email, $passwd)
 {
     // parametri provvisori!!!!!!!!!!!!
     //$email= mysql_escape_string($_POST['email']);
     //$passwd= mysql_escape_string($_POST['password']);
     $Log = false;
     $UtenteDAO = new FUtente();
     if ($UtenteDAO->VerificaEmail($email)) {
         if ($UtenteDAO->VerificaPassword($email, $passwd)) {
             $AttrUtente = $UtenteDAO->GetUtenteByMail($email);
             $Utente = new Utente($AttrUtente[0]["Nome"], $AttrUtente[0]["Cognome"], $AttrUtente[0]["Password"], $AttrUtente[0]["Email"], $AttrUtente[0]["Prodottiosservati"]);
             $_SESSION['oggetto_utente_loggato'] = $Utente;
             $_SESSION['stato_log'] = 'in';
             $Log = array();
             $Log['Nome'] = $Utente->getNome();
             $Log['Cognome'] = $Utente->getCognome();
         }
     }
     return $Log['Nome'];
 }