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:
Tom Rix 2010-03-01 21:33:38 +00:00
parent 4f268110b1
commit 191717acae

View File

@ -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]);
}