当前位置: 首页>>代码示例>>PHP>>正文


PHP UserUtil::isAvailableEmail方法代码示例

本文整理汇总了PHP中UserUtil::isAvailableEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtil::isAvailableEmail方法的具体用法?PHP UserUtil::isAvailableEmail怎么用?PHP UserUtil::isAvailableEmail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserUtil的用法示例。


在下文中一共展示了UserUtil::isAvailableEmail方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: validate

 /**
  * @see Form::validate()
  */
 public function validate()
 {
     AbstractForm::validate();
     // check given user id
     $this->user = new UserEditor($this->userID);
     if (!$this->user->userID) {
         throw new UserInputException('u', 'notValid');
     }
     // user is already enabled
     if ($this->user->reactivationCode == 0) {
         throw new NamedUserException(WCF::getLanguage()->get('wcf.user.emailChange.error.emailAlreadyEnabled'));
     }
     // check whether the new email isn't unique anymore
     if (!UserUtil::isAvailableEmail($this->user->newEmail)) {
         throw new NamedUserException(WCF::getLanguage()->get('wcf.user.emailChange.error.email.notUnique'));
     }
     // check given activation code
     if ($this->user->reactivationCode != $this->activationCode) {
         throw new UserInputException('a', 'notValid');
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:24,代码来源:EmailActivationForm.class.php

示例2: validateEmail

 /**
  * Throws a UserInputException if the email is not unique or not valid.
  * 
  * @param	string		$email
  * @param	string		$confirmEmail
  */
 protected function validateEmail($email, $confirmEmail)
 {
     if (empty($email)) {
         throw new UserInputException('email');
     }
     // check for valid email (one @ etc.)
     if (!UserUtil::isValidEmail($email)) {
         throw new UserInputException('email', 'notValid');
     }
     // Check if email exists already.
     if (!UserUtil::isAvailableEmail($email)) {
         throw new UserInputException('email', 'notUnique');
     }
     // check confirm input
     if (StringUtil::toLowerCase($email) != StringUtil::toLowerCase($confirmEmail)) {
         throw new UserInputException('confirmEmail', 'notEqual');
     }
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:24,代码来源:UserAddForm.class.php

示例3: validate

 /**
  * @see Form::validate()
  */
 public function validate()
 {
     parent::validate();
     // password
     if (empty($this->password)) {
         throw new UserInputException('password');
     }
     if (!WCF::getUser()->checkPassword($this->password)) {
         throw new UserInputException('password', 'false');
     }
     // username
     if ($this->canChangeUsername && $this->username != WCF::getUser()->username) {
         if (StringUtil::toLowerCase($this->username) != StringUtil::toLowerCase(WCF::getUser()->username)) {
             // check for forbidden chars (e.g. the ",")
             if (!UserRegistrationUtil::isValidUsername($this->username)) {
                 throw new UserInputException('username', 'notValid');
             }
             // Check if username exists already.
             if (!UserUtil::isAvailableUsername($this->username)) {
                 throw new UserInputException('username', 'notUnique');
             }
         }
     }
     // password
     if (!empty($this->newPassword) || !empty($this->confirmNewPassword)) {
         if (empty($this->newPassword)) {
             throw new UserInputException('newPassword');
         }
         if (empty($this->confirmNewPassword)) {
             throw new UserInputException('confirmNewPassword');
         }
         if (!UserRegistrationUtil::isSecurePassword($this->newPassword)) {
             throw new UserInputException('newPassword', 'notSecure');
         }
         if ($this->newPassword != $this->confirmNewPassword) {
             throw new UserInputException('confirmNewPassword', 'notEqual');
         }
     }
     // email
     if (WCF::getUser()->getPermission('user.profile.canChangeEmail') && $this->email != WCF::getUser()->email && $this->email != WCF::getUser()->newEmail) {
         if (empty($this->email)) {
             throw new UserInputException('email');
         }
         // check if only letter case is changed
         if (StringUtil::toLowerCase($this->email) != StringUtil::toLowerCase(WCF::getUser()->email)) {
             // check for valid email (one @ etc.)
             if (!UserRegistrationUtil::isValidEmail($this->email)) {
                 throw new UserInputException('email', 'notValid');
             }
             // Check if email exists already.
             if (!UserUtil::isAvailableEmail($this->email)) {
                 throw new UserInputException('email', 'notUnique');
             }
         }
         // check confirm input
         if (StringUtil::toLowerCase($this->email) != StringUtil::toLowerCase($this->confirmEmail)) {
             throw new UserInputException('confirmEmail', 'notEqual');
         }
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:63,代码来源:AccountManagementForm.class.php

示例4: validateEmail

 protected function validateEmail($email)
 {
     if (!UserRegistrationUtil::isValidEmail($email)) {
         throw new UserInputException('email', 'notValid');
     }
     if (!UserUtil::isAvailableEmail($email)) {
         throw new UserInputException('email', 'alreadyUsed');
     }
 }
开发者ID:0xLeon,项目名称:com.leon.wcf.form.user.invitation,代码行数:9,代码来源:InvitationListEditForm.class.php


注:本文中的UserUtil::isAvailableEmail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。