summaryrefslogtreecommitdiffstats
path: root/openssl-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'openssl-controller.lua')
-rw-r--r--openssl-controller.lua27
1 files changed, 26 insertions, 1 deletions
diff --git a/openssl-controller.lua b/openssl-controller.lua
index ff9fb91..0b3cdde 100644
--- a/openssl-controller.lua
+++ b/openssl-controller.lua
@@ -12,7 +12,9 @@ mvc.pre_exec = function(self)
sslstatus = self.model.getstatus()
if (sslstatus.value.version.errtxt and self.conf.action ~= "status")
or (sslstatus.value.conffile.errtxt and self.conf.action ~= "status" and self.conf.action ~= "editconfigfile")
- or ((sslstatus.value.cacert.errtxt or sslstatus.value.cakey.errtxt) and self.conf.action ~= "status" and self.conf.action ~= "editconfigfile" and self.conf.action ~= "putcacert" and self.conf.action ~= "generatecacert") then
+ or (sslstatus.value.environment.errtxt and self.conf.action ~= "status" and self.conf.action ~= "editconfigfile" and self.conf.action ~= "checkenvironment")
+ or ((sslstatus.value.cacert.errtxt or sslstatus.value.cakey.errtxt) and self.conf.action ~= "status" and self.conf.action ~= "editconfigfile" and self.conf.action ~= "putcacert" and self.conf.action ~= "generatecacert" and self.conf.action ~= "checkenvironment")
+ then
redirect(self)
end
end
@@ -138,6 +140,20 @@ deletecert = function(self)
redirect_to_referrer(self)
end
+-- Submit request to renew the specified certificate
+requestrenewcert = function(self)
+ local cmdresult = self.model.renewcert(self.clientdata.cert)
+ self.sessiondata.cmdresult = cmdresult
+ redirect_to_referrer(self)
+end
+
+-- Renew the specified certificate
+renewcert = function(self)
+ local cmdresult = self.model.renewcert(self.clientdata.cert, true)
+ self.sessiondata.cmdresult = cmdresult
+ redirect_to_referrer(self)
+end
+
-- Get the revoked list
getrevoked = function(self)
self.conf.viewtype="stream"
@@ -195,3 +211,12 @@ editconfigfile = function(self)
end
return configfile
end
+
+checkenvironment = function(self)
+ local form = cfe({ type="form", value={}, label="Check Environment", option="Configure" })
+ form.value.status = self.model.checkenvironment(self.clientdata.Configure)
+ if self.clientdata.Configure and not form.value.status.errtxt then
+ redirect_to_referrer(self)
+ end
+ return form
+end