Skip to content

Commit

Permalink
Merge branch 'MDL-56160-master' of git://github.com/dpalou/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Oct 3, 2016
2 parents e22ce8a + 43695b6 commit ed66d72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions webservice/externallib.php
Expand Up @@ -92,7 +92,8 @@ public static function get_site_info($serviceshortnames = array()) {
'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
Expand Down Expand Up @@ -257,7 +258,8 @@ public static function get_site_info_returns() {
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)
)
);
}
Expand Down
1 change: 1 addition & 0 deletions webservice/tests/externallib_test.php
Expand Up @@ -95,6 +95,7 @@ public function test_get_site_info() {
$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']);
Expand Down
1 change: 1 addition & 0 deletions webservice/upgrade.txt
Expand Up @@ -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 ===

Expand Down

0 comments on commit ed66d72

Please sign in to comment.