Skip to content
Permalink
Browse files

Feature: Auto Request 15 days trial for LSWS Ent

  • Loading branch information...
usmannasir committed Sep 19, 2019
1 parent 6b59900 commit e7437afebd796fe0650299e69d682ef8d714070e
@@ -48,21 +48,20 @@ <h3 class="content-box-header">
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-6">
<div ng-hide="canNotIssue" class="alert alert-danger">
<p>{% trans "Cannot issue SSL. Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="canNotIssue" class="alert alert-danger">
<p>{% trans "Cannot issue SSL. Error message:" %} {$ errorMessage $}</p>
</div>

<div ng-hide="sslIssued" class="alert alert-success">
<p>{% trans "SSL Issued for" %} <strong>{$ sslDomain $}</strong></p>
</div>
<div ng-hide="sslIssued" class="alert alert-success">
<p>{% trans "SSL Issued for" %} <strong>{$ sslDomain $}</strong></p>
</div>

<div ng-hide="couldNotConnect" class="alert alert-danger">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
<div ng-hide="couldNotConnect" class="alert alert-danger">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>



</div>


@@ -61,13 +61,22 @@ def installLiteSpeed(licenseKey, statusFile):
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0

if os.path.exists('/usr/local/CyberCP/lsws-5.3.8/'):
shutil.rmtree('/usr/local/CyberCP/lsws-5.3.8')


command = 'tar zxf lsws-5.3.8-ent-x86_64-linux.tar.gz -C /usr/local/CyberCP'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0

writeSerial = open('/usr/local/CyberCP/lsws-5.3.8/serial.no', 'w')
writeSerial.writelines(licenseKey)
writeSerial.close()
if licenseKey == 'trial':
command = 'wget -q --output-document=/usr/local/CyberCP/lsws-5.3.8/trial.key http://license.litespeedtech.com/reseller/trial.key'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
else:
writeSerial = open('/usr/local/CyberCP/lsws-5.3.8/serial.no', 'w')
writeSerial.writelines(licenseKey)
writeSerial.close()

shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/install.sh', '/usr/local/CyberCP/lsws-5.3.8/')
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/functions.sh', '/usr/local/CyberCP/lsws-5.3.8/')
@@ -158,8 +158,25 @@ <h3 class="content-box-header">
<div class="col-sm-4">
<button type="button" ng-click="switchTOLSWS()"
class="btn btn-primary btn-lg">{% trans "Switch" %}</button>
<button type="button" ng-click="switchTOLSWS()"
class="btn btn-primary btn-lg">{% trans "Get 15 Days Trial" %}</button>

</div>
<div class="col-sm-4">


</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-6">
<div class="alert alert-info">
<p>{% trans "Note: If you select 15 days trial there is no need to enter the serial key, CyberPanel will auto fetch 15 days trial key for you. Make sure this server have not used trial already." %}</p>
</div>
</div>


</div>

</form>
@@ -343,8 +343,13 @@ def switchTOLSWS(request):

data = json.loads(request.body)

try:
licenseKey = data['licenseKey']
except:
licenseKey = 'trial'

execPath = "sudo /usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/serverStatus/serverStatusUtil.py"
execPath = execPath + " switchTOLSWS --licenseKey " + data['licenseKey']
execPath = execPath + " switchTOLSWS --licenseKey " + licenseKey

ProcessUtilities.popenExecutioner(execPath)
time.sleep(2)

0 comments on commit e7437af

Please sign in to comment.
You can’t perform that action at this time.