From 800f09dd0dda5ec744f805d333f598f9b9261d01 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 24 Jun 2019 10:19:58 +1200 Subject: [PATCH 1/2] FIX LeftAndMainSubsites::canAccess() now accepts a Member argument and falls back to the session member --- code/extensions/LeftAndMainSubsites.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/code/extensions/LeftAndMainSubsites.php b/code/extensions/LeftAndMainSubsites.php index bd7fb73..c92aef2 100644 --- a/code/extensions/LeftAndMainSubsites.php +++ b/code/extensions/LeftAndMainSubsites.php @@ -183,11 +183,16 @@ class LeftAndMainSubsites extends Extension /** * Check if the current controller is accessible for this user on this subsite. + * + * @param Member $member */ - public function canAccess() + public function canAccess(Member $member = null) { + if (!$member) { + $member = Member::currentUser(); + } + // Admin can access everything, no point in checking. - $member = Member::currentUser(); if ($member && ( Permission::checkMember($member, 'ADMIN') || // 'Full administrative rights' in SecurityAdmin @@ -209,10 +214,12 @@ class LeftAndMainSubsites extends Extension /** * Prevent accessing disallowed resources. This happens after onBeforeInit has executed, * so all redirections should've already taken place. + * + * @param Member $member */ - public function alternateAccessCheck() + public function alternateAccessCheck(Member $member = null) { - return $this->owner->canAccess(); + return $this->owner->canAccess($member); } /** From f6ee5af9688440882891c7fe05383ea06bc0e017 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 25 Jun 2019 16:03:55 +1200 Subject: [PATCH 2/2] Remove 3 branch from Travis builds --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5044003..bc9813c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ matrix: - php: 5.3 env: DB=PGSQL CORE_RELEASE=3.4 - php: 5.6 - env: DB=MYSQL CORE_RELEASE=3 + env: DB=MYSQL CORE_RELEASE=3.7 - php: 5.4 env: DB=MYSQL CORE_RELEASE=3.6 - php: 7.1