summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rwxr-xr-xapp/acf-util/password-controller.lua2
-rwxr-xr-xapp/acf-util/password-status-html.lsp11
-rw-r--r--app/acf-util/roles-controller.lua4
-rw-r--r--app/acf-util/roles-viewroles-html.lsp5
-rw-r--r--app/acf_www-controller.lua9
-rw-r--r--app/filedetails-html.lsp9
-rw-r--r--app/status-html.lsp4
7 files changed, 26 insertions, 18 deletions
diff --git a/app/acf-util/password-controller.lua b/app/acf-util/password-controller.lua
index bea4480..b2fab85 100755
--- a/app/acf-util/password-controller.lua
+++ b/app/acf-util/password-controller.lua
@@ -60,7 +60,7 @@ function newuser(self)
return self.model.read_user(self)
end, function(value)
return self.model.create_user(self, value)
- end, self.clientdata, "Save", "New User Settings", "Saved user", "status")
+ end, self.clientdata, "Save", "New User Settings", "Saved user")
end
function deleteuser(self)
diff --git a/app/acf-util/password-status-html.lsp b/app/acf-util/password-status-html.lsp
index 26416ce..d7db4e9 100755
--- a/app/acf-util/password-status-html.lsp
+++ b/app/acf-util/password-status-html.lsp
@@ -1,4 +1,4 @@
-<% local form, viewlibrary, pageinfo, session = ... %>
+<% local form, viewlibrary, page_info, session = ... %>
<% require("viewfunctions") %>
<%
--[[ DEBUG INFORMATION
@@ -8,11 +8,12 @@ io.write("</span>")
--]]
%>
-<% displaycommandresults({"deleteuser"}, session) %>
+<% displaycommandresults({"newuser", "edituser", "deleteuser"}, session) %>
<H1>User Accounts</H1>
<H2>Create new account</H2>
-<form action="newuser" method="POST">
+<form action="<%= page_info.script .. page_info.prefix .. page_info.controller %>/newuser" method="POST">
+<input class="hidden" type="hidden" name="redir" value="<%= page_info.orig_action %>" >
<dl><dt></dt><dd><input class="submit" type="submit" value="New User"></dd></dl>
</form>
<H2>Existing account</H2>
@@ -32,9 +33,9 @@ io.write("</span>")
</TR><TR>
<TD STYLE='border:none;'><B>Option</B></TD>
<TD STYLE='border:none;'>
- [<A HREF='edituser?userid=<%= name %>'>Edit this account</A>]
+ [<A HREF='edituser?userid=<%= name %>&redir=<%= page_info.orig_action %>'>Edit this account</A>]
[<A HREF='deleteuser?userid=<%= name %>'>Delete this account</A>]
- [<A HREF='<%= pageinfo.script %>/acf-util/roles/viewuserroles?userid=<%= name %>'>View roles for this account</A>]
+ [<A HREF='<%= page_info.script %>/acf-util/roles/viewuserroles?userid=<%= name %>'>View roles for this account</A>]
</TD>
</TR>
</TABLE></DD>
diff --git a/app/acf-util/roles-controller.lua b/app/acf-util/roles-controller.lua
index 91d4d9c..738f54f 100644
--- a/app/acf-util/roles-controller.lua
+++ b/app/acf-util/roles-controller.lua
@@ -47,14 +47,14 @@ newrole = function(self)
return controllerfunctions.handle_form(self,
function() return self.model.getpermissions(self) end,
function(value) return self.model.setpermissions(self, value, true) end,
- self.clientdata, "Save", "Create New Role", "New Role Created", "viewroles")
+ self.clientdata, "Save", "Create New Role", "New Role Created")
end
editrole = function(self)
return controllerfunctions.handle_form(self,
function() return self.model.getpermissions(self, self.clientdata.role) end,
function(value) return self.model.setpermissions(self, value, false) end,
- self.clientdata, "Save", "Edit Role", "Role Saved", "viewroles")
+ self.clientdata, "Save", "Edit Role", "Role Saved")
end
deleterole = function(self)
diff --git a/app/acf-util/roles-viewroles-html.lsp b/app/acf-util/roles-viewroles-html.lsp
index f5ca4d5..8b9a10f 100644
--- a/app/acf-util/roles-viewroles-html.lsp
+++ b/app/acf-util/roles-viewroles-html.lsp
@@ -5,11 +5,12 @@
io.write(html.cfe_unpack(view))
--]] %>
-<% displaycommandresults({"deleterole"}, session) %>
+<% displaycommandresults({"newrole", "editrole", "deleterole"}, session) %>
<H1>Roles</H1>
<H2>Create new role</H2>
<form action="<%= page_info.script .. page_info.prefix .. page_info.controller %>/newrole" method="POST">
+<input class="hidden" type="hidden" name="redir" value="<%= page_info.orig_action %>" >
<dl><dt></dt><dd><input class="submit" type="submit" value="New Role"></dd></dl>
</form>
@@ -31,7 +32,7 @@
<dt><img src='/static/tango/16x16/apps/system-users.png' height='16' width='16'> <%= role %></dt>
<dd>
[<a href='viewroleperms?role=<%= role %>'>View this role</a>]
- [<a href='editrole?role=<%= role %>'>Edit this role</a>]
+ [<a href='editrole?role=<%= role %>&redir=<%= page_info.orig_action %>'>Edit this role</a>]
[<a href='deleterole?role=<%= role %>'>Delete this role</a>]
</dd>
<% end %>
diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua
index 5f5abcd..3587578 100644
--- a/app/acf_www-controller.lua
+++ b/app/acf_www-controller.lua
@@ -134,6 +134,7 @@ local dispatch_component = function(str, clientdata, suppress_view)
end
self.conf.component = true
self.conf.suppress_view = suppress_view
+ self.conf.orig_action = self.conf.orig_action or self.conf.prefix .. self.conf.controller .. "/" .. self.conf.action
local tempclientdata = self.clientdata
self.clientdata = clientdata or {}
self.clientdata.sessionid = tempclientdata.sessionid
@@ -200,7 +201,8 @@ local view_resolver = function(self)
script = self.conf.script,
appname = self.conf.appname,
skindir = self.conf.skindir or "",
- skin = self.conf.skin or ""
+ skin = self.conf.skin or "",
+ orig_action = self.conf.orig_action or self.conf.prefix .. self.conf.controller .. "/" .. self.conf.action
}
return func, viewlibrary, pageinfo, self.sessiondata
@@ -453,7 +455,10 @@ end
-- Cause a redirect to specified (or default) action
-- We use the self.conf table because it already has prefix,controller,etc
-- The actual redirection is defined in exception_handler above
-redirect = function (self, str)
+redirect = function (self, str, result)
+ if result then
+ self.sessiondata[self.conf.action.."result"] = result
+ end
local prefix, controller, action = self.parse_path_info("/" .. (str or ""))
if prefix ~= "/" then self.conf.prefix = prefix end
if controller ~= "" then self.conf.controller = controller end
diff --git a/app/filedetails-html.lsp b/app/filedetails-html.lsp
index 4c1f116..ccf7a0c 100644
--- a/app/filedetails-html.lsp
+++ b/app/filedetails-html.lsp
@@ -17,10 +17,11 @@ displayitem(form.value.mtime)
</DL>
<H3>File Content</H3>
-<% if form.descr then %><P CLASS='descr'><%= string.gsub(form.descr, "\n", "<BR>") %></P><% end %>
-<% if form.errtxt then %><P CLASS='error'><%= string.gsub(form.errtxt, "\n", "<BR>") %></P><% end %>
-<form action="<%= page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %>" method="POST">
+<% if form.type == "form" then %>
+<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %>
+<% displayformstart(form) %>
<input type="hidden" name="filename" value="<%= form.value.filename.value %>">
+<% end %>
<textarea name="filecontent">
<%= html.html_escape(form.value.filecontent.value) %>
</textarea>
@@ -29,6 +30,6 @@ displayitem(form.value.mtime)
<% if form.type == "form" then %>
<H3>Save</H3>
-<DL><DT>Submit and save above changes</DT><DD><input class="submit" type="submit" name="<%= form.option %>" value="<%= form.option %>"></DD></DL>
+<% displayformend(form) %>
<% end %>
</form>
diff --git a/app/status-html.lsp b/app/status-html.lsp
index d5bdad0..f1e4c5c 100644
--- a/app/status-html.lsp
+++ b/app/status-html.lsp
@@ -2,7 +2,7 @@
require("viewfunctions")
%>
-<% displaycommandresults({"install"}, session) %>
+<% displaycommandresults({"install","edit"}, session) %>
<H1>System Info</H1>
<DL>
@@ -19,6 +19,6 @@ end
displayitem(data.value.autostart)
if not (data.value.version and data.value.version.errtxt) and data.value.autostart and data.value.autostart.errtxt and session.permissions.rc and session.permissions.rc.edit then
%>
- <a href="<%= page_info.script .. "/alpine-baselayout/rc/edit?servicename="..data.value.autostart.name %>">Schedule autostart</a>
+ <a href="<%= page_info.script .. "/alpine-baselayout/rc/edit?servicename="..data.value.autostart.name.."&redir=".. page_info.orig_action %>">Schedule autostart</a>
<% end %>
</DL>