예제 #1
0
 /**
  * Verification callback to check the email address is in a valid form
  *
  * @param string Email Address
  *
  * @return bool
  */
 protected function _verifyEmail(&$email)
 {
     if ($this->isUpdate() && $email === $this->getExisting('email')) {
         return true;
     }
     if ($this->getOption(self::OPTION_ADMIN_EDIT) && $email === '') {
         return true;
     }
     if (!XenForo_Helper_Email::isEmailValid($email)) {
         $this->error(new XenForo_Phrase('please_enter_valid_email'), 'email');
         return false;
     }
     $existingUser = $this->_getUserModel()->getUserByEmail($email);
     if ($existingUser && $existingUser['user_id'] != $this->get('user_id')) {
         $this->error(new XenForo_Phrase('email_addresses_must_be_unique'), 'email');
         return false;
     }
     if (XenForo_Helper_Email::isEmailBanned($email)) {
         $this->error(new XenForo_Phrase('email_address_you_entered_has_been_banned_by_administrator'), 'email');
         return false;
     }
     return true;
 }
예제 #2
0
 public function verifyEmail($email, $userId = null)
 {
     if (!Zend_Validate::is($email, 'EmailAddress')) {
         return new XenForo_Phrase('please_enter_valid_email');
     }
     $existingUser = XenForo_Model::create('XenForo_Model_User')->getUserByEmail($email);
     if ($existingUser && (!$userId || $userId && $userId != $existingUser['user_id'])) {
         return new XenForo_Phrase('email_addresses_must_be_unique');
     }
     if (XenForo_Helper_Email::isEmailBanned($email)) {
         return new XenForo_Phrase('email_address_you_entered_has_been_banned_by_administrator');
     }
     return true;
 }
예제 #3
0
 /**
  * Verification callback to check the email address is in a valid form
  *
  * @param string Email Address
  *
  * @return bool
  */
 protected function _verifyEmail(&$email)
 {
     if ($this->isUpdate() && $email === $this->getExisting('paypal_email')) {
         return true;
     }
     if ($email === '') {
         return true;
     }
     if (!XenForo_Helper_Email::isEmailValid($email)) {
         $this->error(new XenForo_Phrase('please_enter_valid_email'), 'email');
         return false;
     }
     if (XenForo_Helper_Email::isEmailBanned($email)) {
         $this->error(new XenForo_Phrase('email_address_you_entered_has_been_banned_by_administrator'), 'email');
         return false;
     }
     return true;
 }