none
[openafs-wiki.git] / TWiki / TWikiUIRegisterDotPm.mdwn
1 # <a name="Package &lt;code&gt;TWiki::UI::Register="></a> Package =TWiki::UI::Register
2
3 User registration handling.
4
5 <div>
6   <ul>
7     <li><a href="#Package =TWiki::UI::Register="> Package TWiki::UI::Register</a><ul>
8         <li><a href="#StaticMethod <strong>register_cgi</strong> ($se"> StaticMethod register_cgi <tt>($session)</tt></a></li>
9         <li><a href="#StaticMethod <strong>passwd_cgi</strong> ($sess"> StaticMethod passwd_cgi <tt>($session)</tt></a></li>
10         <li><a href="#StaticMethod <strong>bulkRegister</strong> ($se"> StaticMethod bulkRegister <tt>($session)</tt></a></li>
11         <li><a href="#StaticMethod *register_AndNext*"> StaticMethod registerAndNext <tt>($session,$tempUserDir)</tt></a></li>
12         <li><a href="#StaticMethod <strong>register</strong> ($sessio"> StaticMethod register <tt>($session)</tt></a></li>
13         <li><a href="#StaticMethod <strong>resetPassword</strong> ($s"> StaticMethod resetPassword <tt>($session)</tt></a></li>
14         <li><a href="#StaticMethod <strong>changePassword</strong> ($"> StaticMethod changePassword <tt>($session)</tt></a></li>
15         <li><a href="#StaticMethod *verify_EmailAddres"> StaticMethod verifyEmailAddress <tt>($session,$tempUserDir)</tt></a></li>
16         <li><a href="#StaticMethod *finish*"> StaticMethod finish <tt></tt></a></li>
17       </ul>
18     </li>
19   </ul>
20 </div>
21
22 ## <a name="StaticMethod &lt;strong&gt;register_cgi&lt;/strong&gt; ($se"></a> [[StaticMethod]] **register\_cgi** `($session)`
23
24 `register` command handler. This method is designed to be invoked via the `TWiki::UI::run` method.
25
26 ## <a name="StaticMethod &lt;strong&gt;passwd_cgi&lt;/strong&gt; ($sess"></a> [[StaticMethod]] **passwd\_cgi** `($session)`
27
28 `passwd` command handler. This method is designed to be invoked via the `TWiki::UI::run` method.
29
30 ## <a name="StaticMethod &lt;strong&gt;bulkRegister&lt;/strong&gt; ($se"></a> [[StaticMethod]] **bulkRegister** `($session)`
31
32 Called by [[ManageCgiScript]]::bulkRegister (requires authentication) with topic = the page with the entries on it.
33
34 1. Makes sure you are an admin user ;)
35 2. Calls TWiki::Data::DelimitedFile (delimiter =&gt; '|', content =&gt;textReadFromTopic)
36 3. ensures requiredFieldsPresent()
37 4. starts a log file
38 5. calls registerSingleBulkUser() for each row
39 6. writes output to log file, sets [[TWiki.TOPICPARENT|TWiki/TOPICPARENT]] back to page with entries on it.
40 7. redirects to log file
41
42 ## <a name="StaticMethod &lt;strong&gt;register_AndNext*"></a><a name="StaticMethod *register_AndNext&lt;/strong&gt; "></a> [[StaticMethod]] **registerAndNext** `($session,$tempUserDir)`
43
44 This is called when action = register or action = ""
45
46 It calls register and either Verify or Finish.
47
48 Hopefully we will get workflow integrated and rewrite this to be table driven
49
50 ## <a name="StaticMethod &lt;strong&gt;register&lt;/strong&gt; ($sessio"></a> [[StaticMethod]] **register** `($session)`
51
52 This is called through: [[TWikiRegistration]] -&gt; [[RegisterCgiScript]] -&gt; here
53
54 1. gets rows and fields from the query
55 2. calls \_validateRegistration() to ensure required fields correct, else [[OopsException]]
56
57 ## <a name="StaticMethod &lt;strong&gt;resetPassword&lt;/strong&gt; ($s"></a> [[StaticMethod]] **resetPassword** `($session)`
58
59 Generates a password. Mails it to them and asks them to change it. Entry point intended to be called from TWiki::UI::run
60
61 ## <a name="StaticMethod &lt;strong&gt;changePassword&lt;/strong&gt; ($"></a> [[StaticMethod]] **changePassword** `($session)`
62
63 Change the user's password and/or email. Details of the user and password are passed in CGI parameters.
64
65 1. Checks required fields have values
66 2. get wikiName and userName from getUserByEitherLoginOrWikiName(username)
67 3. check passwords match each other, and that the password is correct, otherwise 'wrongpassword'
68 4. TWiki::User::updateUserPassword
69 5. 'oopschangepasswd'
70
71 The [[NoPasswdUser]] case is not handled.
72
73 An admin user can change other user's passwords.
74
75 ## <a name="StaticMethod &lt;strong&gt;verify_EmailAddres"></a> [[StaticMethod]] \*verifyEmailAddress `($session,$tempUserDir)`
76
77 This is called: on receipt of the activation password -&gt; [[RegisterCgiScript]] -&gt; here
78
79 1. calls \_reloadUserContext(activation password)
80 2. throws oops if appropriate
81 3. calls emailRegistrationConfirmations
82 4. still calls 'oopssendmailerr' if a problem, but this is not done uniformly
83
84 ## <a name="StaticMethod &lt;strong&gt;finish*"></a><a name="StaticMethod *finish&lt;/strong&gt; "></a> [[StaticMethod]] **finish** ``
85
86 Presently this is called in [[RegisterCgiScript]] directly after a call to verify. The separation is intended for the [[RegistrationApprovals]] functionality
87
88 1. calls \_reloadUserContext (throws oops if appropriate)
89 2. calls newUserFromTemplate()
90 3. if using the htpasswdFormatFamily, calls \_addUserToPasswordSystem
91 4. calls the misnamed [[RegistrationHandler]] to set cookies
92 5. calls addUserToTWikiUsersTopic
93 6. writes the logEntry (if wanted :/)
94 7. redirects browser to 'oopsregthanks'
95
96 reloads the context by code these two are separate in here to ease the implementation of administrator approval