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) (from r96306)
This commit is contained in:
parent
a85521fcb1
commit
3bec9d59f0
@ -23,7 +23,7 @@ class LeftAndMainSubsites extends Extension {
|
|||||||
|
|
||||||
// Switch to a subsite that this user can actually access.
|
// Switch to a subsite that this user can actually access.
|
||||||
$sites = Subsite::accessible_sites("CMS_ACCESS_{$this->owner->class}")->toDropdownMap();
|
$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);
|
$siteIDs = array_keys($sites);
|
||||||
Subsite::changeSubsite($siteIDs[0]);
|
Subsite::changeSubsite($siteIDs[0]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user