Commit 43695b6a authored by dani's avatar dani
Browse files

MDL-56160 ws: Return site course ID in get_site_info

parent 26162efe
......@@ -92,7 +92,8 @@ class core_webservice_external extends external_api {
'fullname' => fullname($USER),
'lang' => current_language(),
'userid' => $USER->id,
'userpictureurl' => $profileimageurl->out(false)
'userpictureurl' => $profileimageurl->out(false),
'siteid' => SITEID
// Retrieve the service and functions from the web service linked to the token
......@@ -257,7 +258,8 @@ class core_webservice_external extends external_api {
'userhomepage' => new external_value(PARAM_INT,
'the default home page for the user: 0 for the site home, 1 for dashboard',
'siteid' => new external_value(PARAM_INT, 'Site course ID', VALUE_OPTIONAL)
......@@ -95,6 +95,7 @@ class core_webservice_externallib_testcase extends externallib_advanced_testcase
$this->assertEquals('Doe', $siteinfo['lastname']);
$this->assertEquals(current_language(), $siteinfo['lang']);
$this->assertEquals($USER->id, $siteinfo['userid']);
$this->assertEquals(SITEID, $siteinfo['siteid']);
$this->assertEquals(true, $siteinfo['downloadfiles']);
$this->assertEquals($CFG->release, $siteinfo['release']);
$this->assertEquals($CFG->version, $siteinfo['version']);
......@@ -11,6 +11,7 @@ This information is intended for authors of webservices, not people writing webs
* external_format_text() function: component, filearea and itemid are now optional parameters.
In some contexts those parameteres are not necessary because is not required to do a file rewrite via
* External function get_site_info now returns the site course ID. This new field is marked as VALUE_OPTIONAL for backwards compatibility.
=== 3.1 ===
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment