function checkUniqEmail(array $group) { $email = $group['email']; if (!Am_Validate::email($email)) { return ___('Please enter valid Email'); } if ($this->record->getTable()->checkUniqEmail($email, $this->record ? $this->record->pk() : null) === 0) { return ___('An account with the same email already exists.'); } }
function ajaxCheckUniqEmail($vars) { $user_id = $this->getDi()->auth->getUserId(); if (!$user_id) { $user_id = $this->getDi()->session->signup_member_id; } $email = $vars['email']; $msg = null; if ($_url = @$vars['_url']) { $url = base64_decode($_url); } else { $url = REL_ROOT_URL . '/member'; } if (!$this->getDi()->userTable->checkUniqEmail($email, $user_id)) { $msg = ___('An account with the same email already exists.') . '<br />' . ___('Please %slogin%s to your existing account.%sIf you have not completed payment, you will be able to complete it after login', '<a href="' . Am_Controller::escape($url) . '" class="ajax-link">', '</a>', '<br />'); } if (!$msg) { $msg = Am_Di::getInstance()->banTable->checkBan(array('email' => $email)); } if (!$msg && !Am_Validate::email($email)) { $msg = ___('Please enter valid Email'); } return $this->ajaxResponse($msg ? $msg : true); }
function validateOtherEmails($val, $el) { $vars = $el->getContainer()->getValue(); if ($vars['recipient_other'] == 1) { if (!strlen($vars['recipient_emails'])) { return ___('Please enter one or more email'); } if (!Am_Validate::emails($val)) { return ___('Please enter valid e-mail addresses'); } } }
function checkBackupEmail($val) { $res = $val['email_backup_frequency'] ? Am_Validate::email($val['email_backup_address']) : true; if (!$res) { $elements = $this->getElementsByName('email_backup_address'); $elements[0]->setError(___('This field is required')); } return $res; }
function checkUniqEmail($email) { if (!Am_Validate::email($email)) { return ___('Email [%s] is not valid', Am_Controller::escape($email)); } if ($this->getDi()->userTable->checkUniqEmail($email) === 0) { return ___('An account with the same email [%s] is already exists.', Am_Controller::escape($email)); } }
function checkUniqEmail(array $group) { $email = $group['email']; if (!Am_Validate::email($email)) { return ___('Please enter valid Email'); } // Do the same for email if case there are plugins that use email as username. // We need to check email only when user is not exists, or when he change his email. $user_id = $this->record ? $this->record->pk() : null; if (!$user_id || strcasecmp($this->record->email, $email) !== 0) { if (!$this->record->getTable()->checkUniqEmail($email, $user_id)) { return ___('An account with the same email already exists.'); } } }