MDL-15352: check that the user exists on the remote server and that is allowed to access the file he's requesting

This commit is contained in:
jerome 2008-10-28 04:02:25 +00:00
parent 571dde8f26
commit 4ad46f21d3

View 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]);