snappymail/dev/Admin/Login.js
RainLoop Team 4cc2207513 Uploading and preparing the repository to the dev version.
Original unminified source code (dev folder - js, css, less) (fixes #6)
Grunt build system
Multiple identities correction (fixes #9)
Compose html editor (fixes #12)
New general settings - Loading Description
New warning about default admin password
Split general and login screen settings
2013-11-16 02:21:12 +04:00

53 lines
1.3 KiB
JavaScript

/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
* @constructor
*/
function AdminLogin()
{
var oData = RL.data();
this.allowCustomLogin = oData.allowCustomLogin;
this.determineUserLanguage = oData.determineUserLanguage;
this.defaultDomain = ko.observable(RL.settingsGet('LoginDefaultDomain'));
this.allowLanguagesOnLogin = oData.allowLanguagesOnLogin;
this.defaultDomainTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
}
Utils.addSettingsViewModel(AdminLogin, 'AdminSettingsLogin', 'Login', 'login');
AdminLogin.prototype.onBuild = function ()
{
var self = this;
_.delay(function () {
var f1 = Utils.settingsSaveHelperSimpleFunction(self.defaultDomainTrigger, self);
self.determineUserLanguage.subscribe(function (bValue) {
RL.remote().saveAdminConfig(null, {
'DetermineUserLanguage': bValue ? '1' : '0'
});
});
self.allowCustomLogin.subscribe(function (bValue) {
RL.remote().saveAdminConfig(null, {
'AllowCustomLogin': bValue ? '1' : '0'
});
});
self.allowLanguagesOnLogin.subscribe(function (bValue) {
RL.remote().saveAdminConfig(null, {
'AllowLanguagesOnLogin': bValue ? '1' : '0'
});
});
self.defaultDomain.subscribe(function (sValue) {
RL.remote().saveAdminConfig(f1, {
'LoginDefaultDomain': Utils.trim(sValue)
});
});
}, 50);
};