]> git.mjollnir.org Git - moodle.git/commitdiff
Minor mnet bugfixing.
authordonal72 <donal72>
Thu, 2 Aug 2007 00:19:43 +0000 (00:19 +0000)
committerdonal72 <donal72>
Thu, 2 Aug 2007 00:19:43 +0000 (00:19 +0000)
mnet/xmlrpc/server.php

index 630ec789f93c107feea0aabb51c10afbc1971c56..defca4eaaef5783c2d3b00c5fcebcf27d65439a9 100644 (file)
@@ -356,7 +356,7 @@ function mnet_server_dispatch($payload) {
     //            xmlrpc_decode_request($xml,                   &$method)
     $params     = xmlrpc_decode_request($payload, $method);
 
-    // $method is something like: "mod/forum/lib/forum_add_instance"
+    // $method is something like: "mod/forum/lib.php/forum_add_instance"
     // $params is an array of parameters. A parameter might itself be an array.
 
     // Whitelist characters that are permitted in a method name
@@ -366,8 +366,12 @@ function mnet_server_dispatch($payload) {
         exit(mnet_server_fault(713, 'nosuchfunction'));
     }
 
-    $callstack  = explode('/', $method);
-    // callstack will look like array('mod', 'forum', 'lib', 'forum_add_instance');
+    if(preg_match("/^system./", $method)) {
+        $callstack  = explode('.', $method);
+    } else {
+        $callstack  = explode('/', $method);
+        // callstack will look like array('mod', 'forum', 'lib.php', 'forum_add_instance');
+    }
 
     /**
      * What has the site administrator chosen as his dispatcher setting?
@@ -485,7 +489,7 @@ function mnet_server_dispatch($payload) {
                 // The call stack holds the path to any include file
                 $includefile = $CFG->dirroot.'/'.implode('/',$callstack).'/'.$filename.'.php';
 
-                $response = mnet_server_invoke_function($includefile, $functionname, $method, $payload);
+                $response = mnet_server_invoke_method($includefile, $functionname, $method, $payload);
                 echo $response;
             }