Drop License code (not used by comunity)

This commit is contained in:
djmaze 2020-08-18 20:45:43 +02:00
parent 97a73c6639
commit 1d4224d733
6 changed files with 9 additions and 79 deletions

View file

@ -1,9 +1,7 @@
import ko from 'ko';
import { root } from 'Common/Links';
import { getNotification } from 'Common/Translator';
import { StorageResultType, Notification } from 'Common/Enums';
import { pInt } from 'Common/Utils';
import { StorageResultType } from 'Common/Enums';
import * as Settings from 'Storage/Settings';
@ -11,7 +9,6 @@ import AppStore from 'Stores/Admin/App';
import CapaStore from 'Stores/Admin/Capa';
import DomainStore from 'Stores/Admin/Domain';
import PluginStore from 'Stores/Admin/Plugin';
import LicenseStore from 'Stores/Admin/License';
import PackageStore from 'Stores/Admin/Package';
import CoreStore from 'Stores/Admin/Core';
import Remote from 'Remote/Admin/Ajax';
@ -131,7 +128,7 @@ class AdminApp extends AbstractApp {
CoreStore.coreVersion(data.Result.Version || '');
CoreStore.coreRemoteVersion(data.Result.RemoteVersion || '');
CoreStore.coreRemoteRelease(data.Result.RemoteRelease || '');
CoreStore.coreVersionCompare(pInt(data.Result.VersionCompare));
CoreStore.coreVersionCompare(parseInt(data.Result.VersionCompare, 10) || 0);
} else {
CoreStore.coreReal(false);
CoreStore.coreChannel('stable');
@ -145,40 +142,6 @@ class AdminApp extends AbstractApp {
});
}
/**
* @param {boolean=} force = false
*/
reloadLicensing(force = false) {
LicenseStore.licensingProcess(true);
LicenseStore.licenseError('');
Remote.licensing((result, data) => {
LicenseStore.licensingProcess(false);
if (StorageResultType.Success === result && data && data.Result && null != data.Result.Expired) {
LicenseStore.licenseValid(true);
LicenseStore.licenseExpired(pInt(data.Result.Expired));
LicenseStore.licenseError('');
LicenseStore.licensing(true);
AppStore.prem(true);
} else {
if (
data &&
data.ErrorCode &&
[Notification.LicensingServerIsUnavailable, Notification.LicensingExpired].includes(pInt(data.ErrorCode))
) {
LicenseStore.licenseError(getNotification(pInt(data.ErrorCode)));
LicenseStore.licensing(true);
} else {
if (StorageResultType.Abort === result) {
LicenseStore.licenseError(getNotification(Notification.LicensingServerIsUnavailable));
LicenseStore.licensing(true);
} else {
LicenseStore.licensing(false);
}
}
}
}, force);
}
bootend(bootendCallback = null) {
if (window.progressJs) {
progressJs.end();

View file

@ -523,10 +523,6 @@ export const Notification = {
InvalidPluginPackage: 703,
UnsupportedPluginPackage: 704,
LicensingServerIsUnavailable: 710,
LicensingExpired: 711,
LicensingBanned: 712,
DemoSendMessageError: 750,
DemoAccountError: 751,

View file

@ -348,9 +348,6 @@ export function admin(screenName) {
case 'AdminSecurity':
result += 'security';
break;
case 'AdminLicensing':
result += 'licensing';
break;
// no default
}

View file

@ -62,10 +62,6 @@ const I18N_NOTIFICATION_MAP = [
[Notification.InvalidPluginPackage, 'NOTIFICATIONS/INVALID_PLUGIN_PACKAGE'],
[Notification.UnsupportedPluginPackage, 'NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE'],
[Notification.LicensingServerIsUnavailable, 'NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE'],
[Notification.LicensingExpired, 'NOTIFICATIONS/LICENSING_EXPIRED'],
[Notification.LicensingBanned, 'NOTIFICATIONS/LICENSING_BANNED'],
[Notification.DemoSendMessageError, 'NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR'],
[Notification.DemoAccountError, 'NOTIFICATIONS/DEMO_ACCOUNT_ERROR'],

View file

@ -162,28 +162,6 @@ class RemoteAdminAjax extends AbstractAjaxRemote {
return this.defaultRequest(fCallback, 'AdminPluginSettingsUpdate', oConfig);
}
/**
* @param {?Function} fCallback
* @param {boolean} bForce
*/
licensing(fCallback, bForce) {
return this.defaultRequest(fCallback, 'AdminLicensing', {
Force: bForce ? 1 : 0
});
}
/**
* @param {?Function} fCallback
* @param {string} sDomain
* @param {string} sKey
*/
licensingActivate(fCallback, sDomain, sKey) {
return this.defaultRequest(fCallback, 'AdminLicensingActivate', {
Domain: sDomain,
Key: sKey
});
}
/**
* @param {?Function} fCallback
* @param {string} sName