From 3ca2861c2dd9abf94cfc8d1b760c9a3d93dee469 Mon Sep 17 00:00:00 2001 From: micmania1 Date: Tue, 17 Feb 2015 01:13:56 +0000 Subject: [PATCH] FIX: Removed unnecessary redirect. This is early enough in the script that the correct subsite will be used from hereon. --- code/extensions/LeftAndMainSubsites.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/code/extensions/LeftAndMainSubsites.php b/code/extensions/LeftAndMainSubsites.php index a0f3497..af8c464 100644 --- a/code/extensions/LeftAndMainSubsites.php +++ b/code/extensions/LeftAndMainSubsites.php @@ -217,12 +217,10 @@ class LeftAndMainSubsites extends Extension { // Update current subsite in session Subsite::changeSubsite($_GET['SubsiteID']); - if ($this->owner->canView(Member::currentUser())) { - //Redirect to clear the current page - return $this->owner->redirect($this->owner->Link()); + if (!$this->owner->canView(Member::currentUser())) { + //Redirect to the default CMS section + return $this->owner->redirect('admin/'); } - //Redirect to the default CMS section - return $this->owner->redirect('admin/'); } // Automatically redirect the session to appropriate subsite when requesting a record. @@ -234,12 +232,10 @@ class LeftAndMainSubsites extends Extension { // Update current subsite in session Subsite::changeSubsite($record->SubsiteID); - if ($this->owner->canView(Member::currentUser())) { - //Redirect to clear the current page - return $this->owner->redirect($this->owner->Link()); + if (!$this->owner->canView(Member::currentUser())) { + //Redirect to the default CMS section + return $this->owner->redirect('admin/'); } - //Redirect to the default CMS section - return $this->owner->redirect('admin/'); } }