Ejemplo n.º 1
0
 public function mailExists()
 {
     if (isset($_GET['mail'])) {
         $response = array("exists" => false);
         $mail = $_GET['mail'];
         if ($_GET['mail'] != '' && \CODOF\User\User::mailExists($mail)) {
             $response['exists'] = true;
         }
         echo json_encode($response);
     }
 }
Ejemplo n.º 2
0
 public function mail($mail)
 {
     $errors = array();
     if (!filter_var($mail, FILTER_VALIDATE_EMAIL)) {
         $errors[] = _t("email address not formatted correctly");
     }
     if (\CODOF\User\User::mailExists($mail)) {
         $errors[] = _t("email address is already registered");
     }
     $this->errors = array_merge($errors, $this->errors);
     if (empty($errors)) {
         \CODOF\Hook::call('on_mail_ok');
         return TRUE;
         //passed
     }
     \CODOF\Hook::call('on_mail_fail');
     return FALSE;
     //Fail
 }