summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2010-02-16 08:55:13 +0000
committerTed Trask <ttrask01@yahoo.com>2010-02-16 08:55:13 +0000
commit10cfd9d946f2bf5eaea11ea98bd00054431579de (patch)
tree553b251084f6bc3d574202451104e4e0369f51b1 /app
parent96177033b815d813e1c7034597f08f0876047580 (diff)
downloadacf-core-10cfd9d946f2bf5eaea11ea98bd00054431579de.tar.bz2
acf-core-10cfd9d946f2bf5eaea11ea98bd00054431579de.tar.xz
Added new view variable wwwprefix to adjust web path, fix index.html redirect.
Diffstat (limited to 'app')
-rw-r--r--app/acf-util/password-status-html.lsp2
-rw-r--r--app/acf-util/roles-viewroles-html.lsp4
-rw-r--r--app/acf_www-controller.lua3
-rw-r--r--app/dispatcherror-html.lsp4
-rw-r--r--app/exception-html.lsp4
-rw-r--r--app/template-html.lsp8
6 files changed, 13 insertions, 12 deletions
diff --git a/app/acf-util/password-status-html.lsp b/app/acf-util/password-status-html.lsp
index a26bdee..1f9bb13 100644
--- a/app/acf-util/password-status-html.lsp
+++ b/app/acf-util/password-status-html.lsp
@@ -12,7 +12,7 @@
<H2>Existing account</H2>
<DL>
<% for name,user in pairs(form.value) do %>
- <DT><IMG SRC='<%= html.html_escape(page_info.staticdir) %>/tango/16x16/apps/system-users.png' HEIGHT='16' WIDTH='16'> <%= html.html_escape(name) %></DT>
+ <DT><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/apps/system-users.png' HEIGHT='16' WIDTH='16'> <%= html.html_escape(name) %></DT>
<DD><TABLE>
<TR>
<TD STYLE='border:none;'><B><%= html.html_escape(user.value.userid.label) %></B></TD>
diff --git a/app/acf-util/roles-viewroles-html.lsp b/app/acf-util/roles-viewroles-html.lsp
index c7d6fc5..5221fce 100644
--- a/app/acf-util/roles-viewroles-html.lsp
+++ b/app/acf-util/roles-viewroles-html.lsp
@@ -15,7 +15,7 @@
<TABLE>
<% if view.value.defined_roles then %>
<% for x,role in pairs(view.value.defined_roles.value) do %>
- <TR><TD><dt><img src='<%= html.html_escape(page_info.staticdir) %>/tango/16x16/apps/system-users.png' height='16' width='16'> <%= html.html_escape(role) %></dt>
+ <TR><TD><dt><img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/apps/system-users.png' height='16' width='16'> <%= html.html_escape(role) %></dt>
<dd>
[<a href='viewroleperms?role=<%= html.html_escape(role) %>'>View this role</a>]
[<a href='editrole?role=<%= html.html_escape(role) %>&redir=<%= html.html_escape(page_info.orig_action) %>'>Edit this role</a>]
@@ -25,7 +25,7 @@
<% end %>
<% if view.value.default_roles then %>
<% for x,role in pairs(view.value.default_roles.value) do %>
- <TR><TD><dt><img src='<%= html.html_escape(page_info.staticdir) %>/tango/16x16/categories/applications-system.png' height='16' width='16'> <%= html.html_escape(role) %></dt>
+ <TR><TD><dt><img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/categories/applications-system.png' height='16' width='16'> <%= html.html_escape(role) %></dt>
<dd>
[<a href='viewroleperms?role=<%= html.html_escape(role) %>'>View this role</a>]
[<a href='editrole?role=<%= html.html_escape(role) %>&redir=<%= html.html_escape(page_info.orig_action) %>'>Edit this role</a>]
diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua
index 0b6d80d..e99ffa5 100644
--- a/app/acf_www-controller.lua
+++ b/app/acf_www-controller.lua
@@ -220,7 +220,7 @@ local view_resolver = function(self)
action = self.conf.action,
prefix = self.conf.prefix,
script = self.conf.script,
- appname = self.conf.appname,
+ wwwprefix = self.conf.wwwprefix or "",
staticdir = self.conf.staticdir or "",
skin = self.conf.skin or "",
orig_action = self.conf.orig_action or self.conf.prefix .. self.conf.controller .. "/" .. self.conf.action,
@@ -389,6 +389,7 @@ dispatch = function (self, userprefix, userctlr, useraction)
if userprefix == nil then
self.conf.prefix, self.conf.controller, self.conf.action =
parse_path_info(ENV["PATH_INFO"])
+ self.conf.wwwprefix = string.gsub(ENV["SCRIPT_NAME"] or "", "/?cgi%-bin/acf.*", "")
else
self.conf.prefix = userprefix
self.conf.controller = userctlr or ""
diff --git a/app/dispatcherror-html.lsp b/app/dispatcherror-html.lsp
index fde2f03..a72c148 100644
--- a/app/dispatcherror-html.lsp
+++ b/app/dispatcherror-html.lsp
@@ -1,4 +1,4 @@
-<% view = ... %>
+<% view, viewlibrary, page_info = ... %>
<style type="text/css">
p.hiddendetail {
@@ -10,7 +10,7 @@
font-size: 75%;
}
</style>
-<script type="text/javascript" src="/js/jquery-latest.js"></script>
+<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></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 03bfaf8..e9d3977 100644
--- a/app/exception-html.lsp
+++ b/app/exception-html.lsp
@@ -1,4 +1,4 @@
-<% view = ... %>
+<% view, viewlibrary, page_info = ... %>
<style type="text/css">
p.hiddendetail {
@@ -10,7 +10,7 @@
font-size: 75%;
}
</style>
-<script type="text/javascript" src="/js/jquery-latest.js"></script>
+<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script>
<script type="text/javascript">
var clickIt = function(){
$("p.hiddendetail").removeClass("hiddendetail").show("slow");
diff --git a/app/template-html.lsp b/app/template-html.lsp
index 0490b0b..5d42907 100644
--- a/app/template-html.lsp
+++ b/app/template-html.lsp
@@ -23,10 +23,10 @@ if viewlibrary and viewlibrary.dispatch_component then
end
%>
<title><%= html.html_escape(hostname .. " - " .. pageinfo.controller .. "->" .. pageinfo.action) %></title>
-<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.staticdir) %>/reset.css">
-<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.skin.."/"..posix.basename(pageinfo.skin)..".css") %>">
+<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.staticdir) %>/reset.css">
+<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin)..".css") %>">
<!--[if IE]>
-<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.skin.."/"..posix.basename(pageinfo.skin).."-ie.css") %>">
+<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin).."-ie.css") %>">
<![endif]-->
</head>
<body>
@@ -52,7 +52,7 @@ end
io.write ( string.format("\t\t\t\t\t\t<a href=\"%s\">Log in</a>\n", html.html_escape(ctlr) .. "logon" ) )
end %>
|
- <a href="/">home</a> |
+ <a href="<%= html.html_escape(pageinfo.wwwprefix) %>/">home</a> |
<a href="http://www.alpinelinux.org">about</a>
</p></span>
<div class="tailer"></div>