-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathexample.lua
69 lines (57 loc) · 1.35 KB
/
example.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
function tprint (tbl, indent)
if not indent then indent = 0 end
for k, v in tbl.pairs() do
formatting = string.rep(" ", indent) .. k .. ": "
if type(v) == "table" then
print(formatting)
tprint(v, indent+1)
else
print(formatting .. '"' .. v .. '" (' .. type(v) .. ')')
end
end
end
function preacct()
print("example.lua/preacct()")
return fr.ok
end
function accounting()
print("example.lua/accounting()")
return fr.ok
end
function post_auth()
print("example.lua/post_auth()")
return fr.ok
end
function instantiate()
print("example.lua/instantiate()")
return fr.ok
end
function detach()
print("example.lua/detach()")
return fr.ok
end
function xlat()
print("example.lua/xlat()")
return fr.ok
end
function authenticate()
print("example.lua/authenticate()")
return fr.ok
end
function authorize()
-------------------------
-- example invocations --
-------------------------
--tprint(get_attribute("user-name"))
--tprint(get_attribute("user-password"))
--tprint(get_attribute("tunnel-type", "2"))
--print(request['user-name'][0])
--print(request['user-name'].next_iter())
--print(request['user-name'].next_iter())
--tprint(request['user-name'])
--tprint(request['user-name'])
print("example.lua/authorize()")
print("Request list contents:")
tprint(fr.request, 2)
return fr.ok
end