Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- auth.
- directory.
- domain {
- id
- =
- "africa:names",
- server
- =
- "LOCAL"
- }
- auth.
- directory.
- domain {
- id
- =
- "africa:master",
- server
- =
- "LOCAL"
- }
- auth.
- directory.
- domain {
- id
- =
- "africa:admin",
- server
- =
- "LOCAL"
- }
- local
- arr
- =
- {
- gear
- =
- {
- admin
- =
- 1,
- master
- =
- 1,
- name
- =
- 1
- }
- }
- local
- lfs
- =
- require
- "filesystem"
- for
- _,
- dn
- in
- lfs.
- dir
- (
- "conf/auth/"
- )
- do
- if
- dn
- ~=
- ".."
- and
- dn
- ~=
- "."
- then
- for
- ft,
- un
- in
- lfs.
- dir
- (
- "conf/auth/" .. dn
- )
- do
- if
- ft
- ==
- lfs.DIRECTORY
- then
- if
- un
- ~=
- ".."
- and
- un
- ~=
- "."
- then
- if
- arr[un]
- ~=
- nil
- then
- for
- ftype,
- fname
- in
- lfs.
- dir
- (
- "conf/auth/"..dn.."/"..un
- )
- do
- if
- fname
- ~=
- ".."
- and
- fname
- ~=
- "."
- then
- if
- ftype
- ==
- lfs.
- FILE
- and
- arr[un][fname]
- ~=
- nil
- then
- print
- (
- "Found file: " .. file
- )
- else
- print
- (
- "Auth error: File not enabled: " .. fname
- )
- end
- end
- end
- else
- print
- (
- "Auth error: User not found: " .. un
- )
- end
- end
- else
- print
- (
- "Auth error: Not a directory: " .. dn
- )
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement