2009-01-13 07:00:26 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Created on 10/14/2008
|
|
|
|
*
|
|
|
|
* REST Moodle server.
|
|
|
|
*
|
|
|
|
* NOTE: for this first implementation, REST requires implicit url encoded params.
|
|
|
|
* It uses function get_file_argument to get them.
|
|
|
|
*
|
|
|
|
* @author Jerome Mouneyrac
|
|
|
|
* @author Ferran Recio
|
|
|
|
* @author David Castro Garcia
|
|
|
|
*/
|
|
|
|
|
|
|
|
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
2009-01-22 05:22:05 +00:00
|
|
|
require_once('locallib.php');
|
2009-01-13 07:00:26 +00:00
|
|
|
|
2009-01-15 07:53:10 +00:00
|
|
|
if (empty($CFG->enablewebservices)) {
|
|
|
|
die;
|
|
|
|
}
|
|
|
|
|
2009-01-13 07:00:26 +00:00
|
|
|
//retrieve path and function name from the URL
|
|
|
|
$rest_arguments = get_file_argument('server.php');
|
|
|
|
|
|
|
|
header ("Content-type: text/xml");
|
2009-01-22 05:22:05 +00:00
|
|
|
//TODO implement authentication (probably in the locallib.php)
|
2009-01-13 07:00:26 +00:00
|
|
|
echo call_moodle_function($rest_arguments);
|
|
|
|
?>
|