mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
BUGFIX: Only switch to a subsite that you have access to if you actually have access to a subsite. (from r89042)
This commit is contained in:
parent
4f268110b1
commit
191717acae
@ -23,7 +23,7 @@ class LeftAndMainSubsites extends Extension {
|
||||
|
||||
// Switch to a subsite that this user can actually access.
|
||||
$sites = Subsite::accessible_sites("CMS_ACCESS_{$this->owner->class}")->toDropdownMap();
|
||||
if(!isset($sites[Subsite::currentSubsiteID()])) {
|
||||
if($sites && !isset($sites[Subsite::currentSubsiteID()])) {
|
||||
$siteIDs = array_keys($sites);
|
||||
Subsite::changeSubsite($siteIDs[0]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user