frontend/controllers/UserController.php
public function actionAccount() {

		// Find Model
		$user	= Yii::$app->core->getUser();
		$model	= new ResetPassword();

		// Configure Model
		$model->email = $user->email;

		// Old password required if it was already set
		if( !empty( $user->passwordHash ) ) {

			$model->setScenario( 'oldPassword' );
		}

		if( $model->load( Yii::$app->request->post(), $model->getClassName() ) && $model->validate() ) {

			// Update User
			$this->modelService->resetPassword( $user, $model, false );

			return $this->refresh();
		}

		return $this->render( CoreGlobalWeb::PAGE_ACCOUNT, [
			'user' => $user,
			'model' => $model
		]);
	}
public function actionAccount() {

		// Find Model
		$user	= Yii::$app->core->getUser();
		$model	= new ResetPassword();

		// Configure Model
		$model->email = $user->email;

		// Old password required if it was already set
		if( !empty( $user->passwordHash ) ) {

			$model->setScenario( 'oldPassword' );
		}

		if( $model->load( Yii::$app->request->post(), $model->getClassName() ) && $model->validate() ) {

			// Update User
			$this->modelService->resetPassword( $user, $model, false );

			return $this->refresh();
		}

		return $this->render( CoreGlobalWeb::PAGE_ACCOUNT, [
			'user' => $user,
			'model' => $model
		]);
	}
public function actionAccount ( ) { // Find Model $ user = Yii :: $ app -> core -> getUser ( ) ; $ model = new ResetPassword ( ) ; // Configure Model $ model -> email = $ user -> email ; // Old password required if it was already set if ( ! empty ( $ user -> passwordHash ) ) { $ model -> setScenario ( 'oldPassword' ) ; } if ( $ model -> load ( Yii :: $ app -> request -> post ( ) , $ model -> getClassName ( ) ) && $ model -> validate ( ) ) { // Update User $ this -> modelService -> resetPassword ( $ user , $ model , false ) ; return $ this -> refresh ( ) ; } return $ this -> render ( CoreGlobalWeb :: PAGE_ACCOUNT , [ 'user' => $ user , 'model' => $ model ] ) ; }
The account action allows user to change password.

@return string
The account action allows user to change password .