mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-10-11 06:06:29 +08:00
Trial key
This commit is contained in:
parent
286ab567af
commit
c253b7c4bd
8 changed files with 40 additions and 10 deletions
|
@ -15,6 +15,7 @@
|
||||||
Translator = require('Common/Translator'),
|
Translator = require('Common/Translator'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
|
AppStore = require('Stores/Admin/App'),
|
||||||
DomainStore = require('Stores/Admin/Domain'),
|
DomainStore = require('Stores/Admin/Domain'),
|
||||||
PluginStore = require('Stores/Admin/Plugin'),
|
PluginStore = require('Stores/Admin/Plugin'),
|
||||||
LicenseStore = require('Stores/Admin/License'),
|
LicenseStore = require('Stores/Admin/License'),
|
||||||
|
@ -208,6 +209,8 @@
|
||||||
LicenseStore.licenseError('');
|
LicenseStore.licenseError('');
|
||||||
|
|
||||||
LicenseStore.licensing(true);
|
LicenseStore.licensing(true);
|
||||||
|
|
||||||
|
AppStore.prem(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -117,6 +117,12 @@
|
||||||
*/
|
*/
|
||||||
Consts.Values.TokenErrorLimit = 10;
|
Consts.Values.TokenErrorLimit = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
Consts.Values.RainLoopTrialKey = 'RAINLOOP-TRIAL-KEY';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {string}
|
* @type {string}
|
||||||
|
|
|
@ -17,10 +17,11 @@
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
Enums = require('Common/Enums'),
|
Enums = require('Common/Enums'),
|
||||||
Settings = require('Storage/Settings')
|
Settings = require('Storage/Settings'),
|
||||||
|
AppStore = require('Stores/Admin/App')
|
||||||
;
|
;
|
||||||
|
|
||||||
this.capa = !!Settings.settingsGet('PremType');
|
this.capa = AppStore.prem;
|
||||||
|
|
||||||
this.title = ko.observable(Settings.settingsGet('Title'));
|
this.title = ko.observable(Settings.settingsGet('Title'));
|
||||||
this.title.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
this.title.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||||
|
|
|
@ -52,12 +52,17 @@
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Activate'));
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Activate'));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
LicensingAdminSettings.prototype.showTrialForm = function ()
|
||||||
|
{
|
||||||
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Activate'), [true]);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
LicensingAdminSettings.prototype.licenseIsUnlim = function ()
|
LicensingAdminSettings.prototype.licenseIsUnlim = function ()
|
||||||
{
|
{
|
||||||
return 1898625600 === this.licenseExpired();
|
return 1898625600 === this.licenseExpired() || 1898625700 === this.licenseExpired();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
this.interfaceAnimation.valueHasMutated();
|
this.interfaceAnimation.valueHasMutated();
|
||||||
|
|
||||||
|
this.prem = ko.observable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
AppStore.prototype.populate = function()
|
AppStore.prototype.populate = function()
|
||||||
|
@ -35,6 +37,8 @@
|
||||||
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
|
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
|
||||||
|
|
||||||
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
|
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
|
||||||
|
|
||||||
|
this.prem(!!Settings.settingsGet('PremType'));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = AppStore;
|
module.exports = AppStore;
|
||||||
|
|
|
@ -9,10 +9,13 @@
|
||||||
|
|
||||||
Enums = require('Common/Enums'),
|
Enums = require('Common/Enums'),
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
Consts = require('Common/Consts'),
|
||||||
Translator = require('Common/Translator'),
|
Translator = require('Common/Translator'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Remote = require('Storage/Admin/Remote'),
|
Remote = require('Storage/Admin/Remote'),
|
||||||
|
|
||||||
|
AppStore = require('Stores/Admin/App'),
|
||||||
LicenseStore = require('Stores/Admin/License'),
|
LicenseStore = require('Stores/Admin/License'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
|
@ -108,12 +111,14 @@
|
||||||
kn.extendAsViewModel(['View/Popup/Activate', 'PopupsActivateViewModel'], ActivatePopupView);
|
kn.extendAsViewModel(['View/Popup/Activate', 'PopupsActivateViewModel'], ActivatePopupView);
|
||||||
_.extend(ActivatePopupView.prototype, AbstractView.prototype);
|
_.extend(ActivatePopupView.prototype, AbstractView.prototype);
|
||||||
|
|
||||||
ActivatePopupView.prototype.onShow = function ()
|
ActivatePopupView.prototype.onShow = function (bTrial)
|
||||||
{
|
{
|
||||||
this.domain(Settings.settingsGet('AdminDomain'));
|
this.domain(Settings.settingsGet('AdminDomain'));
|
||||||
if (!this.activateProcess())
|
if (!this.activateProcess())
|
||||||
{
|
{
|
||||||
this.key('');
|
bTrial = Utils.isUnd(bTrial) ? false : !!bTrial;
|
||||||
|
|
||||||
|
this.key(bTrial ? Consts.Values.RainLoopTrialKey : '');
|
||||||
this.activateText('');
|
this.activateText('');
|
||||||
this.activateText.isError(false);
|
this.activateText.isError(false);
|
||||||
this.activationSuccessed(false);
|
this.activationSuccessed(false);
|
||||||
|
@ -134,7 +139,8 @@
|
||||||
ActivatePopupView.prototype.validateSubscriptionKey = function ()
|
ActivatePopupView.prototype.validateSubscriptionKey = function ()
|
||||||
{
|
{
|
||||||
var sValue = this.key();
|
var sValue = this.key();
|
||||||
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
|
return '' === sValue || Consts.Values.RainLoopTrialKey === sValue ||
|
||||||
|
!!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ActivatePopupView;
|
module.exports = ActivatePopupView;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<div class="b-admin-branding">
|
<div class="b-admin-branding">
|
||||||
<div class="row" data-bind="visible: !capa">
|
<div class="row" data-bind="visible: !capa()">
|
||||||
<div class="alert span8" style="margin-top: 10px;">
|
<div class="alert span8" style="margin-top: 10px;">
|
||||||
This functionality is available for <strong><a href="#/licensing">Premium</a></strong> subscribers.
|
This functionality is available for <strong><a href="#/licensing">Premium</a></strong> subscribers.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-horizontal" data-bind="css: {'disabled-form': !capa}">
|
<div class="form-horizontal" data-bind="css: {'disabled-form': !capa()}">
|
||||||
<div class="legend">
|
<div class="legend">
|
||||||
Branding
|
Branding
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -86,13 +86,18 @@
|
||||||
|
|
||||||
Activate Subscription Key for this domain
|
Activate Subscription Key for this domain
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<a class="btn" href="http://rainloop.net/purchase/" target="_black">
|
<a class="btn" href="http://rainloop.net/purchase/" target="_black">
|
||||||
<i class="icon-purchase"></i>
|
<i class="icon-purchase"></i>
|
||||||
|
|
||||||
Purchase
|
Purchase
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<a class="btn" data-bind="click: showTrialForm, visible: !licensing()">
|
||||||
|
<i class="icon-eye"></i>
|
||||||
|
|
||||||
|
Trial
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue