diff options
author | Ted Trask <ttrask01@yahoo.com> | 2016-08-10 17:47:10 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2016-08-10 17:47:10 +0000 |
commit | 00508d5d1ff3125d378f9f7943d67107e31ca366 (patch) | |
tree | a48cb69f98b833fd60c4eef74f80f067c503cfa1 /tinydns-model.lua | |
parent | 245ffaee674551e9d1ae1ce8f2e54f34f75d5b06 (diff) | |
download | acf-tinydns-master.tar.bz2 acf-tinydns-master.tar.xz |
Diffstat (limited to 'tinydns-model.lua')
-rw-r--r-- | tinydns-model.lua | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/tinydns-model.lua b/tinydns-model.lua index 16a95dd..908373d 100644 --- a/tinydns-model.lua +++ b/tinydns-model.lua @@ -18,32 +18,32 @@ local configfile = "/etc/conf.d/" .. processname local configdir = "/etc/"..processname local descr = { prefix={ - ['.']="Name server for your domain (NS + A + SOA)", - ['&']="Delegate subdomain (NS + A)", + ['.']="Name server for your domain (NS + A + SOA)", + ['&']="Delegate subdomain (NS + A)", ['=']="Host and reverse record (A + PTR)", ['+']="Host record (A, no PTR)", ['@']="Mail exchanger (MX)", ["'"]="Text record (TXT)", - ['^']="Reverse record (PTR)", - ['C']="Canonical name (CNAME)", - ['Z']="SOA record (SOA)", - [':']="Generic record", - ['%']="Client location", - ['S']="Service location (SRV)", - ['N']="Naming authority pointer (NAPTR)", + ['^']="Reverse record (PTR)", + ['C']="Canonical name (CNAME)", + ['Z']="SOA record (SOA)", + [':']="Generic record", + ['%']="Client location", + ['S']="Service location (SRV)", + ['N']="Naming authority pointer (NAPTR)", }, fieldlabels={ - ['.']={"Domain", "IP address", "Name server", "Time to live", "Timestamp", "Location", }, - ['&']={"Domain", "IP address", "Name server", "Time to live", "Timestamp", "Location", }, + ['.']={"Domain", "IP address", "Name server", "Time to live", "Timestamp", "Location", }, + ['&']={"Domain", "IP address", "Name server", "Time to live", "Timestamp", "Location", }, ['=']={"Host", "IP address", "Time to live", "Timestamp", "Location", }, ['+']={"Host", "IP address", "Time to live", "Timestamp", "Location", }, - ['@']={"Domain", "IP address", "Mail exchanger", "Distance", "Time to live", "Timestamp", "Location", }, - ['\'']={"Domain", "Text Record", "Time to live", "Timestamp", "Location", }, - ['^']={"PTR", "Domain name", "Time to live", "Timestamp", "Location", }, - ['C']={"Domain", "Canonical name", "Time to live", "Timestamp", "Location", }, - ['Z']={"Domain", "Primary name server", "Contact address", "Serial number", "Refresh time", "Retry time", "Expire time", "Minimum time", "Time to live", "Timestamp", "Location",}, - [':']={"Domain", "Record type", "Record data", "Time to live", "Timestamp", "Location", }, - ['%']={"Location", "IP prefix", }, + ['@']={"Domain", "IP address", "Mail exchanger", "Distance", "Time to live", "Timestamp", "Location", }, + ['\'']={"Domain", "Text Record", "Time to live", "Timestamp", "Location", }, + ['^']={"PTR", "Domain name", "Time to live", "Timestamp", "Location", }, + ['C']={"Domain", "Canonical name", "Time to live", "Timestamp", "Location", }, + ['Z']={"Domain", "Primary name server", "Contact address", "Serial number", "Refresh time", "Retry time", "Expire time", "Minimum time", "Time to live", "Timestamp", "Location",}, + [':']={"Domain", "Record type", "Record data", "Time to live", "Timestamp", "Location", }, + ['%']={"Location", "IP prefix", }, ['S']={"Domain Service", "IP address", "Server", "Port", "Priority", "Weight", "Time to live", "Timestamp", }, ['N']={"Domain", "Order", "Preference", "Flags", "Service", "Regular expression", "Replacement", "Time to live", "Timestamp", }, }, @@ -109,7 +109,7 @@ local function getallowedlist(self, userid) local auth = authenticator.get_subauth(self) local entry = auth.read_entry(self, authenticator.usertable, self.conf.prefix..self.conf.controller, 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 local userinfo = authenticator.get_userinfo(self, userid) -- add in the guest role @@ -158,11 +158,11 @@ end -- ################################################################################ -- PUBLIC FUNCTIONS -function mymodule.get_startstop(self, clientdata) +function mymodule.get_startstop(self, clientdata) return modelfunctions.get_startstop(processname) end -function mymodule.startstop_service(self, startstop, action) +function mymodule.startstop_service(self, startstop, action) return modelfunctions.startstop_service(startstop, action) end @@ -226,11 +226,11 @@ function mymodule.getconfigobjects(self, file_name, userid, filter_type) -- Use only configs that has a valid prefix -- If function is called with some filter options... then show only the filtered values if ( not (filter_type) or ((filter_type) and (filter_type == filecontent_table.type)) ) - and (filecontent_table.label) + and (filecontent_table.label) then filecontent_table.filename = filename filecontent_table.linenumber = linenumber - + -- we're gonna add a reverse domain name to make it easier to sort local domain = {} for mt in string.gmatch(filecontent_table[1], "([^.]+)") do |