summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach LeBar <zach@zachlebar.com>2012-04-03 15:53:28 +0000
committerZach LeBar <zach@zachlebar.com>2012-04-03 15:53:28 +0000
commit74cd43acdab91246edf4acaf5f646eed2063f39e (patch)
treed9770ea58ec57b03bfb21ba6e672dae49d995e0a
parent445ef74cdd43627330172f33b01a00f5681e7d9c (diff)
downloadacf-clamav-master.tar.bz2
acf-clamav-master.tar.xz
Fixing acf-clamav to work with changes made to acf-core.HEADmaster
Removing the use of controllerfunctions.lua and using the new 'handle_form()' found in acf_www-controller.lua. Also using 'handle_form()' in place of 'redirect_to_referrer()'.
-rw-r--r--clamav-controller.lua7
-rw-r--r--clamav-model.lua12
2 files changed, 10 insertions, 9 deletions
diff --git a/clamav-controller.lua b/clamav-controller.lua
index f664b57..dcce6e5 100644
--- a/clamav-controller.lua
+++ b/clamav-controller.lua
@@ -1,8 +1,5 @@
module(..., package.seeall)
--- Load libraries
-require("controllerfunctions")
-
default_action = "status"
function status(self)
@@ -10,7 +7,7 @@ function status(self)
end
function startstop(self)
- return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata)
+ return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata)
end
function details(self)
@@ -22,7 +19,7 @@ function listfiles(self)
end
function expert(self)
- return controllerfunctions.handle_form(self, function() return self.model.getfiledetails(self.clientdata.filename) end, self.model.updatefiledetails, self.clientdata, "Save", "Edit ClamAV File", "File Saved")
+ return self.handle_form(self, self.model.getfiledetails, self.model.updatefiledetails, self.clientdata, "Save", "Edit ClamAV File", "File Saved")
end
function logfile(self)
diff --git a/clamav-model.lua b/clamav-model.lua
index 6735e1b..20d1885 100644
--- a/clamav-model.lua
+++ b/clamav-model.lua
@@ -18,8 +18,12 @@ local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
-- ################################################################################
-- PUBLIC FUNCTIONS
-function startstop_service(action)
- return modelfunctions.startstop_service(processname, action)
+function get_startstop(clientdata)
+ return modelfunctions.get_startstop(processname)
+end
+
+function startstop_service(startstop, action)
+ return modelfunctions.startstop_service(startstop, action)
end
function getstatus()
@@ -43,8 +47,8 @@ function getfilelist()
return cfe({ type="list", value=listed_files, label="ClamAV File List" })
end
-function getfiledetails(filename)
- return modelfunctions.getfiledetails(filename, filelist)
+function getfiledetails(clientdata)
+ return modelfunctions.getfiledetails(clientdata.filename, filelist)
end
function updatefiledetails(filedetails)