mnet: $CFG->mnet_dispatcher_mode - ensure we set it on install and upgrade, silence warnings - MDL-8284

This commit is contained in:
martinlanghoff 2007-01-24 22:17:42 +00:00
parent 3efde7e21a
commit 36e6379ef8
3 changed files with 7 additions and 2 deletions

View File

@ -1836,7 +1836,7 @@ function print_my_moodle() {
$courses = get_my_courses($USER->id);
$rhosts = array();
$rcourses = array();
if ($CFG->mnet_dispatcher_mode === 'strict') {
if (!empty($CFG->mnet_dispatcher_mode) && $CFG->mnet_dispatcher_mode==='strict') {
$rcourses = get_my_remotecourses($USER->id);
$rhosts = get_my_remotehosts();
}

View File

@ -226,7 +226,8 @@ if ($authsequence[0] == 'cas' and !empty($CFG->cas_enabled)) {
}
// TODO: if the user failed to authenticate, check if the username corresponds to a remote mnet user
if ( $CFG->mnet_dispatcher_mode === 'strict'
if ( !empty($CFG->mnet_dispatcher_mode)
&& $CFG->mnet_dispatcher_mode === 'strict'
&& is_enabled_auth('mnet')) {
$errormsg .= get_string('loginlinkmnetuser', 'mnet', "mnet_email.php?u=$frm->username");
}

View File

@ -24,6 +24,10 @@ class mnet_environment {
function init() {
global $CFG;
if (empty($CFG->mnet_dispatcher_mode)) {
set_config('mnet_dispatcher_mode', 'off');
}
// Bootstrap the object data on first load.
if (empty($CFG->mnet_localhost_id) ) {