\n";
print "The selected user group does not exist.\n";
return;
}
$isowner = 0;
if($usergroups[$groupid]['ownerid'] != $user['id']) {
if(($usergroups[$groupid]['custom'] == 0 ||
$usergroups[$groupid]['courseroll'] == 1)) {
if(! checkUserHasPerm('Manage Federated User Groups (global)') &&
(! checkUserHasPerm('Manage Federated User Groups (affiliation only)') ||
$usergroups[$groupid]['groupaffiliationid'] != $user['affiliationid'])) {
print "
Edit User Group
\n";
print "You do not have access to modify the selected user group.\n";
return;
}
else
$isowner = 1;
}
elseif(! array_key_exists("editgroupid", $usergroups[$groupid]) ||
! array_key_exists($usergroups[$groupid]["editgroupid"], $user["groups"])) {
print "
Edit User Group
\n";
print "You do not have access to modify the selected user group.\n";
return;
}
}
else
$isowner = 1;
}
else {
$userresources = getUserResources(array("groupAdmin"),
array("manageGroup"), 1);
$noaccess = 1;
foreach(array_keys($userresources) as $rtype) {
if(array_key_exists($groupid, $userresources[$rtype])) {
$noaccess = 0;
break;
}
}
if($noaccess) {
print "