redirect_fix_between_CMS_sections

previously if you were editing settings and you changed subsites ti would revert you to /admin, now it stays within your current controller
This commit is contained in:
John Milmine 2014-11-24 15:32:05 +13:00
parent 498d6e0619
commit 91591a3752
1 changed files with 10 additions and 2 deletions

View File

@ -217,7 +217,11 @@ class LeftAndMainSubsites extends Extension {
// Update current subsite in session
Subsite::changeSubsite($_GET['SubsiteID']);
//Redirect to clear the current page
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
return $this->owner->redirect('admin/');
}
@ -230,7 +234,11 @@ class LeftAndMainSubsites extends Extension {
// Update current subsite in session
Subsite::changeSubsite($record->SubsiteID);
//Redirect to clear the current page
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
return $this->owner->redirect('admin/');
}