Example #1
0
 protected function action()
 {
     $userMail = filter_var($_POST['email'], FILTER_SANITIZE_STRING);
     $msg = new SysMsg();
     if ($this->checkEmailAddress($userMail)) {
         $user = new Utente();
         $user->setEmail($userMail);
         $pwd = $user->getForgottenPassword();
         if ($pwd != '') {
             $msg = 'Salve, abbiamo recuperato la sua password: '******'Servizio');
             $mail->setCognome('Support');
             $mail->setEmailFrom('*****@*****.**');
             $mail->setEmailTo($userMail);
             $mail->setEmailReplyTo('*****@*****.**');
             $mail->setOggetto('Recupero password.');
             $mail->setMessaggio($msg);
             $mail->sendMail();
             Session::setObj(Session::SYSMSG, $msg->setMessage('La password &egrave stata inviata a: ' . $userMail)->setType(SysMsg::MSG_OK));
         } else {
             Session::setObj(Session::SYSMSG, $msg->setMessage('Spiacente, non siamo riusciti a recuperare la sua password.')->setType(SysMsg::MSG_CRITICAL));
         }
     } else {
         Session::setObj(Session::SYSMSG, $msg->setMessage('Spiacente, email errata.')->setType(SysMsg::MSG_ALERT));
     }
     //***
     $this->redirect = "message";
 }