mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
FIX: Removed unnecessary redirect. This is early enough in the script that the correct subsite will be used from hereon.
This commit is contained in:
parent
ebebff248f
commit
3ca2861c2d
@ -217,13 +217,11 @@ class LeftAndMainSubsites extends Extension {
|
|||||||
// Update current subsite in session
|
// Update current subsite in session
|
||||||
Subsite::changeSubsite($_GET['SubsiteID']);
|
Subsite::changeSubsite($_GET['SubsiteID']);
|
||||||
|
|
||||||
if ($this->owner->canView(Member::currentUser())) {
|
if (!$this->owner->canView(Member::currentUser())) {
|
||||||
//Redirect to clear the current page
|
|
||||||
return $this->owner->redirect($this->owner->Link());
|
|
||||||
}
|
|
||||||
//Redirect to the default CMS section
|
//Redirect to the default CMS section
|
||||||
return $this->owner->redirect('admin/');
|
return $this->owner->redirect('admin/');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Automatically redirect the session to appropriate subsite when requesting a record.
|
// Automatically redirect the session to appropriate subsite when requesting a record.
|
||||||
// This is needed to properly initialise the session in situations where someone opens the CMS via a link.
|
// This is needed to properly initialise the session in situations where someone opens the CMS via a link.
|
||||||
@ -234,13 +232,11 @@ class LeftAndMainSubsites extends Extension {
|
|||||||
// Update current subsite in session
|
// Update current subsite in session
|
||||||
Subsite::changeSubsite($record->SubsiteID);
|
Subsite::changeSubsite($record->SubsiteID);
|
||||||
|
|
||||||
if ($this->owner->canView(Member::currentUser())) {
|
if (!$this->owner->canView(Member::currentUser())) {
|
||||||
//Redirect to clear the current page
|
|
||||||
return $this->owner->redirect($this->owner->Link());
|
|
||||||
}
|
|
||||||
//Redirect to the default CMS section
|
//Redirect to the default CMS section
|
||||||
return $this->owner->redirect('admin/');
|
return $this->owner->redirect('admin/');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user