diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/README | 2 | ||||
-rw-r--r-- | app/acf-util/password-listlockevents-html.lsp | 8 | ||||
-rw-r--r-- | app/acf-util/password-model.lua | 14 | ||||
-rw-r--r-- | app/acf-util/roles-model.lua | 6 | ||||
-rw-r--r-- | app/acf-util/roles-read-html.lsp | 2 | ||||
-rw-r--r-- | app/acf_cli-controller.lua | 2 | ||||
-rw-r--r-- | app/acf_www-controller.lua | 46 | ||||
-rw-r--r-- | app/dispatcherror-html.lsp | 2 | ||||
-rw-r--r-- | app/exception-html.lsp | 2 | ||||
-rw-r--r-- | app/status-html.lsp | 2 | ||||
-rw-r--r-- | app/template-html.lsp | 14 |
11 files changed, 50 insertions, 50 deletions
@@ -16,7 +16,7 @@ Create a Makefile that describes the the following: * what files should be installed on the running system - * what additional files should be included in the distribution package + * what additional files should be included in the distribution package (tar.gz source package). The Makefile and acf-pkg.mk wil automatically be added so only extra files like README and ChangeLog needs to be specified here. diff --git a/app/acf-util/password-listlockevents-html.lsp b/app/acf-util/password-listlockevents-html.lsp index bb81846..aff2aba 100644 --- a/app/acf-util/password-listlockevents-html.lsp +++ b/app/acf-util/password-listlockevents-html.lsp @@ -1,4 +1,4 @@ -<% local view, viewlibrary, page_info, session = ... +<% local view, viewlibrary, page_info, session = ... htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> @@ -8,7 +8,7 @@ html = require("acf.html") document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); } </script> - + <script type="text/javascript"> if (typeof $.tablesorter == 'undefined') { document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>'); @@ -36,7 +36,7 @@ html = require("acf.html") <th>User ID</th> <th>IP Address</th> <th>Time</th> - </tr> + </tr> </thead><tbody> <% for i,lock in ipairs( view.value ) do %> <tr> @@ -48,7 +48,7 @@ html = require("acf.html") </tbody></table> <% htmlviewfunctions.displaysectionend(header_level) %> -<% if viewlibrary and viewlibrary.dispatch_component then +<% if viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("unlockuser") viewlibrary.dispatch_component("unlockip") end %> diff --git a/app/acf-util/password-model.lua b/app/acf-util/password-model.lua index 72ae416..6644841 100644 --- a/app/acf-util/password-model.lua +++ b/app/acf-util/password-model.lua @@ -10,10 +10,10 @@ local weak_password = function(password) -- If password is too short, return false if (#password < 4) then return true, "Password is too short!" - end + end if (tonumber(password)) then return true, "Password can't contain only numbers!" - end + end return false, nil end @@ -49,7 +49,7 @@ end local function get_blank_user(self) local result = cfe({ type="group", value={}, label="User Account" }) - + if not avail_roles then avail_roles = roles.list_all_roles(self) for x,role in ipairs(avail_roles) do @@ -59,7 +59,7 @@ local function get_blank_user(self) end end end - + -- Call into skins controller to get the list of skins if not avail_skins then avail_skins = {""} @@ -123,7 +123,7 @@ end function mymodule.update_user(self, settings, submit, create) local success, settings = validate_settings(settings, create) - + if success then local userinfo = authenticator.get_userinfo(self, settings.value.userid.value) if userinfo and create then @@ -182,7 +182,7 @@ end function mymodule.read_user_without_roles(self, clientdata) local result = mymodule.read_user(self, clientdata) - + -- We don't allow a user to modify his own roles -- Since they can't modify roles, we should restrict the available options for home result.value.home.option = {""} @@ -203,7 +203,7 @@ function mymodule.get_users(self) local users = {} local userlist = authenticator.list_users(self) table.sort(userlist) - + for x,user in pairs(userlist) do users[#users+1] = get_user(self, user) end diff --git a/app/acf-util/roles-model.lua b/app/acf-util/roles-model.lua index 8b51503..0e49b4e 100644 --- a/app/acf-util/roles-model.lua +++ b/app/acf-util/roles-model.lua @@ -17,7 +17,7 @@ end mymodule.get_role_perms = function(self, role) return cfe({ type="structure", value=roles.get_role_perm(self, role), label="Permissions" }) end - + -- Return list of all permissions mymodule.get_perms_list = function(self) return cfe({ type="structure", value=roles.get_all_permissions(self), label="All Permissions" }) @@ -37,7 +37,7 @@ mymodule.getpermissions = function(self, clientdata) local tmp, all_perms = roles.get_all_permissions(self) table.sort(all_perms) local my_perms = {} - local default_perms = {} + local default_perms = {} if clientdata.role then role_cfe.readonly = true @@ -62,7 +62,7 @@ mymodule.getpermissions = function(self, clientdata) all_perms = newall end end - + local permissions_cfe = cfe({ type="multi", value=my_perms, option=all_perms, label="Role permissions", seq=2 }) return cfe({ type="structure", value={role=role_cfe, permissions=permissions_cfe} }) diff --git a/app/acf-util/roles-read-html.lsp b/app/acf-util/roles-read-html.lsp index 87772b7..79700cf 100644 --- a/app/acf-util/roles-read-html.lsp +++ b/app/acf-util/roles-read-html.lsp @@ -72,7 +72,7 @@ end %> end %> </tbody></table> -<% +<% if view.value.userid or view.value.role then htmlviewfunctions.displaysectionend(header_level2) end diff --git a/app/acf_cli-controller.lua b/app/acf_cli-controller.lua index 14badd9..c871455 100644 --- a/app/acf_cli-controller.lua +++ b/app/acf_cli-controller.lua @@ -43,7 +43,7 @@ mymodule.handle_clientdata = function(form, clientdata, group) value.value = (clientdata[name] == "true") elseif value.type == "multi" or value.type == "list" then -- for cli we use name[num] as the name - local temp = {} + local temp = {} for n,val in pairs(clientdata) do if string.find(n, "^"..name.."%[%d+%]$") then temp[tonumber(string.match(n, "%[(%d+)%]$"))] = val diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua index 61dac76..3c53d77 100644 --- a/app/acf_www-controller.lua +++ b/app/acf_www-controller.lua @@ -1,4 +1,4 @@ ---[[ Code for the Alpine Configuration WEB framework +--[[ Code for the Alpine Configuration WEB framework see http://wiki.alpinelinux.org Copyright (C) 2007 Nathan Angelacos Licensed under the terms of GPL2 @@ -27,7 +27,7 @@ local function build_menus(self) end local permissions = roll.get_roles_perm(self,roles) self.sessiondata.permissions = permissions - + --Build the menu local cats = m.get_menuitems(self) -- now, loop through menu and remove actions without permission @@ -71,7 +71,7 @@ local check_permission_string = function (self, str) local prefix, controller, action = self.parse_redir_string(str) if prefix == "/" then prefix = self.conf.prefix end if controller == "" then controller = self.conf.controller end - + if "" == action then action = rawget(self.worker, "default_action") or "" end @@ -89,12 +89,12 @@ find_template = function ( appdir, prefix, controller, action, viewtype ) if template then break end end return template - end + end local targets = { - appdir .. prefix .. "template-" .. controller .. "-" .. + appdir .. prefix .. "template-" .. controller .. "-" .. action .. "-" .. viewtype .. ".lsp", - appdir .. prefix .. "template-" .. controller .. "-" .. + appdir .. prefix .. "template-" .. controller .. "-" .. viewtype .. ".lsp", appdir .. prefix .. "template-" .. action .. "-" .. viewtype .. ".lsp", @@ -112,7 +112,7 @@ find_template = function ( appdir, prefix, controller, action, viewtype ) if prefix == "/" then -- already at the top level - fail return nil end - prefix = posix.dirname (prefix) + prefix = posix.dirname (prefix) return find_template ( appdir, prefix, controller, action, viewtype ) end @@ -258,7 +258,7 @@ mymodule.mvc.on_load = function (self, parent) parent_exception_handler = parent.exception_handler parent_create_helper_library = parent.create_helper_library parent_view_resolver = parent.view_resolver - + sessionlib=require ("session") -- before we look at sessions, remove old sessions and events @@ -272,10 +272,10 @@ mymodule.mvc.on_load = function (self, parent) --self.logevent("Found session id = " .. self.clientdata.sessionid) -- Load existing session data local timestamp - timestamp, self.sessiondata = + timestamp, self.sessiondata = sessionlib.load_session(self.conf.sessiondir, self.clientdata.sessionid) - if timestamp == nil then + if timestamp == nil then -- invalid session id, report event and create new one sessionlib.record_event(self.conf.sessiondir, nil, self.conf.clientip) --self.logevent("Didn't find session") @@ -348,7 +348,7 @@ mymodule.exception_handler = function (self, message ) if message.type == "redir" then io.write ("Location: " .. ENV["SCRIPT_NAME"] .. message.prefix .. message.controller .. - "/" .. message.action .. + "/" .. message.action .. (message.extra or "" ) .. "\n") elseif message.type == "dispatch" then -- We got a dispatch error because the user session timed out @@ -384,10 +384,10 @@ mymodule.exception_handler = function (self, message ) if viewtable then if not self.conf.suppress_view then - local success, err = xpcall ( function () + local success, err = xpcall ( function () local viewfunc, p1, p2, p3 = self.view_resolver(self) viewfunc (viewtable, p1, p2, p3) - end, + end, self:soft_traceback() ) @@ -402,11 +402,11 @@ end -- check permissions and redirect if not allowed to see -- pass more parameters to the view -- allow display of views without actions -mymodule.dispatch = function (self, userprefix, userctlr, useraction) +mymodule.dispatch = function (self, userprefix, userctlr, useraction) local controller = nil local viewtable local starttime = os.time() - local success, err = xpcall ( function () + local success, err = xpcall ( function () if userprefix == nil then self.conf.prefix, self.conf.controller, self.conf.action = @@ -470,7 +470,7 @@ mymodule.dispatch = function (self, userprefix, userctlr, useraction) if self.conf.action == "" then self.conf.action = default_action end if "" ~= self.conf.action then local perm = check_permission(controller, self.conf.prefix, self.conf.controller, self.conf.action) - -- Because of the inheritance, normally the + -- Because of the inheritance, normally the -- controller.worker.action will flow up, so that all children have -- actions of all parents. We use rawget to make sure that only -- controller defined actions are used on dispatch @@ -497,7 +497,7 @@ mymodule.dispatch = function (self, userprefix, userctlr, useraction) end if controller then - -- run the (first found) pre_exec code, starting at the controller + -- run the (first found) pre_exec code, starting at the controller -- and moving up the parents if type(controller.worker.mvc.pre_exec) == "function" then controller.worker.mvc.pre_exec ( controller ) @@ -520,13 +520,13 @@ mymodule.dispatch = function (self, userprefix, userctlr, useraction) local viewfunc, p1, p2, p3 = self.view_resolver(self) viewfunc (viewtable, p1, p2, p3) end - - end, + + end, self:soft_traceback(message) ) if not success then - if controller then + if controller then controller:exception_handler(err) controller:destroy() controller = nil @@ -553,7 +553,7 @@ mymodule.redirect = function (self, str, result) local prefix, controller, action = self.parse_redir_string(str) if prefix ~= "/" then self.conf.prefix = prefix end if controller ~= "" then self.conf.controller = controller end - + if "" == action then action = rawget(self.worker, "default_action") or "" end @@ -566,7 +566,7 @@ end -- this is the same as URI string, but opposite preference -- if only one is defined, it's assumed to be the action mymodule.parse_redir_string = function( str ) - str = str or "" + str = str or "" str = string.gsub(str, "/+$", "") local action = string.match(str, "[^/]+$") or "" str = string.gsub(str, "/*[^/]*$", "") @@ -672,7 +672,7 @@ mymodule.handle_form = function(self, getFunction, setFunction, clientdata, opti if not form.errtxt and descr then form.descr = descr end - + if clientdata.redir then form.value.redir = cfe({ type="hidden", value=clientdata.redir, label="" }) end diff --git a/app/dispatcherror-html.lsp b/app/dispatcherror-html.lsp index 208a467..d38b7df 100644 --- a/app/dispatcherror-html.lsp +++ b/app/dispatcherror-html.lsp @@ -17,7 +17,7 @@ document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); } </script> - + <script type="text/javascript"> var clickIt = function(){ $("p.hiddendetail").removeClass("hiddendetail").show("slow"); diff --git a/app/exception-html.lsp b/app/exception-html.lsp index 5a00ed1..91b7c12 100644 --- a/app/exception-html.lsp +++ b/app/exception-html.lsp @@ -17,7 +17,7 @@ document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); } </script> - + <script type="text/javascript"> var clickIt = function(){ $("p.hiddendetail").removeClass("hiddendetail").show("slow"); diff --git a/app/status-html.lsp b/app/status-html.lsp index 8c764b3..4ff6530 100644 --- a/app/status-html.lsp +++ b/app/status-html.lsp @@ -1,4 +1,4 @@ -<% local data, viewlibrary, page_info, session = ... +<% local data, viewlibrary, page_info, session = ... htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> diff --git a/app/template-html.lsp b/app/template-html.lsp index e784d08..7b75007 100644 --- a/app/template-html.lsp +++ b/app/template-html.lsp @@ -1,12 +1,12 @@ -<% local viewtable, viewlibrary, pageinfo, session = ... +<% local viewtable, viewlibrary, pageinfo, session = ... html=require("acf.html") posix=require("posix") %> Status: 200 OK Content-Type: text/html <% -if (session.id) then - io.write( html.cookie.set("sessionid", session.id) ) +if (session.id) then + io.write( html.cookie.set("sessionid", session.id) ) else io.write (html.cookie.unset("sessionid")) end @@ -64,21 +64,21 @@ end <p class="links"> <% local ctlr = pageinfo.script .. "/acf-util/logon/" - + if session.userinfo and session.userinfo.userid then print("<a href=\""..html.html_escape(ctlr).."logoff\">Log off as '" .. html.html_escape(session.userinfo.userid) .. "'</a> |") else print("<a href=\""..html.html_escape(ctlr).."logon\">Log on</a> |" ) end %> - <a href="<%= html.html_escape(pageinfo.wwwprefix) %>/">home</a> | + <a href="<%= html.html_escape(pageinfo.wwwprefix) %>/">home</a> | <a href="http://www.alpinelinux.org">about</a> </p> </div> <!-- header --> <div id="main"> <div id="nav"> - <% + <% local class local tabs if (#session.menu.cats > 0) then @@ -136,6 +136,6 @@ end </div> <!-- page --> <% end --pageinfo.skinned %> - + </body> </html> |