From 69850bd218d84b0826eff070efa4859ff7d19d38 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 30 Apr 2008 20:36:02 +0000 Subject: Modified cfe, removing option, errtxt, and name, and adding label - This may break things. Rewrote password module, adding model Modified authenticator to make password module work git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@1052 ab2d0c66-481e-0410-8bed-d214d4d58bed --- shorewall-controller.lua | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'shorewall-controller.lua') diff --git a/shorewall-controller.lua b/shorewall-controller.lua index 0dd7336..4b0eba0 100644 --- a/shorewall-controller.lua +++ b/shorewall-controller.lua @@ -32,8 +32,6 @@ local function displaycmdmanagement(pidofstatus) -- next CFE can be used to present the result of the previous action management.actionresult = cfe({ name="actionresult", label="Previous action result", - descr="", --Content of this variable is displayed as
 ... 
in BLACK text - errtxt="", --Content of this variable is displayed as
 ... 
in RED text }) return management @@ -100,7 +98,7 @@ function editrecords(self,types,record,errormessage) -- Display save button local cmdsave = displaycmdsave() - cmdsave.errtxt=errormessage or "" + cmdsave.errtxt = errormessage -- Display delete button cmddelete = cfe({ name="cmddelete", @@ -140,12 +138,12 @@ function editrecords(self,types,record,errormessage) for k,v in pairs(edit[fieldnum]["option"]) do edit[fieldnum]["errtxt"] = "'" .. edit[fieldnum]["value"] .. "' is not a valid option!" if (tostring(v) == tostring(edit[fieldnum]["value"])) then - edit[fieldnum]["errtxt"] = "" + edit[fieldnum]["errtxt"] = nil break end end -- Now add this option to the list (just to show what it was) - if (#edit[fieldnum]["errtxt"] > 0) then + if (edit[fieldnum]["errtxt"]) then table.insert(edit[fieldnum]["option"], edit[fieldnum]["value"]) end @@ -203,12 +201,12 @@ function editrecords(self,types,record,errormessage) for k,v in pairs(edit[fieldnum]["option"]) do edit[fieldnum]["errtxt"] = "'" .. edit[fieldnum]["value"] .. "' is not a valid option!" if (tostring(v) == tostring(edit[fieldnum]["value"])) then - edit[fieldnum]["errtxt"] = "" + edit[fieldnum]["errtxt"] = nil break end end -- Now add this option to the list (just to show what it was) - if (#edit[fieldnum]["errtxt"] > 0) then + if (edit[fieldnum]["errtxt"]) then table.insert(edit[fieldnum]["option"], edit[fieldnum]["value"]) end @@ -258,12 +256,12 @@ function editrecords(self,types,record,errormessage) for k,v in pairs(edit[fieldnum]["option"]) do edit[fieldnum]["errtxt"] = "'" .. edit[fieldnum]["value"] .. "' is not a valid option!" if (tostring(v) == tostring(edit[fieldnum]["value"])) then - edit[fieldnum]["errtxt"] = "" + edit[fieldnum]["errtxt"] = nil break end end -- Now add this option to the list (just to show what it was) - if (#edit[fieldnum]["errtxt"] > 0) then + if (edit[fieldnum]["errtxt"]) then table.insert(edit[fieldnum]["option"], edit[fieldnum]["value"]) end @@ -287,12 +285,12 @@ function editrecords(self,types,record,errormessage) for k,v in pairs(edit[fieldnum]["option"]) do edit[fieldnum]["errtxt"] = "'" .. edit[fieldnum]["value"] .. "' is not a valid option!" if (tostring(v) == tostring(edit[fieldnum]["value"])) then - edit[fieldnum]["errtxt"] = "" + edit[fieldnum]["errtxt"] = nil break end end -- Now add this option to the list (just to show what it was) - if (#edit[fieldnum]["errtxt"] > 0) then + if (edit[fieldnum]["errtxt"]) then table.insert(edit[fieldnum]["option"], edit[fieldnum]["value"]) end @@ -314,12 +312,12 @@ function editrecords(self,types,record,errormessage) for k,v in pairs(edit[fieldnum]["option"]) do edit[fieldnum]["errtxt"] = "'" .. edit[fieldnum]["value"] .. "' is not a valid option!" if (tostring(v) == tostring(edit[fieldnum]["value"])) then - edit[fieldnum]["errtxt"] = "" + edit[fieldnum]["errtxt"] = nil break end end -- Now add this option to the list (just to show what it was) - if (#edit[fieldnum]["errtxt"] > 0) then + if (edit[fieldnum]["errtxt"]) then table.insert(edit[fieldnum]["option"], edit[fieldnum]["value"]) end @@ -370,12 +368,12 @@ function editrecords(self,types,record,errormessage) for k,v in pairs(edit[fieldnum]["option"]) do edit[fieldnum]["errtxt"] = "Attention! '" .. edit[fieldnum]["value"] .. "' could be a invalid option (or is a action defined in 'actions')." if (tostring(v) == tostring(edit[fieldnum]["value"])) then - edit[fieldnum]["errtxt"] = "" + edit[fieldnum]["errtxt"] = nil break end end -- Now add this option to the list (just to show what it was) - if (#edit[fieldnum]["errtxt"] > 0) then + if (edit[fieldnum]["errtxt"]) then table.insert(edit[fieldnum]["option"], edit[fieldnum]["value"]) end @@ -506,7 +504,7 @@ function config(self) - if not ((configmessage) and (#configmessage.errtxt > 0)) then + if not ((configmessage) and (configmessage.errtxt)) then --Actually change the values savesuccess, configmessage = self.model:modify_config(modify_actiontype, self.clientdata.filename, -- cgit v1.2.3