]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15352: check that the user exists on the remote server and that is allowed to...
authorjerome <jerome>
Tue, 28 Oct 2008 04:02:25 +0000 (04:02 +0000)
committerjerome <jerome>
Tue, 28 Oct 2008 04:02:25 +0000 (04:02 +0000)
repository/remotemoodle/repository.class.php

index 5fc03f59fafffec477b38b67dd15a1432dd404c7..0b01b50c9c34b61ed52e8b6e72112dbb37801fe7 100644 (file)
@@ -325,7 +325,6 @@ class repository_remotemoodle extends repository {
         require_once($CFG->dirroot . '/mnet/xmlrpc/client.php');
         //retrieve the host url
         $this->ensure_environment();
-
         $host = $DB->get_record('mnet_host',array('id' => $this->options['peer']));
         $mnetauth = get_auth_plugin('mnet');
         $mnetauth->start_jump_session($host->id, '');
@@ -340,7 +339,14 @@ class repository_remotemoodle extends repository {
         $client->add_param($USER->username);
         $client->add_param($url);
 
-        $client->send($mnet_peer);
+        if (!$client->send($mnet_peer)) {
+            $message =" ";
+            foreach ($client->error as $errormessage) {
+                $message .= "ERROR: $errormessage . ";
+            }
+            echo json_encode(array('e'=>$message));
+            exit;
+        }
 
         $services = $client->response;
         $content = base64_decode($services[0]);