diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-07-30 13:14:26 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-07-30 13:14:26 +0000 |
commit | 997aaa44ef4d26aeca2bee1e71109529f4ce1ba2 (patch) | |
tree | abe92fa565e16e1c9aa22832dc0610655dba66ab | |
parent | af811bf45cee7890b641e3e54a7662a81fc87f45 (diff) | |
download | acf-heimdal-997aaa44ef4d26aeca2bee1e71109529f4ce1ba2.tar.bz2 acf-heimdal-997aaa44ef4d26aeca2bee1e71109529f4ce1ba2.tar.xz |
Removed redirect_to_referrer
-rw-r--r-- | heimdal-controller.lua | 3 | ||||
-rw-r--r-- | heimdal-klist-html.lsp | 9 | ||||
-rw-r--r-- | heimdal-model.lua | 12 |
3 files changed, 12 insertions, 12 deletions
diff --git a/heimdal-controller.lua b/heimdal-controller.lua index e80eded..73756d4 100644 --- a/heimdal-controller.lua +++ b/heimdal-controller.lua @@ -19,6 +19,5 @@ function kinit(self) end function kdestroy(self) - return self:redirect_to_referrer(self.model.kdestroy()) + return self.handle_form(self, self.model.get_kdestroy, self.model.kdestroy, self.clientdata, "Destroy", "Destroy Tickets") end - diff --git a/heimdal-klist-html.lsp b/heimdal-klist-html.lsp index d098a0b..910ec61 100644 --- a/heimdal-klist-html.lsp +++ b/heimdal-klist-html.lsp @@ -10,12 +10,9 @@ <%= html.html_escape(data.value) %> </pre> -<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("kdestroy") then %> -<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/kdestroy") %>"> -<DT>Destroy Tickets</DT> -<DD><input class="submit" type="submit" value="Destroy"></DD> -</form> -<% end %> +<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("kdestroy") then + viewlibrary.dispatch_component("kdestroy") +end %> </DL> diff --git a/heimdal-model.lua b/heimdal-model.lua index 7458c92..abf3745 100644 --- a/heimdal-model.lua +++ b/heimdal-model.lua @@ -68,11 +68,15 @@ function klist() return cfe({ value=result, label="List of Kerberos Tickets" }) end -function kdestroy() +function get_kdestroy() + return cfe({ type="group", value={}, label="Destroy Tickets" }) +end + +function kdestroy(self, kd) local cmd = path.."kdestroy" local f = io.popen(cmd) - local result = f:read("*a") or "" + kd.descr = f:read("*a") or "" f:close() - if result == "" then result = "Success" end - return cfe({ value=result, label="Result of kdestroy" }) + if kd.descr == "" then kd.descr = "Successfully Destroyed Tickets" end + return kd end |