本文整理匯總了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]];
}
示例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'));
}
}]];
}
示例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']];
}