]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16163 disable mnet scripts properly if mnet not enabled
authorskodak <skodak>
Thu, 21 Aug 2008 20:43:25 +0000 (20:43 +0000)
committerskodak <skodak>
Thu, 21 Aug 2008 20:43:25 +0000 (20:43 +0000)
mnet/publickey.php
mnet/testclient.php
mnet/xmlrpc/server.php

index 7ed80c7293ebfef7ac40b440aaa42f8e530d0db4..725c631483e0e1bec1b0d42e9dc7cdb3ef7549c8 100644 (file)
 
 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'];
index c97cfd9b68968a8f1b59416fc175f74850970ef8..9c0bb571214496d8534af1bc4cfd56a47110243c 100644 (file)
 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);
index 8aa821c1806b10cfd6d456e011623cd409cc1029..c937003d615142a66fe6a8c2075b898164217439 100644 (file)
@@ -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');