/** * @inheritdoc */ public function init() { if ($this->identityClass == null) { $this->identityClass = \Yii::$app->getModule('user')->factory->userClass; } parent::init(); }
public function init() { parent::init(); if (!$this->getIsGuest() && !$this->getIdentity()->isActive()) { $this->logout(); } }
/** * Initializes the User component */ public function init() { if ($this->identityClass == null) { $this->identityClass = 'comyii\\user\\models\\User'; } parent::init(); }
public function init() { parent::init(); if ($this->userConfig !== null) { $this->userConfig = Instance::ensure($this->userConfig, UserConfig::className()); } }
public function init() { parent::init(); $identity = \app\models\User::findByUsername('console_user'); if ($identity) { $this->setIdentity($identity); } else { throw new Exception("Error console_user not found cannot set console user identity", 1); } }
/** * @inheritdoc */ public function init() { parent::init(); // check if user is banned. if so, log user out and redirect home /** @var \app\modules\user\models\User $user */ $user = $this->getIdentity(); if ($user && $user->ban_time) { $this->logout(); Yii::$app->getResponse()->redirect(['/'])->send(); return; } }
public function init() { Yii::$app->setComponents(['session' => ['class' => 'maddoger\\user\\components\\Session'], 'authManager' => ['class' => 'maddoger\\user\\components\\AuthManager', 'defaultRoles' => ['guest']]]); /** * @var \maddoger\user\UserModule $module */ $module = Yii::$app->getModule('user'); if ($module) { $this->loginUrl = $module->loginUrl; $this->enableAutoLogin = $module->autoLogin; } parent::init(); if (!$this->getIsGuest()) { $this->identity->updateLastVisitTime(); // $this->identity->setAttribute('login_ip', ip2long(\Yii::$app->getRequest()->getUserIP())); } }
public function init() { parent::init(); $this->on(self::EVENT_BEFORE_LOGOUT, [$this, 'onBeforeLogout']); $this->on(self::EVENT_AFTER_LOGIN, [$this, 'onAfterLogin']); }
public function init() { parent::init(); $this->module = Yii::$app->getModule('user'); }
/** * @inheritdoc */ public function init() { parent::init(); $this->mailer = Instance::ensure($this->mailer, 'im\\users\\components\\UserMailerInterface'); }
/** * @inheritdoc */ public function init() { parent::init(); $this->authManager = Yii::$app->authManager; }
public function init() { parent::init(); $this->on(self::EVENT_BEFORE_LOGIN, [$this, 'eventBeforeLogin']); }
public function init() { parent::init(); }