mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-10 13:43:05 +02:00
refresh license button
This commit is contained in:
@@ -417,6 +417,11 @@ def licenseStatus(request):
|
||||
command = 'sudo cat /usr/local/lsws/conf/serial.no'
|
||||
serial = ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
if serial.find('No such file or directory') > -1:
|
||||
final_dic = {'status': 1, "erroMessage": 0, 'lsSerial': 'Trial License in use.', 'lsexpiration': 'Trial license expires 15 days after activation.'}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
command = 'sudo /usr/local/lsws/bin/lshttpd -V'
|
||||
expiration = ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
@@ -433,6 +438,35 @@ def licenseStatus(request):
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def refreshLicense(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
try:
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
if currentACL['admin'] == 1:
|
||||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson('status', 0)
|
||||
|
||||
|
||||
command = 'sudo /usr/local/lsws/bin/lshttpd -V'
|
||||
ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
final_dic = {'status': 1}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
except BaseException as msg:
|
||||
final_dic = {'status': 0, 'erroMessage': str(msg)}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
except KeyError as msg:
|
||||
final_dic = {'status': 0, 'erroMessage': str(msg)}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
|
||||
def changeLicense(request):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user