2013-07-08 09:13:21 -07:00
|
|
|
|
(function ($, document, window) {
|
|
|
|
|
|
|
|
|
|
function loadPage(page, config) {
|
|
|
|
|
|
2014-05-23 16:58:28 -07:00
|
|
|
|
$('#chkMobileClients', page).checked(config.RequireMobileManualLogin).checkboxradio("refresh");
|
|
|
|
|
$('#chkOtherApps', page).checked(config.RequireNonMobileManualLogin).checkboxradio("refresh");
|
2013-07-08 09:13:21 -07:00
|
|
|
|
|
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(document).on('pageshow', "#allUserSettingsPage", function () {
|
|
|
|
|
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
|
|
|
|
ApiClient.getServerConfiguration().done(function (config) {
|
|
|
|
|
|
|
|
|
|
loadPage(page, config);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function allUserSettingsPage() {
|
|
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
|
|
self.onSubmit = function () {
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
|
|
|
|
var form = this;
|
|
|
|
|
|
|
|
|
|
ApiClient.getServerConfiguration().done(function (config) {
|
|
|
|
|
|
2014-05-23 16:58:28 -07:00
|
|
|
|
config.RequireMobileManualLogin = $('#chkMobileClients', form).checked();
|
|
|
|
|
config.RequireNonMobileManualLogin = $('#chkOtherApps', form).checked();
|
2013-07-08 09:13:21 -07:00
|
|
|
|
|
|
|
|
|
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Disable default form submission
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.AllUserSettingsPage = new allUserSettingsPage();
|
|
|
|
|
|
|
|
|
|
})(jQuery, document, window);
|