mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
Merge pull request #180 from micmania1/fix-unnecessary-redirect
FIX: Removed unnecessary redirect.
This commit is contained in:
commit
73e0202dec
@ -217,12 +217,10 @@ 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
|
//Redirect to the default CMS section
|
||||||
return $this->owner->redirect($this->owner->Link());
|
return $this->owner->redirect('admin/');
|
||||||
}
|
}
|
||||||
//Redirect to the default CMS section
|
|
||||||
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.
|
||||||
@ -234,12 +232,10 @@ 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
|
//Redirect to the default CMS section
|
||||||
return $this->owner->redirect($this->owner->Link());
|
return $this->owner->redirect('admin/');
|
||||||
}
|
}
|
||||||
//Redirect to the default CMS section
|
|
||||||
return $this->owner->redirect('admin/');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user