diff options
author | Ted Trask <ttrask01@yahoo.com> | 2010-01-01 16:42:00 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2010-01-01 16:42:00 +0000 |
commit | 25204ba6ee44fdbd9288f3953ca63dcbb81b2167 (patch) | |
tree | 77a4f302228eac2437ce980c4ee6cd93effba18c | |
parent | 999412d23770869658b978727b479764f5e0bf90 (diff) | |
download | acf-kamailio-25204ba6ee44fdbd9288f3953ca63dcbb81b2167.tar.bz2 acf-kamailio-25204ba6ee44fdbd9288f3953ca63dcbb81b2167.tar.xz |
Use viewlibrary.check_permission from acf-core-0.9.0, dirname function is no longer in acf-core-0.9.0
-rw-r--r-- | kamailio-listusers-html.lsp | 12 | ||||
-rw-r--r-- | kamailio-model.lua | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/kamailio-listusers-html.lsp b/kamailio-listusers-html.lsp index 0c010c5..5994b79 100644 --- a/kamailio-listusers-html.lsp +++ b/kamailio-listusers-html.lsp @@ -8,7 +8,7 @@ <DL> <TABLE> <TR style="background:#eee;font-weight:bold;"> - <% if session.permissions[page_info.controller].deleteuser or session.permissions[page_info.controller].updateuser then %> + <% if viewlibrary.check_permission("deleteuser") or viewlibrary.check_permission("updateuser") then %> <TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD> <% end %> <TD style="padding-right:20px;white-space:nowrap;" class="header">User Name</TD> @@ -17,18 +17,18 @@ <% for i,user in ipairs(form.value) do %> <TR> - <% if session.permissions[page_info.controller].deleteuser or session.permissions[page_info.controller].updateuser then %> + <% if viewlibrary.check_permission("deleteuser") or viewlibrary.check_permission("updateuser") then %> <TD style="padding-right:20px;white-space:nowrap;"> - <% if session.permissions[page_info.controller].updateuser then %> + <% if viewlibrary.check_permission("updateuser") then %> <%= html.link{value = "updateuser?username=" .. user.username.."&redir="..page_info.orig_action, label="Update "} %> <% end %> - <% if session.permissions[page_info.controller].deleteuser then %> + <% if viewlibrary.check_permission("deleteuser") then %> <%= html.link{value = "deleteuser?username=" .. user.username, label="Delete "} %> <% end %> </TD> <% end %> <TD><%= html.html_escape(user.username) %></TD> - <% if session.permissions[page_info.controller].updateuser then %> + <% if viewlibrary.check_permission("updateuser") then %> <TD><%= html.html_escape(user.password) %></TD> <% else %> <TD>******</TD> @@ -38,6 +38,6 @@ </TABLE> </DL> -<% if viewlibrary and viewlibrary.dispatch_component and session.permissions[page_info.controller].createuser then +<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createuser") then viewlibrary.dispatch_component("createuser") end %> diff --git a/kamailio-model.lua b/kamailio-model.lua index 53cb29a..8d4ec97 100644 --- a/kamailio-model.lua +++ b/kamailio-model.lua @@ -1,6 +1,7 @@ module(..., package.seeall) -- Load libraries +require("posix") require("modelfunctions") require("fs") require("format") @@ -17,7 +18,7 @@ local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin -- LOCAL FUNCTIONS local is_valid_filename = function(filename) - local dirname = dirname(filename) + local dirname = posix.dirname(filename) return validator.is_valid_filename(filename) and string.match(dirname, baseurl) and not string.match(dirname, "%.%.") end |