mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-56160 ws: Return site course ID in get_site_info
This commit is contained in:
parent
26162efe4a
commit
43695b6a72
@ -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 {
|
||||
VALUE_OPTIONAL),
|
||||
'userhomepage' => new external_value(PARAM_INT,
|
||||
'the default home page for the user: 0 for the site home, 1 for dashboard',
|
||||
VALUE_OPTIONAL)
|
||||
VALUE_OPTIONAL),
|
||||
'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
|
||||
file_rewrite_pluginfile_urls.
|
||||
* External function get_site_info now returns the site course ID. This new field is marked as VALUE_OPTIONAL for backwards compatibility.
|
||||
|
||||
=== 3.1 ===
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user