* empty entry now really removed
[mediawiki.git] / docs / user.doc
blob2eb0dee3fb1509e18b54af5b68676ebe4aef6bc2
2 USER.DOC
4 Documenting the Wikipedia User object.
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.)
10 Database fields:
12   user_id
13     Unique integer identifier; primary key. Sent to user in
14     cookie "$WikiUserOpts".
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.
22   user_rights
23     Comma-separated list of rights. Right now, only "sysop",
24     "developer", and "bot".
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".
31   user_email
32     User's e-mail address. (Optional, used for user-to-user
33     e-mail and password recovery.)
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".
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.
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:
53 Cookies
55   $WikiUserName
56     Plain text user name directly from database
58   $WikiUserPassword
59     From the database; only set if the user's options are set
60     to remember passwords.
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:
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"