BUGFIX: Make sure findAnAdministrator gets a global administrator when subsites is installed. (from r94369)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@95603 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-12-16 05:40:05 +00:00
parent 69cda024ab
commit 298ef035ed

View File

@ -611,7 +611,8 @@ class Security extends Controller {
$permission = DataObject::get_one("Permission", "\"Code\" = 'ADMIN'", true, "\"Permission\".\"ID\"");
$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->Members()->First()) {