diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | app/Makefile | 14 | ||||
-rw-r--r-- | app/acf-util/logon-html.lsp | 27 | ||||
-rw-r--r-- | app/acf-util/logon-model.lua | 6 | ||||
-rw-r--r-- | lib/Makefile | 1 |
5 files changed, 31 insertions, 19 deletions
@@ -1,6 +1,6 @@ APP_NAME=core PACKAGE=acf-$(APP_NAME) -VERSION=0.1 +VERSION=0.2 P=$(PACKAGE)-$(VERSION) DISTDIR:=$(shell pwd)/$(P) diff --git a/app/Makefile b/app/Makefile index da17d7f..af2b898 100644 --- a/app/Makefile +++ b/app/Makefile @@ -1,10 +1,14 @@ include ../config.mk -APP_DIST= acf-util/logon-controller.lua\ - acf-util/logon-html.lsp\ - acf-util/logon-status-html.lsp\ - acf-util/logon-logout-html.lsp\ - acf-util/logon-model.lua\ +APP_DIST= \ + acf-util/logon-controller.lua \ + acf-util/logon-html.lsp \ + acf-util/logon-model.lua \ + acf-util/logon-status-html.lsp \ + acf-util/roles-controller.lua \ + acf-util/roles-getlist-html.lsp \ + acf-util/roles-model.lua \ + acf-util/roles-read-html.lsp \ acf_www-controller.lua\ cfgfile-model.lua\ service-model.lua\ diff --git a/app/acf-util/logon-html.lsp b/app/acf-util/logon-html.lsp index a1d3f33..9a930a2 100644 --- a/app/acf-util/logon-html.lsp +++ b/app/acf-util/logon-html.lsp @@ -1,17 +1,24 @@ <? local form = ... ?> <h1>Logon</h1> +<? --[[ ?> <?= html.cfe_unpack(form) ?> +<? --]] ?> <form action="<?= form.logon.option.script .. form.logon.option.prefix .. form.logon.option.controller .. "/" .. form.logon.option.action ?>" method="POST"> -<? local myform = form.logon.value - for k,v in pairs(myform) do ?> - <DT><?= v.name ?></DT> - <? if v.type == "submit" then ?> - <DD><input class="submit" type="submit" name="<?= v.name ?>" value="Logon"></DD> - <? else ?> - <DD><input class="text" type="text" name="<?= v.name ?>"> - <font color=red><?= v.errtxt ?></font></DD> - <? end ?> -<? end ?> +<DL> +<? +local myform = form.logon.value +for k,v in pairs(myform) do + io.write("\t<DT") + if (#v.errtxt > 0) then io.write(" class='error'") end + io.write(">" .. v.label .. "</DT>\n") + + io.write("\t\t<DD>" .. html.form[v.type](v) .. "\n") + if (v.descr) and (#v.descr > 0) then io.write("\t\t<P CLASS='descr'>" .. string.gsub(v.descr, "\n", "<BR>") .. "</P>\n") end + if (#v.errtxt > 0) then io.write("\t\t<P CLASS='error'>" .. string.gsub(v.errtxt, "\n", "<BR>") .. "</P>\n") end + io.write("\t\t</DD>\n") +end +?> +</DL> </form> diff --git a/app/acf-util/logon-model.lua b/app/acf-util/logon-model.lua index 3f5a149..f6beb59 100644 --- a/app/acf-util/logon-model.lua +++ b/app/acf-util/logon-model.lua @@ -20,9 +20,9 @@ else end logon = function (self, id_user, password_user,sessdata ) -local userid=cfe({ name="userid",type="text" }) -local password=cfe({ name="password" ,type="password"}) -local logon=cfe({ name="Logon", type="submit"}) +local userid=cfe({ name="userid",label="User id", type="text" }) +local password=cfe({ name="password" ,label="Password", type="passwd"}) +local logon=cfe({ name="Logon", label="Logon", value="Logon", type="submit"}) local s = "" local csess = session.check_session(conf.sessiondir, sessdata) diff --git a/lib/Makefile b/lib/Makefile index efadb90..13242c0 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -16,6 +16,7 @@ LIB_DIST=fs.lua\ authenticator-plaintext.lua\ daemoncontrol.lua\ getopts.lua\ + roles.lua\ EXTRA_DIST=README Makefile |