mirror of
https://github.com/humhub/humhub.git
synced 2025-03-03 06:46:01 +01:00
Fixed: Login page redirect for guests
This commit is contained in:
parent
78e9cb882f
commit
b476ca7d0e
@ -55,11 +55,6 @@ class ContentContainerController extends Controller
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
// Directly redirect guests to login page - if guest access isn't enabled
|
||||
if (Yii::$app->user->isGuest && \humhub\models\Setting::Get('allowGuestAccess', 'authentication_internal') != 1) {
|
||||
return Yii::$app->user->loginRequired();
|
||||
}
|
||||
|
||||
$spaceGuid = Yii::$app->request->get('sguid', '');
|
||||
$userGuid = Yii::$app->request->get('uguid', '');
|
||||
|
||||
@ -107,10 +102,29 @@ class ContentContainerController extends Controller
|
||||
throw new HttpException(405, Yii::t('base', 'Module is not on this content container enabled!'));
|
||||
}
|
||||
|
||||
|
||||
return parent::init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function beforeAction($action)
|
||||
{
|
||||
|
||||
if (parent::beforeAction($action)) {
|
||||
|
||||
// Directly redirect guests to login page - if guest access isn't enabled
|
||||
if (Yii::$app->user->isGuest && \humhub\models\Setting::Get('allowGuestAccess', 'authentication_internal') != 1) {
|
||||
Yii::$app->user->loginRequired();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if current user can access current ContentContainer by using
|
||||
* underlying behavior ProfileControllerBehavior/SpaceControllerBehavior.
|
||||
|
Loading…
x
Reference in New Issue
Block a user