當前位置: 首頁>>代碼示例>>PHP>>正文


PHP User::getIsConfirmed方法代碼示例

本文整理匯總了PHP中dektrium\user\models\User::getIsConfirmed方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::getIsConfirmed方法的具體用法?PHP User::getIsConfirmed怎麽用?PHP User::getIsConfirmed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在dektrium\user\models\User的用法示例。


在下文中一共展示了User::getIsConfirmed方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: rules

 /** @inheritdoc */
 public function rules()
 {
     return ['emailTrim' => ['email', 'filter', 'filter' => 'trim'], 'emailRequired' => ['email', 'required'], 'emailPattern' => ['email', 'email'], 'emailExist' => ['email', 'exist', 'targetClass' => $this->module->modelMap['User'], 'message' => \Yii::t('user', 'There is no user with this email address')], 'emailUnconfirmed' => ['email', function ($attribute) {
         $this->user = $this->finder->findUserByEmail($this->email);
         if ($this->user !== null && $this->module->enableConfirmation && !$this->user->getIsConfirmed()) {
             $this->addError($attribute, \Yii::t('user', 'You need to confirm your email address'));
         }
     }], 'passwordRequired' => ['password', 'required'], 'passwordLength' => ['password', 'string', 'min' => 6]];
 }
開發者ID:manyoubaby123,項目名稱:imshop,代碼行數:10,代碼來源:RecoveryForm.php

示例2: rules

 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [['email', 'filter', 'filter' => 'trim'], ['email', 'required'], ['email', 'email'], ['email', 'exist', 'targetClass' => $this->module->manager->userClass, 'message' => \Yii::t('user', 'There is no user with such email.')], ['email', function ($attribute) {
         $this->_user = $this->module->manager->findUserByEmail($this->email);
         if ($this->_user !== null && $this->getModule()->enableConfirmation && !$this->_user->getIsConfirmed()) {
             $this->addError($attribute, \Yii::t('user', 'You need to confirm your email address'));
         }
     }]];
 }
開發者ID:ilyar,項目名稱:dektrium-yii2-user,代碼行數:12,代碼來源:RecoveryRequestForm.php

示例3: rules

 /** @inheritdoc */
 public function rules()
 {
     return ['requiredFields' => [['login', 'password'], 'required'], 'loginTrim' => ['login', 'trim'], 'passwordValidate' => ['password', function ($attribute) {
         if ($this->user === null || !Password::validate($this->password, $this->user->password_hash)) {
             $this->addError($attribute, Yii::t('user', 'Invalid login or password'));
         }
     }], 'confirmationValidate' => ['login', function ($attribute) {
         if ($this->user !== null) {
             $confirmationRequired = $this->module->enableConfirmation && !$this->module->enableUnconfirmedLogin;
             if ($confirmationRequired && !$this->user->getIsConfirmed()) {
                 $this->addError($attribute, Yii::t('user', 'You need to confirm your email address'));
             }
             if ($this->user->getIsBlocked()) {
                 $this->addError($attribute, Yii::t('user', 'Your account has been blocked'));
             }
         }
     }], 'rememberMe' => ['rememberMe', 'boolean']];
 }
開發者ID:damasco,項目名稱:yii2-user,代碼行數:19,代碼來源:LoginForm.php


注:本文中的dektrium\user\models\User::getIsConfirmed方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。