mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 11:39:21 +03:00
Added Allow/Disallow multiple identities
This commit is contained in:
parent
28d93f70ae
commit
2f482a6288
49 changed files with 32740 additions and 32243 deletions
|
|
@ -225,7 +225,6 @@
|
|||
{
|
||||
var
|
||||
kn = require('Knoin/Knoin'),
|
||||
sStartupUrl = Utils.pString(Settings.settingsGet('StartupUrl')),
|
||||
sCustomLogoutLink = Utils.pString(Settings.settingsGet('CustomLogoutLink')),
|
||||
bInIframe = !!Settings.settingsGet('InIframe')
|
||||
;
|
||||
|
|
@ -235,7 +234,6 @@
|
|||
|
||||
if (bLogout)
|
||||
{
|
||||
sStartupUrl = '';
|
||||
this.clearClientSideToken();
|
||||
}
|
||||
|
||||
|
|
@ -244,11 +242,6 @@
|
|||
window.close();
|
||||
}
|
||||
|
||||
if (bAdmin)
|
||||
{
|
||||
sStartupUrl = '';
|
||||
}
|
||||
|
||||
sCustomLogoutLink = sCustomLogoutLink || (bAdmin ? Links.rootAdmin() : Links.rootUser());
|
||||
|
||||
if (bLogout && window.location.href !== sCustomLogoutLink)
|
||||
|
|
@ -267,7 +260,7 @@
|
|||
else
|
||||
{
|
||||
kn.routeOff();
|
||||
kn.setHash(Links.root(sStartupUrl), true);
|
||||
kn.setHash(Links.root(), true);
|
||||
kn.routeOff();
|
||||
|
||||
_.delay(function () {
|
||||
|
|
|
|||
|
|
@ -1273,6 +1273,7 @@
|
|||
self = this,
|
||||
$LAB = require('$LAB'),
|
||||
sJsHash = Settings.settingsGet('JsHash'),
|
||||
sStartupUrl = Utils.pString(Settings.settingsGet('StartupUrl')),
|
||||
iContactsSyncInterval = Utils.pInt(Settings.settingsGet('ContactsSyncInterval')),
|
||||
bGoogle = Settings.settingsGet('AllowGoogleSocial'),
|
||||
bFacebook = Settings.settingsGet('AllowFacebookSocial'),
|
||||
|
|
@ -1314,6 +1315,13 @@
|
|||
|
||||
if (bValue)
|
||||
{
|
||||
if ('' !== sStartupUrl)
|
||||
{
|
||||
kn.routeOff();
|
||||
kn.setHash(Links.root(sStartupUrl), true);
|
||||
kn.routeOn();
|
||||
}
|
||||
|
||||
if ($LAB && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP))
|
||||
{
|
||||
var fOpenpgpCallback = function (openpgp) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,8 @@
|
|||
'AttachmentThumbnails': 'ATTACHMENT_THUMBNAILS',
|
||||
'Templates': 'TEMPLATES',
|
||||
'AutoLogout': 'AUTOLOGOUT',
|
||||
'AdditionalAccounts': 'ADDITIONAL_ACCOUNTS'
|
||||
'AdditionalAccounts': 'ADDITIONAL_ACCOUNTS',
|
||||
'Identities': 'IDENTITIES'
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,9 +56,12 @@
|
|||
'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||
}
|
||||
|
||||
kn.addSettingsViewModel(require('Settings/User/Accounts'), 'SettingsAccounts',
|
||||
Settings.capa(Enums.Capa.AdditionalAccounts) ?
|
||||
'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME' : 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'accounts');
|
||||
if (Settings.capa(Enums.Capa.AdditionalAccounts) || Settings.capa(Enums.Capa.Identities))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings/User/Accounts'), 'SettingsAccounts',
|
||||
Settings.capa(Enums.Capa.AdditionalAccounts) ?
|
||||
'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME' : 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'accounts');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.Sieve))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
this.capaUserBackground = CapaAdminStore.userBackground;
|
||||
this.capaGravatar = CapaAdminStore.gravatar;
|
||||
this.capaAdditionalAccounts = CapaAdminStore.additionalAccounts;
|
||||
this.capaIdentities = CapaAdminStore.identities;
|
||||
this.capaAttachmentThumbnails = CapaAdminStore.attachmentThumbnails;
|
||||
this.capaTemplates = CapaAdminStore.templates;
|
||||
|
||||
|
|
@ -136,6 +137,12 @@
|
|||
});
|
||||
});
|
||||
|
||||
self.capaIdentities.subscribe(function (bValue) {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaIdentities': bValue ? '1' : '0'
|
||||
});
|
||||
});
|
||||
|
||||
self.capaTemplates.subscribe(function (bValue) {
|
||||
Remote.saveAdminConfig(null, {
|
||||
'CapaTemplates': bValue ? '1' : '0'
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
function AccountsUserSettings()
|
||||
{
|
||||
this.allowAdditionalAccount = Settings.capa(Enums.Capa.AdditionalAccounts);
|
||||
this.allowIdentities = true;
|
||||
this.allowIdentities = Settings.capa(Enums.Capa.Identities);;
|
||||
|
||||
this.accounts = AccountStore.accounts;
|
||||
this.identities = IdentityStore.identities;
|
||||
|
|
|
|||
|
|
@ -16,9 +16,12 @@
|
|||
AppStore = require('Stores/User/App'),
|
||||
LanguageStore = require('Stores/Language'),
|
||||
SettingsStore = require('Stores/User/Settings'),
|
||||
IdentityStore = require('Stores/User/Identity'),
|
||||
NotificationStore = require('Stores/User/Notification'),
|
||||
MessageStore = require('Stores/User/Message'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
|
||||
Remote = require('Remote/User/Ajax')
|
||||
;
|
||||
|
||||
|
|
@ -62,6 +65,20 @@
|
|||
|
||||
this.isAnimationSupported = Globals.bAnimationSupported;
|
||||
|
||||
this.identities = IdentityStore.identities;
|
||||
|
||||
this.identityMain = ko.computed(function () {
|
||||
var aList = this.identities();
|
||||
return Utils.isArray(aList) ? _.find(aList, function (oItem) {
|
||||
return oItem && '' === oItem.id() ? true : false;
|
||||
}) : null;
|
||||
}, this);
|
||||
|
||||
this.identityMainDesc = ko.computed(function () {
|
||||
var oIdentity = this.identityMain();
|
||||
return oIdentity ? oIdentity.formattedName() : '---';
|
||||
}, this);
|
||||
|
||||
this.editorDefaultTypes = ko.computed(function () {
|
||||
Translator.trigger();
|
||||
return [
|
||||
|
|
@ -82,6 +99,15 @@
|
|||
}, this);
|
||||
}
|
||||
|
||||
GeneralUserSettings.prototype.editMainIdentity = function ()
|
||||
{
|
||||
var oIdentity = this.identityMain();
|
||||
if (oIdentity)
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'), [oIdentity]);
|
||||
}
|
||||
};
|
||||
|
||||
GeneralUserSettings.prototype.testSoundNotification = function ()
|
||||
{
|
||||
NotificationStore.playSoundNotification(true);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
function CapaAdminStore()
|
||||
{
|
||||
this.additionalAccounts = ko.observable(false);
|
||||
this.identities = ko.observable(false);
|
||||
this.gravatar = ko.observable(false);
|
||||
this.attachmentThumbnails = ko.observable(false);
|
||||
this.sieve = ko.observable(false);
|
||||
|
|
@ -32,6 +33,7 @@
|
|||
CapaAdminStore.prototype.populate = function()
|
||||
{
|
||||
this.additionalAccounts(Settings.capa(Enums.Capa.AdditionalAccounts));
|
||||
this.identities(Settings.capa(Enums.Capa.Identities));
|
||||
this.gravatar(Settings.capa(Enums.Capa.Gravatar));
|
||||
this.attachmentThumbnails(Settings.capa(Enums.Capa.AttachmentThumbnails));
|
||||
this.sieve(Settings.capa(Enums.Capa.Sieve));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue