@@ -417,6 +417,11 @@ def licenseStatus(request):
417417 command = 'sudo cat /usr/local/lsws/conf/serial.no'
418418 serial = ProcessUtilities .outputExecutioner (command )
419419
420+ if serial .find ('No such file or directory' ) > - 1 :
421+ final_dic = {'status' : 1 , "erroMessage" : 0 , 'lsSerial' : 'Trial License in use.' , 'lsexpiration' : 'Trial license expires 15 days after activation.' }
422+ final_json = json .dumps (final_dic )
423+ return HttpResponse (final_json )
424+
420425 command = 'sudo /usr/local/lsws/bin/lshttpd -V'
421426 expiration = ProcessUtilities .outputExecutioner (command )
422427
@@ -433,6 +438,35 @@ def licenseStatus(request):
433438 final_json = json .dumps (final_dic )
434439 return HttpResponse (final_json )
435440
441+ def refreshLicense (request ):
442+ try :
443+ userID = request .session ['userID' ]
444+
445+ try :
446+ currentACL = ACLManager .loadedACL (userID )
447+
448+ if currentACL ['admin' ] == 1 :
449+ pass
450+ else :
451+ return ACLManager .loadErrorJson ('status' , 0 )
452+
453+
454+ command = 'sudo /usr/local/lsws/bin/lshttpd -V'
455+ ProcessUtilities .outputExecutioner (command )
456+
457+ final_dic = {'status' : 1 }
458+ final_json = json .dumps (final_dic )
459+ return HttpResponse (final_json )
460+
461+ except BaseException as msg :
462+ final_dic = {'status' : 0 , 'erroMessage' : str (msg )}
463+ final_json = json .dumps (final_dic )
464+ return HttpResponse (final_json )
465+ except KeyError as msg :
466+ final_dic = {'status' : 0 , 'erroMessage' : str (msg )}
467+ final_json = json .dumps (final_dic )
468+ return HttpResponse (final_json )
469+
436470
437471def changeLicense (request ):
438472 try :
0 commit comments