File: mod_auth.html

package info (click to toggle)
erlang-doc-html 1%3A11.b.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 23,284 kB
  • ctags: 10,724
  • sloc: erlang: 505; ansic: 323; makefile: 62; perl: 61; sh: 45
file content (389 lines) | stat: -rw-r--r-- 15,565 bytes parent folder | download
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
  <TITLE>mod_auth</TITLE>
  <SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
  <STYLE TYPE="text/css">
<!--
    .REFBODY     { margin-left: 13mm }
    .REFTYPES    { margin-left: 8mm }
-->
  </STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
      ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
  <IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>mod_auth</H1>
</CENTER>

<H3>MODULE</H3>
<DIV CLASS=REFBODY>
mod_auth

</DIV>

<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
User authentication using text files, dets or mnesia database.

</DIV>

<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>

<P>This module provides for basic user authentication using
         textual files, dets databases as well as mnesia databases. 

</DIV>

<H3>EXPORTS</H3>

<P><A NAME="add_user/2"><STRONG><CODE>add_user(UserName, Options) -&#62; 
         true| {error, Reason}</CODE></STRONG></A><BR>
<A NAME="add_user/5"><STRONG><CODE>add_user(UserName, Password, UserData, Port, Dir)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="add_user/6"><STRONG><CODE>add_user(UserName, Password, UserData, Address, Port, Dir)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>UserName = string()</CODE></STRONG><BR>
<STRONG><CODE>Options = [Option]</CODE></STRONG><BR>
<STRONG><CODE>Option = {password,Password} | {userData,UserData} | {port,Port} |
{addr,Address} | {dir,Directory} | {authPassword,AuthPassword}</CODE></STRONG><BR>
<STRONG><CODE>Password = string()</CODE></STRONG><BR>
<STRONG><CODE>UserData = term()</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>Address = {A,B,C,D} | string() | undefined</CODE></STRONG><BR>
<STRONG><CODE>Dir = string()</CODE></STRONG><BR>
<STRONG><CODE>AuthPassword =string()</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>
<A NAME="user_api"><!-- Empty --></A><A NAME="add_user"><!-- Empty --></A>
<P><CODE>add_user/2, add_user/5</CODE> and <CODE>add_user/6</CODE> adds a user to the user 
         database. If the operation is succesful, this function returns 
         <CODE>true</CODE>. If an error occurs, <CODE>{error,Reason}</CODE> is returned. When <CODE>add_user/2</CODE> 
is called the Password, UserData Port and Dir options is mandatory.

</DIV>

<P><A NAME="delete_user/2"><STRONG><CODE>delete_user(UserName,Options) 
         -&#62; true | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="delete_user/3"><STRONG><CODE>delete_user(UserName, Port, Dir)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="delete_user/4"><STRONG><CODE>delete_user(UserName, Address, Port, Dir)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>UserName = string()</CODE></STRONG><BR>
<STRONG><CODE>Options = [Option]</CODE></STRONG><BR>
<STRONG><CODE>Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>Address = {A,B,C,D} | string() | undefined</CODE></STRONG><BR>
<STRONG><CODE>Dir = string()</CODE></STRONG><BR>
<STRONG><CODE>AuthPassword = string()</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>
<A NAME="delete_user"><!-- Empty --></A>
<P><CODE>delete_user/2, delete_user/3</CODE> and <CODE>delete_user/4</CODE> deletes a user 
         from the user database. If the operation is succesful, this 
         function returns <CODE>true</CODE>. If an error occurs, 
         <CODE>{error,Reason}</CODE> is returned. When <CODE>delete_user/2</CODE> is
called the Port and Dir options are mandatory.

</DIV>

<P><A NAME="get_user/2"><STRONG><CODE>get_user(UserName,Options)
         -&#62; {ok, #httpd_user} |{error, Reason}</CODE></STRONG></A><BR>
<A NAME="get_user/3"><STRONG><CODE>get_user(UserName, Port, Dir)
-&#62; {ok, #httpd_user} | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="get_user/4"><STRONG><CODE>get_user(UserName, Address, Port, Dir)
-&#62; {ok, #httpd_user} | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>UserName = string()</CODE></STRONG><BR>
<STRONG><CODE>Options = [Option]</CODE></STRONG><BR>
<STRONG><CODE>Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>Address = {A,B,C,D} | string() | undefined</CODE></STRONG><BR>
<STRONG><CODE>Dir = string()</CODE></STRONG><BR>
<STRONG><CODE>AuthPassword = string()</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>
<A NAME="get_user"><!-- Empty --></A>
<P><CODE>get_user/2, get_user/3</CODE> and <CODE>get_user/4</CODE> returns a 
         <CODE>httpd_user</CODE> record containing the userdata for a 
         specific user. If the user cannot be found, <CODE>{error, Reason}</CODE> 
         is returned. When <CODE>get_user/2</CODE> is called the Port and Dir 
         options are mandatory.

</DIV>

<P><A NAME="list_users/1"><STRONG><CODE>list_users(Options)
         -&#62; {ok, Users} | {error, Reason}
&#60;name&#62;list_users(Port, Dir)
-&#62; {ok, Users} | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="list_users/3"><STRONG><CODE>list_users(Address, Port, Dir)
-&#62; {ok, Users} | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Options = [Option]</CODE></STRONG><BR>
<STRONG><CODE>Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>Address = {A,B,C,D} | string() | undefined</CODE></STRONG><BR>
<STRONG><CODE>Dir = string()</CODE></STRONG><BR>
<STRONG><CODE>Users = list()</CODE></STRONG><BR>
<STRONG><CODE>AuthPassword = string()</CODE></STRONG><BR>
<STRONG><CODE>Reason = atom()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>
<A NAME="list_users"><!-- Empty --></A>
<P><CODE>list_users/1, list_users/2</CODE> and <CODE>list_users/3</CODE> returns a list 
         of users in the user database for a specific <CODE>Port/Dir</CODE>.
When <CODE>list_users/1</CODE> is called the Port and Dir 
         options are mandatory.

</DIV>

<P><A NAME="add_group_member/3"><STRONG><CODE>add_group_member(GroupName, UserName, Options)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="add_group_member/4"><STRONG><CODE>add_group_member(GroupName, UserName, Port, Dir)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="add_group_member/5"><STRONG><CODE>add_group_member(GroupName, UserName, Address, Port, Dir)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>GroupName = string()</CODE></STRONG><BR>
<STRONG><CODE>UserName = string()</CODE></STRONG><BR>
<STRONG><CODE>Options = [Option]</CODE></STRONG><BR>
<STRONG><CODE>Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>Address = {A,B,C,D} | string() | undefined</CODE></STRONG><BR>
<STRONG><CODE>Dir = string()</CODE></STRONG><BR>
<STRONG><CODE>AuthPassword = string()</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>
<A NAME="add_group_member"><!-- Empty --></A>
<P><CODE>add_group_member/3, add_group_member/4</CODE> and <CODE>add_group_member/5</CODE> 
         adds a user to a group. If the group does not exist, it 
         is created and the user is added to the group. Upon successful 
         operation, this function returns <CODE>true</CODE>. When <CODE>add_group_members/3</CODE> 
is called the Port and Dir options are mandatory.

</DIV>

<P><A NAME="delete_group_member/3"><STRONG><CODE>delete_group_member(GroupName, UserName, Options)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="delete_group_member/4"><STRONG><CODE>delete_group_member(GroupName, UserName, Port, Dir)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="delete_group_member/5"><STRONG><CODE>delete_group_member(GroupName, UserName, Address, Port, Dir)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>GroupName = string()</CODE></STRONG><BR>
<STRONG><CODE>UserName = string()</CODE></STRONG><BR>
<STRONG><CODE>Options = [Option]</CODE></STRONG><BR>
<STRONG><CODE>Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>Address = {A,B,C,D} | string() | undefined</CODE></STRONG><BR>
<STRONG><CODE>Dir = string()</CODE></STRONG><BR>
<STRONG><CODE>AuthPassword = string()</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>
<A NAME="delete_group_member"><!-- Empty --></A>
<P><CODE>delete_group_member/3, delete_group_member/4</CODE> and <CODE> delete_group_member/5</CODE> deletes a user from a group. 
If the group or the user does not exist, 
         this function returns an error, otherwise it returns <CODE>true</CODE>.
When <CODE>delete_group_member/3</CODE> is called the Port and Dir options
are mandatory.

</DIV>

<P><A NAME="list_group_members/2"><STRONG><CODE>list_group_members(GroupName, Options)
-&#62; {ok, Users} | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="list_group_members/3"><STRONG><CODE>list_group_members(GroupName, Port, Dir)
-&#62; {ok, Users} | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="list_group_members/4"><STRONG><CODE>list_group_members(GroupName, Address, Port, Dir)
-&#62; {ok, Users} | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>GroupName = string()</CODE></STRONG><BR>
<STRONG><CODE>Options = [Option]</CODE></STRONG><BR>
<STRONG><CODE>Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>Address = {A,B,C,D} | string() | undefined</CODE></STRONG><BR>
<STRONG><CODE>Dir = string()</CODE></STRONG><BR>
<STRONG><CODE>Users = list()</CODE></STRONG><BR>
<STRONG><CODE>AuthPassword = string()</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>
<A NAME="list_group_members"><!-- Empty --></A>
<P><CODE>list_group_members/2, list_group_members/3</CODE> and <CODE>list_group_members/4</CODE> 
         lists the members of a specified group. If the group does not 
         exist or there is an error, <CODE>{error, Reason}</CODE> is returned.
When <CODE>list_group_members/2</CODE> is called the Port and Dir options
are mandatory.

</DIV>

<P><A NAME="list_groups/1"><STRONG><CODE>list_groups(Options)
-&#62; {ok, Groups} | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="list_groups/2"><STRONG><CODE>list_groups(Port, Dir)
-&#62; {ok, Groups} | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="list_groups/3"><STRONG><CODE>list_groups(Address, Port, Dir)
-&#62; {ok, Groups} | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Options = [Option]</CODE></STRONG><BR>
<STRONG><CODE>Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>Address = {A,B,C,D} | string() | undefined</CODE></STRONG><BR>
<STRONG><CODE>Dir = string()</CODE></STRONG><BR>
<STRONG><CODE>Groups = list()</CODE></STRONG><BR>
<STRONG><CODE>AuthPassword = string()</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>
<A NAME="list_groups"><!-- Empty --></A>
<P><CODE>list_groups/1, list_groups/2</CODE> and <CODE>list_groups/3</CODE> lists all 
         the groups available. If there is an error, <CODE>{error, Reason}</CODE> 
         is returned. When <CODE>list_groups/1</CODE> is called the Port and Dir options
are mandatory.

</DIV>

<P><A NAME="delete_group/2"><STRONG><CODE>delete_group(GroupName, Options)
         -&#62; true | {error,Reason}
&#60;name&#62;delete_group(GroupName, Port, Dir)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="delete_group/4"><STRONG><CODE>delete_group(GroupName, Address, Port, Dir)
-&#62; true | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Options = [Option]</CODE></STRONG><BR>
<STRONG><CODE>Option = {port,Port} | {addr,Address} | {dir,Directory} | {authPassword,AuthPassword}</CODE></STRONG><BR>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>Address = {A,B,C,D} | string() | undefined</CODE></STRONG><BR>
<STRONG><CODE>Dir = string()</CODE></STRONG><BR>
<STRONG><CODE>GroupName = string()</CODE></STRONG><BR>
<STRONG><CODE>AuthPassword = string()</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>
<A NAME="delete_group"><!-- Empty --></A>
<P><CODE>delete_group/2, delete_group/3</CODE> and <CODE>delete_group/4</CODE> deletes the 
         group specified and returns <CODE>true</CODE>. If there is an error, 
         <CODE>{error, Reason}</CODE> is returned. When <CODE>delete_group/2</CODE> is called the 
Port and Dir options are mandatory.

</DIV>

<P><A NAME="update_password/5"><STRONG><CODE>update_password(Port, Dir, OldPassword, NewPassword, NewPassword)
-&#62; ok | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="update_password/6"><STRONG><CODE>update_password(Address,Port, Dir, OldPassword, NewPassword, NewPassword)
-&#62; ok | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Port = integer()</CODE></STRONG><BR>
<STRONG><CODE>Address = {A,B,C,D} | string() | undefined</CODE></STRONG><BR>
<STRONG><CODE>Dir = string()</CODE></STRONG><BR>
<STRONG><CODE>GroupName = string()</CODE></STRONG><BR>
<STRONG><CODE>OldPassword = string()</CODE></STRONG><BR>
<STRONG><CODE>NewPassword = string()</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>
<A NAME="update_password"><!-- Empty --></A>
<P><CODE>update_password/5</CODE> and <CODE>update_password/6</CODE> Updates the AuthAccessPassword
for the specified directory. If NewPassword is equal to &#34;NoPassword&#34; no password is requires to
change authorisation data. If NewPassword is equal to &#34;DummyPassword&#34; no changes can be done 
without changing the password first.

</DIV>
<A NAME="see_also"><!-- Empty --></A>
<H3>SEE ALSO</H3>
<DIV CLASS=REFBODY>

<P><A HREF="httpd.html">httpd(3)</A>,
<A HREF="mod_alias.html">mod_alias(3)</A>,

</DIV>

<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Mattias Nilsson
 - support@erlang.ericsson.se<BR>
Original implementation: Joakim Greben
 - support@erlang.ericsson.se<BR>

</DIV>
<CENTER>
<HR>
<SMALL>inets 4.7.6<BR>
Copyright &copy; 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>