mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Make sure findAnAdministrator gets a global administrator when subsites is installed.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@94369 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
faab8f7d16
commit
a783448266
@ -605,7 +605,8 @@ class Security extends Controller {
|
|||||||
$permission = DataObject::get_one("Permission", "\"Code\" = 'ADMIN'", true, "\"Permission\".\"ID\"");
|
$permission = DataObject::get_one("Permission", "\"Code\" = 'ADMIN'", true, "\"Permission\".\"ID\"");
|
||||||
|
|
||||||
$adminGroup = null;
|
$adminGroup = null;
|
||||||
if($permission) $adminGroup = DataObject::get_one("Group", "\"Group\".\"ID\" = '{$permission->GroupID}'", true, "\"Group\".\"ID\"");
|
$subsiteCheck = class_exists('GroupSubsites') ? ' AND "Group"."SubsiteID" = 0' : '';
|
||||||
|
if($permission) $adminGroup = DataObject::get_one("Group", "\"Group\".\"ID\" = '{$permission->GroupID}'$subsiteCheck", true, "\"Group\".\"ID\"");
|
||||||
|
|
||||||
if($adminGroup) {
|
if($adminGroup) {
|
||||||
if($adminGroup->Members()->First()) {
|
if($adminGroup->Members()->First()) {
|
||||||
@ -857,4 +858,4 @@ class Security extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user