Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
tool_mobile\api Class Reference

API exposed by tool_mobile, to be used mostly by external functions and the plugin settings. More...

Static Public Member Functions

static check_autologin_prerequisites ($userid)
 
static generate_login_qrcode (stdClass $mobilesettings)
 Generates a QR code with the site URL or for automatic login from the mobile app.
 
static get_autologin_key ()
 Creates an auto-login key for the current user, this key is restricted by time and ip address.
 
static get_config ($section)
 Returns a list of site configurations, filtering by section.
 
static get_features_list ()
 Get a list of the Mobile app features.
 
static get_plugins_supporting_mobile ()
 Returns a list of Moodle plugins supporting the mobile app.
 
static get_potential_config_issues ()
 This function check the current site for potential configuration issues that may prevent the mobile app to work.
 
static get_public_config ()
 Returns a list of the site public settings, those not requiring authentication.
 
static get_qrlogin_key (stdClass $mobilesettings)
 Creates a QR login key for the current user, this key is restricted by time and ip address.
 
static get_subscription_information ()
 Gets Moodle app plan subscription information for the current site as it is returned by the Apps Portal.
 

Public Attributes

int const AUTOLOGOUT_CUSTOM = 2
 AUTOLOGOUT type custom value.
 
int const AUTOLOGOUT_DISABLED = 0
 AUTOLOGOUT disabled value.
 
int const AUTOLOGOUT_INMEDIATE = 1
 AUTOLOGOUT type inmediate value.
 
string const DEFAULT_ANDROID_APP_ID = 'com.moodle.moodlemobile'
 Default Android app id.
 
string const DEFAULT_IOS_APP_ID = '633359593'
 Default iOS app id.
 
int const LOGIN_KEY_TTL = 60
 seconds an auto-login key will expire.
 
int const LOGIN_QR_KEY_TTL = 600
 default value in seconds a QR login key will expire.
 
int const LOGIN_VIA_APP = 1
 to identify the login via app.
 
int const LOGIN_VIA_BROWSER = 2
 to identify the login via browser.
 
int const LOGIN_VIA_EMBEDDED_BROWSER = 3
 to identify the login via an embedded browser.
 
string const MOODLE_APPS_PORTAL_URL = 'https://apps.moodle.com'
 URL of the Moodle Apps Portal.
 
int const QR_CODE_DISABLED = 0
 QR code disabled value.
 
int const QR_CODE_LOGIN = 2
 QR code type login value.
 
int const QR_CODE_URL = 1
 QR code type URL value.
 

Detailed Description

API exposed by tool_mobile, to be used mostly by external functions and the plugin settings.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Since
Moodle 3.1

Member Function Documentation

◆ generate_login_qrcode()

static tool_mobile\api::generate_login_qrcode ( stdClass $mobilesettings)
static

Generates a QR code with the site URL or for automatic login from the mobile app.

Parameters
stdClass$mobilesettingstool_mobile settings
Return values
stringbase64 data image contents, null if qr disabled

◆ get_autologin_key()

static tool_mobile\api::get_autologin_key ( )
static

Creates an auto-login key for the current user, this key is restricted by time and ip address.

This key is used for automatically login the user in the site when the Moodle app opens the site in a mobile browser.

Return values
stringthe key
Since
Moodle 3.2

◆ get_config()

static tool_mobile\api::get_config ( $section)
static

Returns a list of site configurations, filtering by section.

Parameters
string$sectionsection name
Return values
stdClassobject containing the settings

◆ get_features_list()

static tool_mobile\api::get_features_list ( )
static

Get a list of the Mobile app features.

Return values
arrayarray with the features grouped by theirs ubication in the app.
Since
Moodle 3.3

◆ get_plugins_supporting_mobile()

static tool_mobile\api::get_plugins_supporting_mobile ( )
static

Returns a list of Moodle plugins supporting the mobile app.

Return values
arrayan array of objects containing the plugin information

◆ get_potential_config_issues()

static tool_mobile\api::get_potential_config_issues ( )
static

This function check the current site for potential configuration issues that may prevent the mobile app to work.

Return values
arraylist of potential issues
Since
Moodle 3.4

◆ get_public_config()

static tool_mobile\api::get_public_config ( )
static

Returns a list of the site public settings, those not requiring authentication.

Return values
arraywith the settings and warnings

◆ get_qrlogin_key()

static tool_mobile\api::get_qrlogin_key ( stdClass $mobilesettings)
static

Creates a QR login key for the current user, this key is restricted by time and ip address.

This key is used for automatically login the user in the site when the user scans a QR code in the Moodle app.

Parameters
stdClass$mobilesettingsmobile app plugin settings
Return values
stringthe key
Since
Moodle 3.9

◆ get_subscription_information()

static tool_mobile\api::get_subscription_information ( )
static

Gets Moodle app plan subscription information for the current site as it is returned by the Apps Portal.

Return values
arraySubscription information

The documentation for this class was generated from the following file: