Bug fixes: watchlist and recent changes linked were broken in the last commit
[lhc/web/wiklou.git] / docs / user.doc
1
2 USER.DOC
3
4 Documenting the Wikipedia User object.
5
6 (DISCLAIMER: The documentation is not guaranteed to be in sync with
7 the code at all times. If in doubt, check the table definitions
8 and User.php.)
9
10 Database fields:
11
12 user_id
13 Unique integer identifier; primary key. Sent to user in
14 cookie "$WikiUserOpts".
15
16 user_name
17 Text of full user name; title of "user:" page. Displayed
18 on change lists, etc. Sent to user as cookie "$WikiUserName".
19 Note that user names can contain spaces, while these are
20 converted to underscores in page titles.
21
22 user_rights
23 Comma-separated list of rights. Right now, only "sysop",
24 "developer", and "bot".
25
26 user_password
27 md5 has of user login password. If user option to
28 remember password is set, this is stored in cookie
29 "$WikiUserPassword".
30
31 user_email
32 User's e-mail address. (Optional, used for user-to-user
33 e-mail and password recovery.)
34
35 user_options
36 A urlencoded string of name=value pairs to set various
37 user options. Some of these (but not all) are encoded into
38 the cookie "$WikiUserOpts".
39
40 The user object encapsulates all of the settings, and clients
41 classes use the getXXX() functions to access them. These functions
42 do all the work of determining whether the user is logged in,
43 whether the requested option can be satisfied from cookies or
44 whether a database query is needed. Most of the settings needed
45 for rendering normal pages are set in the cookie to minimize use
46 of the database.
47
48 Options
49 The user_options field is a list of name-value pairs. The
50 following option names are used at various points in the system:
51
52
53 Cookies
54
55 $WikiUserName
56 Plain text user name directly from database
57
58 $WikiUserPassword
59 From the database; only set if the user's options are set
60 to remember passwords.
61
62 $WikiUserOpts
63 User ID and various options encoded into a compact string;
64 for example, "12e0q0s2h0u1j0n1f0y0". The first string of digits
65 is the ID; the rest of the string a flag-letter plus number
66 pairs representing a few important options:
67
68 e = "encoding" (index into array)
69 q = "quickBar" (0=none, 1=left, 2=right)
70 s = "skin" (0=standard, 1=startrek, 2=nostalgia, 3=cologneblue)
71 h = "showHover" (1=true)
72 u = "underlineLinks" (1=true)
73 j = "justify" (1=true)
74 n = "numberHeadings" (1=true)
75 f = "viewFrames" (1=true)
76 y = 1 if user_rights include "is_sysop"
77