mirror of
https://github.com/humhub/humhub.git
synced 2025-02-24 19:23:21 +01:00
Clean
This commit is contained in:
parent
5930532e9f
commit
98a2a4feac
@ -3,19 +3,10 @@
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: buddha
|
||||
* Date: 30.07.2017
|
||||
* Time: 03:00
|
||||
*/
|
||||
|
||||
namespace humhub\components\access;
|
||||
|
||||
|
||||
use Yii;
|
||||
|
||||
class GuestAccessValidator extends AccessValidator
|
||||
@ -30,22 +21,22 @@ class GuestAccessValidator extends AccessValidator
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
if($this->access->isGuest() && !Yii::$app->user->isGuestAccessEnabled()) {
|
||||
if ($this->access->isGuest() && !Yii::$app->user->isGuestAccessEnabled()) {
|
||||
$this->code = 401;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!$this->access->isGuest()) {
|
||||
if (!$this->access->isGuest()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If there is a guest restriction rule only return true if there is an action related rule
|
||||
foreach ($this->filterRelatedRules() as $rule) {
|
||||
if($this->isActionRelated($rule)) {
|
||||
if ($this->isActionRelated($rule)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user