common/models/forms/Login.php
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;
	}
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;
	}
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 ; }
Login and remember the user for pre-defined interval.

@return boolean
Login and remember the user for pre - defined interval .