From de2694e907a97dfb6a017509d2589c186dc56e72 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/alpine-baselayout/trunk@1052 ab2d0c66-481e-0410-8bed-d214d4d58bed --- interfaces-model.lua | 2 +- syslog-config-html.lsp | 8 ++++---- syslog-controller.lua | 4 ++-- syslog-expert-html.lsp | 8 ++++---- syslog-model.lua | 2 +- syslog-status-html.lsp | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/interfaces-model.lua b/interfaces-model.lua index efc5ed9..57949a3 100644 --- a/interfaces-model.lua +++ b/interfaces-model.lua @@ -271,7 +271,7 @@ iface.validate = function ( def ) -- local rc = true for k,v in pairs(def) do - if #def[k].errtxt > 0 then result = false end + if def[k].errtxt then result = false end end return result, def diff --git a/syslog-config-html.lsp b/syslog-config-html.lsp index 7dbb76b..ff068e1 100644 --- a/syslog-config-html.lsp +++ b/syslog-config-html.lsp @@ -14,12 +14,12 @@ function informationform(myform,tags) if (myform[v]) then local val = myform[v] io.write("\t 0) then io.write(" class='error'") end + if (val.errtxt) then io.write(" class='error'") end io.write(">" .. val.label .. "\n") io.write("\t\t
" .. val.value .. "\n") if (val.descr) and (#val.descr > 0) then io.write("\t\t

" .. string.gsub(val.descr, "\n", "
") .. "

\n") end - if (#val.errtxt > 0) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end + if (val.errtxt) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end io.write("\t\t
\n") end end @@ -33,12 +33,12 @@ function configform(myform,tags) if (myform[v]) then local val = myform[v] io.write("\t 0) then io.write(" class='error'") end + if (val.errtxt) then io.write(" class='error'") end io.write(">" .. val.label .. "\n") io.write("\t\t
" .. html.form[val.type](val) .. "\n") if (val.descr) and (#val.descr > 0) then io.write("\t\t

" .. string.gsub(val.descr, "\n", "
") .. "

\n") end - if (#val.errtxt > 0) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end + if (val.errtxt) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end io.write("\t\t
\n") end end diff --git a/syslog-controller.lua b/syslog-controller.lua index f0fb343..b592672 100644 --- a/syslog-controller.lua +++ b/syslog-controller.lua @@ -100,7 +100,7 @@ function config(self) end -- Disable management buttons if there exist errors in the config for k,v in pairs(config) do - if (config[k]["errtxt"] ~= "") then + if (config[k]["errtxt"]) then disablestart = "yes" disablestop = "yes" disablerestart = "yes" @@ -160,7 +160,7 @@ function expert(self) end -- Disable management buttons if there exist errors in the config for k,v in pairs(config) do - if (config[k]["errtxt"] ~= "") then + if (config[k]["errtxt"]) then disablestart = "yes" disablestop = "yes" disablerestart = "yes" diff --git a/syslog-expert-html.lsp b/syslog-expert-html.lsp index 0a36abb..2b1f238 100644 --- a/syslog-expert-html.lsp +++ b/syslog-expert-html.lsp @@ -13,12 +13,12 @@ function informationform(myform,tags) if (myform[v]) then local val = myform[v] io.write("\t 0) then io.write(" class='error'") end + if (val.errtxt) then io.write(" class='error'") end io.write(">" .. val.label .. "\n") io.write("\t\t
" .. val.value .. "\n") if (val.descr) and (#val.descr > 0) then io.write("\t\t

" .. string.gsub(val.descr, "\n", "
") .. "

\n") end - if (#val.errtxt > 0) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end + if (val.errtxt) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end io.write("\t\t
\n") end end @@ -32,12 +32,12 @@ function configform(myform,tags) if (myform[v]) then local val = myform[v] io.write("\t 0) then io.write(" class='error'") end + if (val.errtxt) then io.write(" class='error'") end io.write(">" .. val.label .. "\n") io.write("\t\t
" .. html.form[val.type](val) .. "\n") if (val.descr) and (#val.descr > 0) then io.write("\t\t

" .. string.gsub(val.descr, "\n", "
") .. "

\n") end - if (#val.errtxt > 0) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end + if (val.errtxt) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end io.write("\t\t
\n") end end diff --git a/syslog-model.lua b/syslog-model.lua index 262bb17..0709883 100644 --- a/syslog-model.lua +++ b/syslog-model.lua @@ -171,7 +171,7 @@ function getconfig() -- Sum all errors into one cfe local sumerrors = "" for k,v in pairs(config) do - if (config[k]["errtxt"] ~= "") then + if (config[k]["errtxt"]) then sumerrors = sumerrors .. config[k]["errtxt"] .. "\n" end end diff --git a/syslog-status-html.lsp b/syslog-status-html.lsp index 50889f8..5b5a8f7 100644 --- a/syslog-status-html.lsp +++ b/syslog-status-html.lsp @@ -13,12 +13,12 @@ function informationform(myform,tags) if (myform[v]) then local val = myform[v] io.write("\t 0) then io.write(" class='error'") end + if (val.errtxt) then io.write(" class='error'") end io.write(">" .. val.label .. "\n") io.write("\t\t
" .. val.value .. "\n") if (val.descr) and (#val.descr > 0) then io.write("\t\t

" .. string.gsub(val.descr, "\n", "
") .. "

\n") end - if (#val.errtxt > 0) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end + if (val.errtxt) then io.write("\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

\n") end io.write("\t\t
\n") end end -- cgit v1.2.3