Merge branch 'MDL-78801-master' of https://github.com/jleyva/moodle
This commit is contained in:
@@ -65,6 +65,12 @@ class api {
|
||||
const DEFAULT_ANDROID_APP_ID = 'com.moodle.moodlemobile';
|
||||
/** @var string Default iOS app id */
|
||||
const DEFAULT_IOS_APP_ID = '633359593';
|
||||
/** @var int AUTOLOGOUT disabled value */
|
||||
const AUTOLOGOUT_DISABLED = 0;
|
||||
/** @var int AUTOLOGOUT type inmediate value */
|
||||
const AUTOLOGOUT_INMEDIATE = 1;
|
||||
/** @var int AUTOLOGOUT type custom value */
|
||||
const AUTOLOGOUT_CUSTOM = 2;
|
||||
|
||||
/**
|
||||
* Returns a list of Moodle plugins supporting the mobile app.
|
||||
@@ -315,6 +321,8 @@ class api {
|
||||
$mintimereq = get_config('tool_mobile', 'autologinmintimebetweenreq');
|
||||
$mintimereq = empty($mintimereq) ? 6 * MINSECS : $mintimereq;
|
||||
$settings->tool_mobile_autologinmintimebetweenreq = $mintimereq;
|
||||
$settings->tool_mobile_autologout = get_config('tool_mobile', 'autologout');
|
||||
$settings->tool_mobile_autologouttime = get_config('tool_mobile', 'autologouttime');
|
||||
}
|
||||
|
||||
if (empty($section) or $section == 'calendar') {
|
||||
|
||||
@@ -32,6 +32,10 @@ $string['autologinkeygenerationlockout'] = 'Auto-login key generation is blocked
|
||||
$string['autologinmintimebetweenreq'] = 'Minimum time between auto-login requests';
|
||||
$string['autologinmintimebetweenreq_desc'] = 'The minimum time between auto-login requests from the mobile app. If app users are frequently asked to enter their credentials when viewing content embedded from the site, then set a lower value.';
|
||||
$string['autologinnotallowedtoadmins'] = 'Auto-login is not allowed for site admins.';
|
||||
$string['autologout'] = 'Enforce auto logout for your users';
|
||||
$string['autologout_desc'] = 'For security reasons, you can enforce automatic logout for your users when they leave or close the app, or it goes to background. Users will have to log in again when they return to the app.';
|
||||
$string['autologoutcustom'] = 'Custom time after users leave or close the app';
|
||||
$string['autologoutinmediate'] = 'Immediately after users leave or close the app';
|
||||
$string['cachedef_plugininfo'] = 'This stores the list of plugins with mobile addons';
|
||||
$string['cachedef_subscriptiondata'] = 'This stores the Moodle app subscription information.';
|
||||
$string['clickheretolaunchtheapp'] = 'Click here if the app does not open automatically.';
|
||||
|
||||
@@ -102,6 +102,18 @@ if ($hassiteconfig) {
|
||||
new lang_string('typeoflogin', 'tool_mobile'),
|
||||
new lang_string('typeoflogin_desc', 'tool_mobile'), 1, $options));
|
||||
|
||||
$options = [
|
||||
tool_mobile\api::AUTOLOGOUT_DISABLED => new lang_string('never'),
|
||||
tool_mobile\api::AUTOLOGOUT_INMEDIATE => new lang_string('autologoutinmediate', 'tool_mobile'),
|
||||
tool_mobile\api::AUTOLOGOUT_CUSTOM => new lang_string('autologoutcustom', 'tool_mobile'),
|
||||
];
|
||||
$temp->add(new admin_setting_configselect('tool_mobile/autologout',
|
||||
new lang_string('autologout', 'tool_mobile'),
|
||||
new lang_string('autologout_desc', 'tool_mobile'), 0, $options));
|
||||
|
||||
$temp->add(new admin_setting_configduration('tool_mobile/autologouttime', '', '', DAYSECS));
|
||||
$temp->hide_if('tool_mobile/autologouttime', 'tool_mobile/autologout', 'neq', tool_mobile\api::AUTOLOGOUT_CUSTOM);
|
||||
|
||||
$options = [
|
||||
tool_mobile\api::QR_CODE_DISABLED => new lang_string('qrcodedisabled', 'tool_mobile'),
|
||||
tool_mobile\api::QR_CODE_URL => new lang_string('qrcodetypeurl', 'tool_mobile'),
|
||||
|
||||
@@ -230,6 +230,8 @@ class externallib_test extends externallib_advanced_testcase {
|
||||
array('name' => 'tool_mobile_custommenuitems', 'value' => ''),
|
||||
array('name' => 'tool_mobile_apppolicy', 'value' => ''),
|
||||
array('name' => 'tool_mobile_autologinmintimebetweenreq', 'value' => 6 * MINSECS),
|
||||
array('name' => 'tool_mobile_autologout', 'value' => get_config('tool_mobile', 'autologout')),
|
||||
array('name' => 'tool_mobile_autologouttime', 'value' => get_config('tool_mobile', 'autologouttime')),
|
||||
array('name' => 'calendartype', 'value' => $CFG->calendartype),
|
||||
array('name' => 'calendar_site_timeformat', 'value' => $CFG->calendar_site_timeformat),
|
||||
array('name' => 'calendar_startwday', 'value' => $CFG->calendar_startwday),
|
||||
|
||||
Reference in New Issue
Block a user