Skip to content

Commit

Permalink
Merge branch 'MDL-57409-master' of git://github.com/jleyva/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jan 17, 2017
2 parents 4a237e9 + 7bdcf97 commit a7068a8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions admin/tool/mobile/classes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ public static function get_config($section) {
$settings->mygradesurl = user_mygrades_url()->out(false);
}

if (empty($section) or $section == 'mobileapp') {
$settings->tool_mobile_forcelogout = get_config('tool_mobile', 'forcelogout');
}

return $settings;
}

Expand Down
3 changes: 3 additions & 0 deletions admin/tool/mobile/lang/en/tool_mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
$string['enablesmartappbanners_desc'] = 'This will display a banner promoting the Moodle Mobile app when visiting the site in Mobile Safari.';
$string['forcedurlscheme'] = 'If you want to allow only your custom branded app to be opened via a browser window, then specify its URL scheme here; otherwise leave the field empty.';
$string['forcedurlscheme_key'] = 'URL scheme';
$string['forcelogout'] = 'Force log out';
$string['forcelogout_desc'] = 'If enabled, the app option \'Change site\' is replaced by \'Log out\'. This results in the user being completely logged out. They must then re-enter their password the next time they wish to access the site.';
$string['httpsrequired'] = 'HTTPS required';
$string['invalidprivatetoken'] = 'Invalid private token. Token should not be empty or passed via GET parameter.';
$string['iosappid'] = 'App\'s unique identifier';
Expand All @@ -41,6 +43,7 @@
$string['mobileappearance'] = 'Mobile appearance';
$string['mobileauthentication'] = 'Mobile authentication';
$string['mobilecssurl'] = 'CSS';
$string['mobilefeatures'] = 'Mobile features';
$string['mobilesettings'] = 'Mobile settings';
$string['pluginname'] = 'Moodle Mobile tools';
$string['smartappbanners'] = 'Smart App Banners (iOS only)';
Expand Down
12 changes: 12 additions & 0 deletions admin/tool/mobile/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,17 @@
new lang_string('iosappid_desc', 'tool_mobile'), '633359593', PARAM_ALPHANUM));

$ADMIN->add('mobileapp', $temp);

// Features related settings.
$temp = new admin_settingpage('mobilefeatures', new lang_string('mobilefeatures', 'tool_mobile'));

$temp->add(new admin_setting_heading('tool_mobile/logout',
new lang_string('logout'), ''));

$temp->add(new admin_setting_configcheckbox('tool_mobile/forcelogout',
new lang_string('forcelogout', 'tool_mobile'),
new lang_string('forcelogout_desc', 'tool_mobile'), 0));

$ADMIN->add('mobileapp', $temp);
}
}
5 changes: 3 additions & 2 deletions admin/tool/mobile/tests/externallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,16 @@ public function test_get_config() {
array('name' => 'commentsperpage', 'value' => $CFG->commentsperpage),
array('name' => 'disableuserimages', 'value' => $CFG->disableuserimages),
array('name' => 'mygradesurl', 'value' => user_mygrades_url()->out(false)),
array('name' => 'tool_mobile_forcelogout', 'value' => 0),
);
$this->assertCount(0, $result['warnings']);
$this->assertEquals($expected, $result['settings']);

// Change a value and retrieve filtering by section.
set_config('commentsperpage', 1);
$expected[10]['value'] = 1;
unset($expected[11]);
unset($expected[12]);
// Remove not expected elements.
array_splice($expected, 11);

$result = external::get_config('frontpagesettings');
$result = external_api::clean_returnvalue(external::get_config_returns(), $result);
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/mobile/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

defined('MOODLE_INTERNAL') || die();
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2016120501; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2016112900; // Requires this Moodle version.
$plugin->component = 'tool_mobile'; // Full name of the plugin (used for diagnostics).
$plugin->dependencies = array(
Expand Down

0 comments on commit a7068a8

Please sign in to comment.