role assign: MDL-13325 when assigning roles inside front page activites, list all users as potential users.

This commit is contained in:
tjhunt
2008-11-11 07:23:36 +00:00
parent a98b19c219
commit 5e304e4900
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -290,7 +290,7 @@
$selectsql = "";
}
if ($context->contextlevel > CONTEXT_COURSE) { // mod or block (or group?)
if ($context->contextlevel > CONTEXT_COURSE && !is_inside_frontpage($context)) { // mod or block (or group?)
/************************************************************************
* *
+10
View File
@@ -3621,6 +3621,16 @@ function get_parent_contextid($context) {
return array_shift($parentcontexts);
}
/**
* @param object $context a context object.
* @return true if this context is the front page context, or a context inside it,
* otherwise false.
*/
function is_inside_frontpage($context) {
$frontpagecontext = get_context_instance(CONTEXT_COURSE, SITEID);
return strpos($context->path . '/', $frontpagecontext->path . '/') === 0;
}
/**
* Recursive function which, given a context, find all its children context ids.
*