role assign: MDL-13325 when assigning roles inside front page activites, list all users as potential users.
This commit is contained in:
@@ -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?)
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user