From 6b7e5ad7e97d119fc97f0fe0a82f3c66477734f8 Mon Sep 17 00:00:00 2001 From: Lucas Bartholemy Date: Wed, 9 Aug 2017 11:28:07 +0200 Subject: [PATCH] Fix: Account Controller exception when user is not logged in --- protected/humhub/docs/CHANGELOG.md | 1 + .../humhub/modules/user/controllers/AccountController.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/protected/humhub/docs/CHANGELOG.md b/protected/humhub/docs/CHANGELOG.md index d8bbec4ad1..e1c0be9049 100644 --- a/protected/humhub/docs/CHANGELOG.md +++ b/protected/humhub/docs/CHANGELOG.md @@ -10,6 +10,7 @@ Important note for LDAP users: There is a new setting "ID Attribute" which shoul - Enh: Added LDAP ID attribute to improve user mapping - Enh: Option to disable e-mail address requirement in User model - Fix: Overwrite of static image in theme + added documentation section +- Fix: Account Controller exception when user is not logged in 1.2.2 (August 2, 2017) diff --git a/protected/humhub/modules/user/controllers/AccountController.php b/protected/humhub/modules/user/controllers/AccountController.php index e106e889bb..3488897c1a 100644 --- a/protected/humhub/modules/user/controllers/AccountController.php +++ b/protected/humhub/modules/user/controllers/AccountController.php @@ -50,6 +50,10 @@ class AccountController extends BaseAccountController */ public function actionIndex() { + if (Yii::$app->user->isGuest) { + return $this->goHome(); + } + return $this->redirect(Yii::$app->user->getIdentity()->getUrl()); }