]> git.mjollnir.org Git - moodle.git/commitdiff
MNet: Standardise format of the mnet_client->error array
authordonal72 <donal72>
Wed, 7 Feb 2007 12:43:08 +0000 (12:43 +0000)
committerdonal72 <donal72>
Wed, 7 Feb 2007 12:43:08 +0000 (12:43 +0000)
enrol/mnet/enrol.php
mnet/xmlrpc/client.php

index 22dcad7de24a4fcbe90f6afe7c4e9fa32faf6455..113b14a7957f4f04d259f1fb10a9341e03bbc352 100644 (file)
@@ -493,7 +493,8 @@ class enrolment_plugin_mnet {
 
             return $courses;
         } else {
-            foreach ($mnetrequest->error as $code => $errormessage) {
+            foreach ($mnetrequest->error as $message) {
+                list($code, $errormessage) = array_map('trim',explode(':', $errormessage, 2));
                 $message .= "ERROR $code:<br/>$errormessage<br/>";
             }
             error("RPC enrol/mnet/available_courses:<br/>$message");
index e765762b02f83d6bce79076089a2885351b73b12..ddae4b9d80a3f944825403bfb9c457e4d6dfbee4 100644 (file)
@@ -165,10 +165,10 @@ class mnet_xmlrpc_client {
             $permission = get_record_sql($sql);
             if ($permission == false) {
                 global $USER;
-                $this->error[] = array(7, 'User with ID '. $USER->id .
-                                          ' attempted to call unauthorised method '.
-                                          $this->method.' on host '.
-                                          $mnet_peer->wwwroot);
+                $this->error[] = '7:User with ID '. $USER->id .
+                                 ' attempted to call unauthorised method '.
+                                 $this->method.' on host '.
+                                 $mnet_peer->wwwroot;
                 return false;
             }
 
@@ -192,7 +192,7 @@ class mnet_xmlrpc_client {
         $timestamp_receive = time();
 
         if ($this->rawresponse == false) {
-            $this->error[] = array(curl_errno($ch), curl_error($ch));
+            $this->error[] = curl_errno($ch) .':'. curl_error($ch);
             return false;
         }
 
@@ -269,7 +269,7 @@ class mnet_xmlrpc_client {
                 $threshold = 15;
             }
             if ($time_offset > $threshold) {
-                $this->error[] = 'Time gap with '.$mnet_peer->name.' ('.$time_offset.' seconds) is greater than the permitted maximum of '.$threshold.' seconds';
+                $this->error[] = '6:Time gap with '.$mnet_peer->name.' ('.$time_offset.' seconds) is greater than the permitted maximum of '.$threshold.' seconds';
                 return false;
             }
         }