mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-08 22:18:28 +03:00
Remove Prem code
This commit is contained in:
parent
857b5a27df
commit
97bf6f70b8
3 changed files with 2 additions and 178 deletions
|
|
@ -26,15 +26,7 @@ class SettingsAdminScreen extends AbstractSettingsScreen {
|
|||
* @param {Function=} fCallback = null
|
||||
*/
|
||||
setupSettings(fCallback = null) {
|
||||
let branding = null,
|
||||
licensing = null;
|
||||
|
||||
if (RL_COMMUNITY) {
|
||||
branding = require('Settings/Admin/Branding').default;
|
||||
} else {
|
||||
branding = require('Settings/Admin/Prem/Branding').default;
|
||||
licensing = require('Settings/Admin/Prem/Licensing').default;
|
||||
}
|
||||
let branding = require('Settings/Admin/Branding').default;
|
||||
|
||||
addSettingsViewModel(
|
||||
GeneralAdminSettings,
|
||||
|
|
@ -48,9 +40,7 @@ class SettingsAdminScreen extends AbstractSettingsScreen {
|
|||
|
||||
addSettingsViewModel(LoginAdminSettings, 'AdminSettingsLogin', 'TABS_LABELS/LABEL_LOGIN_NAME', 'login');
|
||||
|
||||
if (branding) {
|
||||
addSettingsViewModel(branding, 'AdminSettingsBranding', 'TABS_LABELS/LABEL_BRANDING_NAME', 'branding');
|
||||
}
|
||||
addSettingsViewModel(branding, 'AdminSettingsBranding', 'TABS_LABELS/LABEL_BRANDING_NAME', 'branding');
|
||||
|
||||
addSettingsViewModel(ContactsAdminSettings, 'AdminSettingsContacts', 'TABS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||
|
||||
|
|
@ -60,10 +50,6 @@ class SettingsAdminScreen extends AbstractSettingsScreen {
|
|||
|
||||
addSettingsViewModel(PackagesAdminSettings, 'AdminSettingsPackages', 'TABS_LABELS/LABEL_PACKAGES_NAME', 'packages');
|
||||
|
||||
if (licensing) {
|
||||
addSettingsViewModel(licensing, 'AdminSettingsLicensing', 'TABS_LABELS/LABEL_LICENSING_NAME', 'licensing');
|
||||
}
|
||||
|
||||
addSettingsViewModel(AboutAdminSettings, 'AdminSettingsAbout', 'TABS_LABELS/LABEL_ABOUT_NAME', 'about');
|
||||
|
||||
runSettingsViewModelHooks(true);
|
||||
|
|
|
|||
|
|
@ -1,96 +0,0 @@
|
|||
import { settingsSaveHelperSimpleFunction, trim } from 'Common/Utils';
|
||||
import { Magics } from 'Common/Enums';
|
||||
|
||||
import Remote from 'Remote/Admin/Ajax';
|
||||
|
||||
import { BrandingAdminSettings } from 'Settings/Admin/Branding';
|
||||
|
||||
class BrandingPremAdminSettings extends BrandingAdminSettings {
|
||||
onBuild(dom) {
|
||||
super.onBuild(dom);
|
||||
|
||||
if (this.capa && this.capa() && !this.community) {
|
||||
setTimeout(() => {
|
||||
const f1 = settingsSaveHelperSimpleFunction(this.loginLogo.trigger, this),
|
||||
f2 = settingsSaveHelperSimpleFunction(this.loginDescription.trigger, this),
|
||||
f3 = settingsSaveHelperSimpleFunction(this.loginCss.trigger, this),
|
||||
f4 = settingsSaveHelperSimpleFunction(this.userLogo.trigger, this),
|
||||
f5 = settingsSaveHelperSimpleFunction(this.userLogoTitle.trigger, this),
|
||||
f6 = settingsSaveHelperSimpleFunction(this.loginBackground.trigger, this),
|
||||
f7 = settingsSaveHelperSimpleFunction(this.userCss.trigger, this),
|
||||
f8 = settingsSaveHelperSimpleFunction(this.welcomePageUrl.trigger, this),
|
||||
f9 = settingsSaveHelperSimpleFunction(this.welcomePageDisplay.trigger, this),
|
||||
f10 = settingsSaveHelperSimpleFunction(this.userLogoMessage.trigger, this),
|
||||
f11 = settingsSaveHelperSimpleFunction(this.userIframeMessage.trigger, this);
|
||||
|
||||
this.loginLogo.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f1, {
|
||||
'LoginLogo': trim(value)
|
||||
});
|
||||
});
|
||||
|
||||
this.loginDescription.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f2, {
|
||||
'LoginDescription': trim(value)
|
||||
});
|
||||
});
|
||||
|
||||
this.loginCss.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f3, {
|
||||
'LoginCss': trim(value)
|
||||
});
|
||||
});
|
||||
|
||||
this.userLogo.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f4, {
|
||||
'UserLogo': trim(value)
|
||||
});
|
||||
});
|
||||
|
||||
this.userLogoTitle.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f5, {
|
||||
'UserLogoTitle': trim(value)
|
||||
});
|
||||
});
|
||||
|
||||
this.userLogoMessage.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f10, {
|
||||
'UserLogoMessage': trim(value)
|
||||
});
|
||||
});
|
||||
|
||||
this.userIframeMessage.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f11, {
|
||||
'UserIframeMessage': trim(value)
|
||||
});
|
||||
});
|
||||
|
||||
this.loginBackground.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f6, {
|
||||
'LoginBackground': trim(value)
|
||||
});
|
||||
});
|
||||
|
||||
this.userCss.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f7, {
|
||||
'UserCss': trim(value)
|
||||
});
|
||||
});
|
||||
|
||||
this.welcomePageUrl.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f8, {
|
||||
'WelcomePageUrl': trim(value)
|
||||
});
|
||||
});
|
||||
|
||||
this.welcomePageDisplay.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f9, {
|
||||
'WelcomePageDisplay': trim(value)
|
||||
});
|
||||
});
|
||||
}, Magics.Time50ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { BrandingPremAdminSettings, BrandingPremAdminSettings as default };
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
import ko from 'ko';
|
||||
import moment from 'moment';
|
||||
|
||||
import { settingsGet } from 'Storage/Settings';
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
||||
import LicenseStore from 'Stores/Admin/License';
|
||||
|
||||
import { getApp } from 'Helper/Apps/Admin';
|
||||
|
||||
class LicensingPremAdminSettings {
|
||||
constructor() {
|
||||
this.licensing = LicenseStore.licensing;
|
||||
this.licensingProcess = LicenseStore.licensingProcess;
|
||||
this.licenseValid = LicenseStore.licenseValid;
|
||||
this.licenseExpired = LicenseStore.licenseExpired;
|
||||
this.licenseError = LicenseStore.licenseError;
|
||||
this.licenseTrigger = LicenseStore.licenseTrigger;
|
||||
|
||||
this.adminDomain = ko.observable('');
|
||||
this.subscriptionEnabled = ko.observable(!!settingsGet('SubscriptionEnabled'));
|
||||
|
||||
this.licenseTrigger.subscribe(() => {
|
||||
if (this.subscriptionEnabled()) {
|
||||
getApp().reloadLicensing(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onBuild() {
|
||||
if (this.subscriptionEnabled()) {
|
||||
getApp().reloadLicensing(false);
|
||||
}
|
||||
}
|
||||
|
||||
onShow() {
|
||||
this.adminDomain(settingsGet('AdminDomain'));
|
||||
}
|
||||
|
||||
showActivationForm() {
|
||||
showScreenPopup(require('View/Popup/Activate'));
|
||||
}
|
||||
|
||||
showTrialForm() {
|
||||
showScreenPopup(require('View/Popup/Activate'), [true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
licenseIsUnlim() {
|
||||
return 1898625600 === this.licenseExpired() || 1898625700 === this.licenseExpired(); // eslint-disable-line no-magic-numbers
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
licenseExpiredMomentValue() {
|
||||
const time = this.licenseExpired(),
|
||||
momentUnix = moment.unix(time);
|
||||
|
||||
return this.licenseIsUnlim() ? 'Never' : time && momentUnix.format('LL') + ' (' + momentUnix.from(moment()) + ')';
|
||||
}
|
||||
}
|
||||
|
||||
export { LicensingPremAdminSettings, LicensingPremAdminSettings as default };
|
||||
Loading…
Add table
Add a link
Reference in a new issue