Skip to content

Commit 495f897

Browse files
committed
MOBILE-4983 chore: Update core_webservice_get_site_info WS response type
1 parent 28b8a5b commit 495f897

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/core/classes/sites/unauthenticated-site.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ export class CoreUnauthenticatedSite {
253253
* Get the public config of this site.
254254
*
255255
* @param options Options.
256+
* @param options.readingStrategy Reading strategy to use.
256257
* @returns Promise resolved with public config. Rejected with an object if error, see CoreWS.callAjax.
257258
*/
258259
async getPublicConfig(options: { readingStrategy?: CoreSitesReadingStrategy } = {}): Promise<CoreSitePublicConfigResponse> {
@@ -571,7 +572,9 @@ export class CoreUnauthenticatedSite {
571572
}
572573

573574
/**
574-
* Result of WS core_webservice_get_site_info.
575+
* Data returned by core_webservice_get_site_info WS.
576+
*
577+
* WS Description: Return some site info / user info / list web service functions
575578
*/
576579
export type CoreSiteInfoResponse = {
577580
sitename: string; // Site name.
@@ -583,6 +586,11 @@ export type CoreSiteInfoResponse = {
583586
userid: number; // User id.
584587
siteurl: string; // Site url.
585588
userpictureurl: string; // The user profile picture.
589+
// Warning: this url is the public URL that only works when forcelogin is set to NO and guestaccess is set to YES.
590+
// In order to retrieve user profile pictures independently of the Moodle config, replace "pluginfile.php" by
591+
// "webservice/pluginfile.php?token=WSTOKEN&file="
592+
// Of course the user can only see profile picture depending
593+
// on his/her permissions. Moreover it is recommended to use HTTPS too.
586594
functions: {
587595
name: string; // Function name.
588596
version: string; // The version number of the component to which the function belongs.
@@ -600,16 +608,20 @@ export type CoreSiteInfoResponse = {
600608
userquota?: number; // User quota (bytes). 0 means user can ignore the quota.
601609
usermaxuploadfilesize?: number; // User max upload file size (bytes). -1 means the user can ignore the upload file size.
602610
userhomepage?: CoreSiteInfoUserHomepage; // The default home page for the user.
603-
userhomepageurl?: string; // @since 4.5. The URL of the custom user home page when using HOMEPAGE_URL.
611+
userhomepageurl?: string; // @since 4.5. The URL of default home page when userhomepage is 4 (HOMEPAGE_URL).
604612
userprivateaccesskey?: string; // Private user access key for fetching files.
605613
siteid?: number; // Site course ID.
606614
sitecalendartype?: string; // Calendar type set in the site.
607615
usercalendartype?: string; // Calendar typed used by the user.
608616
userissiteadmin?: boolean; // Whether the user is a site admin or not.
609617
theme?: string; // Current theme for the user.
610618
limitconcurrentlogins?: number; // @since 4.0. Number of concurrent sessions allowed.
611-
usersessionscount?: number; // @since 4.0. Number of active sessions for current user. Only if limitconcurrentlogins is used.
619+
usersessionscount?: number; // @since 4.0. Number of active sessions for current user.
620+
// Only returned when limitconcurrentlogins is used.
612621
policyagreed?: number; // @since 4.4. Whether user accepted all the policies.
622+
usercanchangeconfig?: boolean; // @since 5.2. Whether the user can change the site configuration.
623+
usercanviewconfig?: boolean; // @since 5.2. Whether the user can view the site administration tree.
624+
sitesecret?: string; // @since 5.2. The site secret, only returned to users with moodle/site:config capability (usually admins).
613625
};
614626

615627
/**

0 commit comments

Comments
 (0)