common/controllers/SiteController.php
public function actionLogin( $admin = false ) {

		// Send user to home if already logged in
		$this->checkHome();

		// Create Form Model
		$model			= new Login();
		$model->admin	= $admin;

		// Load and Validate Form Model
		if( $model->load( Yii::$app->request->post(), 'Login' ) && $model->login() ) {


			// Redirect user to home
			$this->checkHome();
		}

		return $this->render( CoreGlobal::PAGE_LOGIN, [ CoreGlobal::MODEL_GENERIC => $model ] );
	}
public function actionLogin( $admin = false ) {

		// Send user to home if already logged in
		$this->checkHome();

		// Create Form Model
		$model			= new Login();
		$model->admin	= $admin;

		// Load and Validate Form Model
		if( $model->load( Yii::$app->request->post(), 'Login' ) && $model->login() ) {


			// Redirect user to home
			$this->checkHome();
		}

		return $this->render( CoreGlobal::PAGE_LOGIN, [ CoreGlobal::MODEL_GENERIC => $model ] );
	}
public function actionLogin ( $ admin = false ) { // Send user to home if already logged in $ this -> checkHome ( ) ; // Create Form Model $ model = new Login ( ) ; $ model -> admin = $ admin ; // Load and Validate Form Model if ( $ model -> load ( Yii :: $ app -> request -> post ( ) , 'Login' ) && $ model -> login ( ) ) { // Redirect user to home $ this -> checkHome ( ) ; } return $ this -> render ( CoreGlobal :: PAGE_LOGIN , [ CoreGlobal :: MODEL_GENERIC => $ model ] ) ; }
The method checks whether user is logged in and send to home.
The method checks whether user is logged in and send to home .