From: toyomoyo Date: Fri, 9 Feb 2007 01:04:02 +0000 (+0000) Subject: fix for MDL-8399, unable to unassign self as admin in courses X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=20e0a8021ddd492354760766bdfd46845906f3f2;p=moodle.git fix for MDL-8399, unable to unassign self as admin in courses --- diff --git a/admin/roles/assign.php b/admin/roles/assign.php index 6fb36db2e7..24d3a38340 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -165,7 +165,7 @@ $topleveladmin = false; // we only worry about this if the role has doanything capability at site level - if ($adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext)) { + if ($context->id == $sitecontext->id && $adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext)) { foreach ($adminroles as $adminrole) { if ($adminrole->id == $roleid) { $topleveladmin = true;