public function login() {

		if ( $this->validate() ) {

			$user = $this->getUser();

			if( $this->admin ) {

				$user->loadPermissions();

				if( !$user->isPermitted( CoreGlobal::PERM_ADMIN ) ) {

					$this->addError( "email", Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_ALLOWED ) );

					return false;
				}
			}

			$user->lastLoginAt = DateUtil::getDateTime();

			$user->save();

			return Yii::$app->user->login( $user, $this->rememberMe ? $this->interval : 0 );
		}

		return false;
	}