static function validate()
 {
     $errors = array();
     if (!isset($_POST["mail"]) || !$_POST["mail"]) {
         array_push($errors, 'Ingrese su mail');
     }
     if (isset($_POST["mail"]) && $_POST["mail"] != null && !filter_var($_POST["mail"], FILTER_VALIDATE_EMAIL)) {
         array_push($errors, 'Formato de mail inválido');
     }
     if (isset($_POST["mail"]) && $_POST["mail"] != null && filter_var($_POST["mail"], FILTER_VALIDATE_EMAIL)) {
         $user = SecurityAdmin::getUserByMail($_POST["mail"]);
         if ($user == null) {
             array_push($errors, 'No existe ningun usuario asociado al mail ingresado');
         }
     }
     return $errors;
 }
Ejemplo n.º 2
6
 static function userExists($mail)
 {
     $user = SecurityAdmin::getUserByMail($mail);
     return $user != null;
 }