summaryrefslogtreecommitdiffstats
path: root/tinydns-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-11-10 19:32:54 +0000
committerTed Trask <ttrask01@yahoo.com>2008-11-10 19:32:54 +0000
commit170b975a25e0ad6fded62d48b87a2c165fa46c1b (patch)
treefdc34d3392f7c2c3ee2a67d9324c2138a84c3688 /tinydns-model.lua
parent417f098a95d045b02d39a1dc25d888434c397eea (diff)
downloadacf-tinydns-170b975a25e0ad6fded62d48b87a2c165fa46c1b.tar.bz2
acf-tinydns-170b975a25e0ad6fded62d48b87a2c165fa46c1b.tar.xz
Slight change to tinydns to be more flexible with naming.
git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@1589 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'tinydns-model.lua')
-rw-r--r--tinydns-model.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/tinydns-model.lua b/tinydns-model.lua
index 0e0c319..360e3d3 100644
--- a/tinydns-model.lua
+++ b/tinydns-model.lua
@@ -96,7 +96,7 @@ end
local function getallowedlist(self, userid)
local allowedlist = {}
- local entry = authenticator.auth.read_entry(self, authenticator.usertable, "tinydns", userid) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.usertable, processname, 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
@@ -104,7 +104,7 @@ local function getallowedlist(self, userid)
-- add in the guest role
rols.value[#rols.value + 1] = roles.guest_role
for i,role in ipairs(rols.value) do
- local entry = authenticator.auth.read_entry(self, authenticator.roletable, "tinydns", role) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.roletable, processname, role) or ""
for x in string.gmatch(entry, "([^,]+),?") do allowedlist[#allowedlist + 1] = x end
end
return allowedlist
@@ -325,7 +325,7 @@ function getpermissionslist(self)
local userlist = {}
for i,user in ipairs(users) do
local allowedlist = {}
- local entry = authenticator.auth.read_entry(self, authenticator.usertable, "tinydns", user) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.usertable, processname, user) or ""
for x in string.gmatch(entry, "([^,]+),?") do allowedlist[#allowedlist + 1] = x end
userlist[#userlist + 1] = {id=user, allowed=allowedlist}
end
@@ -334,7 +334,7 @@ function getpermissionslist(self)
local rols = roles.list_all_roles(self)
for i,role in ipairs(rols) do
local allowedlist = {}
- local entry = authenticator.auth.read_entry(self, authenticator.roletable, "tinydns", role) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.roletable, processname, role) or ""
for x in string.gmatch(entry, "([^,]+),?") do allowedlist[#allowedlist + 1] = x end
rolelist[#rolelist + 1] = {id=role, allowed=allowedlist}
end
@@ -375,7 +375,7 @@ end
function getuserpermissions(self, userid)
local allowedlist = {}
- local entry = authenticator.auth.read_entry(self, authenticator.usertable, "tinydns", userid) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.usertable, processname, userid) or ""
for x in string.gmatch(entry, "([^,]+),?") do allowedlist[#allowedlist + 1] = x end
local cnffile = {}
recursedir(configdir, cnffile)
@@ -390,7 +390,7 @@ function setuserpermissions(self, userpermissions)
local success, userpermissions = validateuserpermissions(self, userpermissions)
if success then
- authenticator.auth.write_entry(self, authenticator.usertable, "tinydns", userpermissions.value.userid.value, table.concat(userpermissions.value.allowed.value, ","))
+ authenticator.auth.write_entry(self, authenticator.usertable, processname, userpermissions.value.userid.value, table.concat(userpermissions.value.allowed.value, ","))
else
userpermissions.errtxt = "Failed to set user permissions"
end
@@ -399,7 +399,7 @@ end
function getrolepermissions(self, role)
local allowedlist = {}
- local entry = authenticator.auth.read_entry(self, authenticator.roletable, "tinydns", role) or ""
+ local entry = authenticator.auth.read_entry(self, authenticator.roletable, processname, role) or ""
for x in string.gmatch(entry, "([^,]+),?") do allowedlist[#allowedlist + 1] = x end
local cnffile = {}
recursedir(configdir, cnffile)
@@ -414,7 +414,7 @@ function setrolepermissions(self, rolepermissions)
local success, rolepermissions = validaterolepermissions(self, rolepermissions)
if success then
- authenticator.auth.write_entry(self, authenticator.roletable, "tinydns", rolepermissions.value.role.value, table.concat(rolepermissions.value.allowed.value, ","))
+ authenticator.auth.write_entry(self, authenticator.roletable, processname, rolepermissions.value.role.value, table.concat(rolepermissions.value.allowed.value, ","))
else
rolepermissions.errtxt = "Failed to set role permissions"
end