MDL-16163 disable mnet scripts properly if mnet not enabled
This commit is contained in:
@@ -10,6 +10,11 @@
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once $CFG->dirroot.'/mnet/lib.php';
|
||||
|
||||
if ($CFG->mnet_dispatcher_mode === 'off') {
|
||||
print_error('mnetdisabled', 'mnet');
|
||||
}
|
||||
|
||||
header("Content-type: text/plain");
|
||||
$keypair = mnet_get_keypair();
|
||||
echo $keypair['certificate'];
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
require_once $CFG->dirroot.'/mnet/xmlrpc/client.php';
|
||||
|
||||
if ($CFG->mnet_dispatcher_mode === 'off') {
|
||||
print_error('mnetdisabled', 'mnet');
|
||||
}
|
||||
|
||||
// Site admins only, thanks.
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/site:config', $context);
|
||||
|
||||
@@ -18,6 +18,10 @@ ini_set('display_errors',0);
|
||||
require_once $CFG->dirroot.'/mnet/lib.php';
|
||||
require_once $CFG->dirroot.'/mnet/remote_client.php';
|
||||
|
||||
if ($CFG->mnet_dispatcher_mode === 'off') {
|
||||
print_error('mnetdisabled', 'mnet');
|
||||
}
|
||||
|
||||
// Content type for output is not html:
|
||||
header('Content-type: text/xml; charset=utf-8');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user