/**
  * 
  * @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;
 }
Beispiel #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'];
 }
Beispiel #3
0
 /**
  * Se l' utente modifica i preferiti durante la sessione, occore che si modifichino anche i dati in 
  * sessione oltre che quelli presenti nel db
  * @param type $email 
  */
 function updateOggettoSessione($email)
 {
     $UtenteDAO = new FUtente();
     $Risult = $UtenteDAO->searchColonnaSelect("UtenteRegistrato", "Prodottiosservati", "Email", $email);
     $ProdottiOsservati = $Risult[0]["Prodottiosservati"];
     $_SESSION['oggetto_utente_loggato']->setProdottiOsservati($ProdottiOsservati);
 }
Beispiel #4
0
 private function attivaUtente($paramUserEmail)
 {
     // controllo se esiste
     echo $paramUserEmail;
     $futente = new FUtente();
     $esito = $futente->load($paramUserEmail);
     if (!$esito['stato']) {
         // lo attivo
         return $futente->activateUser($paramUserEmail);
     } else {
         return $flag = 'Utente non esistente';
     }
 }
Beispiel #5
0
 public function impostaTemplateLista()
 {
     // costruisco la lista nella zona centrale
     $lista = array();
     // richiamo l'array dei mezzi dal db
     $futente = new FUtente();
     $futente_load = $futente->getAllElement();
     if (!$futente_load[0]) {
         return $this->setRedirectText('E\' presente solo l\'amministratore del sistema');
     } else {
         $i = 0;
         foreach ($futente_load as $value) {
             $lista[$i] = $this->setElementoUtente($value);
             $i++;
         }
     }
     $this->assign('list', $lista);
     $template = $this->fetch('./templates/lista.tpl');
     return $this->impostaZonaCentraleTemplateUtente($template);
 }
Beispiel #6
0
 /**
  * Controlla se un utente è gia inserito nel database
  * @param type $numero
  * @return type
  */
 public function checkUtente($numero)
 {
     $FUtente = new FUtente();
     $result = $FUtente->load($numero);
     return $result;
 }