Esempio n. 1
0
 /**
  * 
  * @param type $Email chiave per identificare univocamente l' utente
  * @return \Utente
  */
 function RicercaUtente($Email)
 {
     $UtenteDAO = new FUtente();
     $UtenteDB = $UtenteDAO->GetUtenteByMail($Email);
     $Utente = new Utente($UtenteDB[0][0], $UtenteDB[0][1], $UtenteDB[0][2], $UtenteDB[0][3], $UtenteDB[0][4]);
     return $Utente;
 }
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'];
 }