summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-09-30 19:10:58 +0000
committerTed Trask <ttrask01@yahoo.com>2008-09-30 19:10:58 +0000
commit298500bfeba88f7be408fba1ad312eef41cda4dc (patch)
treec4fb4137444700cba1407dadd64941d4c8d2cb75
parent36d1d4021a7c38076cdcdfceae97e54bcd55d381 (diff)
downloadacf-tinydns-298500bfeba88f7be408fba1ad312eef41cda4dc.tar.bz2
acf-tinydns-298500bfeba88f7be408fba1ad312eef41cda4dc.tar.xz
Modified authenticator to make sub-authenticator visible rather that redefining the functions twice. Modified roles and tinydns to reflect change.
git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@1537 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--tinydns-model.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/tinydns-model.lua b/tinydns-model.lua
index a9abb90..325e67e 100644
--- a/tinydns-model.lua
+++ b/tinydns-model.lua
@@ -95,7 +95,7 @@ end
local function getallowedlist(self, userid)
local allowedlist = {}
- local entry = authenticator.read_userentry(self, "tinydns", userid) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.usertable, "tinydns", userid) or ""
for x in string.gmatch(entry, "([^,]+),?") do allowedlist[#allowedlist + 1] = x end
-- also check to see if there are allowed files for this user's roles
@@ -103,7 +103,7 @@ local function getallowedlist(self, userid)
-- add in the ALL role
rols.value[#rols.value + 1] = "ALL"
for i,role in ipairs(rols.value) do
- local entry = authenticator.read_roleentry(self, "tinydns", role) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.roletable, "tinydns", role) or ""
for x in string.gmatch(entry, "([^,]+),?") do allowedlist[#allowedlist + 1] = x end
end
return allowedlist
@@ -337,7 +337,7 @@ function getpermissionslist(self)
local userlist = {}
for i,user in ipairs(users) do
local allowedlist = {}
- local entry = authenticator.read_userentry(self, "tinydns", user) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.usertable, "tinydns", user) or ""
for x in string.gmatch(entry, "([^,]+),?") do allowedlist[#allowedlist + 1] = x end
userlist[#userlist + 1] = {id=user, allowed=allowedlist}
end
@@ -346,7 +346,7 @@ function getpermissionslist(self)
local rols = roles.list_all_roles(self)
for i,role in ipairs(rols) do
local allowedlist = {}
- local entry = authenticator.read_roleentry(self, "tinydns", role) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.roletable, "tinydns", role) or ""
for x in string.gmatch(entry, "([^,]+),?") do allowedlist[#allowedlist + 1] = x end
rolelist[#rolelist + 1] = {id=role, allowed=allowedlist}
end
@@ -387,7 +387,7 @@ end
function getuserpermissions(self, userid)
local allowedlist = {}
- local entry = authenticator.read_userentry(self, "tinydns", userid) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.usertable, "tinydns", userid) or ""
for x in string.gmatch(entry, "([^,]+),?") do allowedlist[#allowedlist + 1] = x end
local cnffile = {}
recursedir(configdir, cnffile)
@@ -402,7 +402,7 @@ function setuserpermissions(self, userpermissions)
local success, userpermissions = validateuserpermissions(self, userpermissions)
if success then
- authenticator.write_userentry(self, "tinydns", userpermissions.value.userid.value, table.concat(userpermissions.value.allowed.value, ","))
+ authenticator.auth.write_entry(self, authenticator.usertable, "tinydns", userpermissions.value.userid.value, table.concat(userpermissions.value.allowed.value, ","))
else
userpermissions.errtxt = "Failed to set user permissions"
end
@@ -411,7 +411,7 @@ end
function getrolepermissions(self, role)
local allowedlist = {}
- local entry = authenticator.read_roleentry(self, "tinydns", role) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.roletable, "tinydns", role) or ""
for x in string.gmatch(entry, "([^,]+),?") do allowedlist[#allowedlist + 1] = x end
local cnffile = {}
recursedir(configdir, cnffile)
@@ -426,7 +426,7 @@ function setrolepermissions(self, rolepermissions)
local success, rolepermissions = validaterolepermissions(self, rolepermissions)
if success then
- authenticator.write_roleentry(self, "tinydns", rolepermissions.value.role.value, table.concat(rolepermissions.value.allowed.value, ","))
+ authenticator.auth.write_entry(self, authenticator.roletable, "tinydns", rolepermissions.value.role.value, table.concat(rolepermissions.value.allowed.value, ","))
else
rolepermissions.errtxt = "Failed to set role permissions"
end