mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-25 00:21: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'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
AppStore = require('Stores/Admin/App'),
|
||||
DomainStore = require('Stores/Admin/Domain'),
|
||||
PluginStore = require('Stores/Admin/Plugin'),
|
||||
LicenseStore = require('Stores/Admin/License'),
|
||||
|
@ -208,6 +209,8 @@
|
|||
LicenseStore.licenseError('');
|
||||
|
||||
LicenseStore.licensing(true);
|
||||
|
||||
AppStore.prem(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -117,6 +117,12 @@
|
|||
*/
|
||||
Consts.Values.TokenErrorLimit = 10;
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
*/
|
||||
Consts.Values.RainLoopTrialKey = 'RAINLOOP-TRIAL-KEY';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
|
|
|
@ -17,10 +17,11 @@
|
|||
{
|
||||
var
|
||||
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.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
|
|
|
@ -52,12 +52,17 @@
|
|||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Activate'));
|
||||
};
|
||||
|
||||
LicensingAdminSettings.prototype.showTrialForm = function ()
|
||||
{
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Activate'), [true]);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
LicensingAdminSettings.prototype.licenseIsUnlim = function ()
|
||||
{
|
||||
return 1898625600 === this.licenseExpired();
|
||||
return 1898625600 === this.licenseExpired() || 1898625700 === this.licenseExpired();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
});
|
||||
|
||||
this.interfaceAnimation.valueHasMutated();
|
||||
|
||||
this.prem = ko.observable(false);
|
||||
}
|
||||
|
||||
AppStore.prototype.populate = function()
|
||||
|
@ -35,6 +37,8 @@
|
|||
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
|
||||
|
||||
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
|
||||
|
||||
this.prem(!!Settings.settingsGet('PremType'));
|
||||
};
|
||||
|
||||
module.exports = AppStore;
|
||||
|
|
|
@ -9,10 +9,13 @@
|
|||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Consts = require('Common/Consts'),
|
||||
Translator = require('Common/Translator'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
|
||||
AppStore = require('Stores/Admin/App'),
|
||||
LicenseStore = require('Stores/Admin/License'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
@ -108,12 +111,14 @@
|
|||
kn.extendAsViewModel(['View/Popup/Activate', 'PopupsActivateViewModel'], ActivatePopupView);
|
||||
_.extend(ActivatePopupView.prototype, AbstractView.prototype);
|
||||
|
||||
ActivatePopupView.prototype.onShow = function ()
|
||||
ActivatePopupView.prototype.onShow = function (bTrial)
|
||||
{
|
||||
this.domain(Settings.settingsGet('AdminDomain'));
|
||||
if (!this.activateProcess())
|
||||
{
|
||||
this.key('');
|
||||
bTrial = Utils.isUnd(bTrial) ? false : !!bTrial;
|
||||
|
||||
this.key(bTrial ? Consts.Values.RainLoopTrialKey : '');
|
||||
this.activateText('');
|
||||
this.activateText.isError(false);
|
||||
this.activationSuccessed(false);
|
||||
|
@ -134,7 +139,8 @@
|
|||
ActivatePopupView.prototype.validateSubscriptionKey = function ()
|
||||
{
|
||||
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;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<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;">
|
||||
This functionality is available for <strong><a href="#/licensing">Premium</a></strong> subscribers.
|
||||
</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">
|
||||
Branding
|
||||
</div>
|
||||
|
|
|
@ -86,13 +86,18 @@
|
|||
|
||||
Activate Subscription Key for this domain
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a class="btn" href="http://rainloop.net/purchase/" target="_black">
|
||||
<i class="icon-purchase"></i>
|
||||
|
||||
Purchase
|
||||
</a>
|
||||
|
||||
<a class="btn" data-bind="click: showTrialForm, visible: !licensing()">
|
||||
<i class="icon-eye"></i>
|
||||
|
||||
Trial
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue