Index: trunk/extensions/ConfirmAccount/schema/ConfirmAccountUpdater.hooks.php |
— | — | @@ -3,6 +3,11 @@ |
4 | 4 | * Class containing updater functions for a ConfirmAccount environment |
5 | 5 | */ |
6 | 6 | class ConfirmAccountUpdaterHooks { |
| 7 | + |
| 8 | + /** |
| 9 | + * @param DatabaseUpdater $updater |
| 10 | + * @return bool |
| 11 | + */ |
7 | 12 | public static function addSchemaUpdates( DatabaseUpdater $updater ) { |
8 | 13 | $base = dirname( __FILE__ ); |
9 | 14 | if ( $updater->getDB()->getType() == 'mysql' ) { |
Index: trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | class ConfirmAccount { |
4 | | - /* |
5 | | - * Move old stale requests to rejected list. Delete old rejected requests. |
6 | | - */ |
| 4 | + /** |
| 5 | + * Move old stale requests to rejected list. Delete old rejected requests. |
| 6 | + */ |
7 | 7 | public static function runAutoMaintenance() { |
8 | 8 | global $wgRejectedAccountMaxAge, $wgConfirmAccountFSRepos; |
9 | 9 | |
Index: trunk/extensions/ConfirmAccount/dataclasses/UserAccountRequest.php |
— | — | @@ -27,6 +27,10 @@ |
28 | 28 | |
29 | 29 | private function __construct() {} |
30 | 30 | |
| 31 | + /** |
| 32 | + * @param $row |
| 33 | + * @return UserAccountRequest |
| 34 | + */ |
31 | 35 | public static function newFromRow( Object $row ) { |
32 | 36 | $req = new self(); |
33 | 37 | |
— | — | @@ -55,6 +59,10 @@ |
56 | 60 | return $req; |
57 | 61 | } |
58 | 62 | |
| 63 | + /** |
| 64 | + * @param $fields array |
| 65 | + * @return UserAccountRequest |
| 66 | + */ |
59 | 67 | public static function newFromArray( array $fields ) { |
60 | 68 | $req = new self(); |
61 | 69 | |
— | — | @@ -100,86 +108,148 @@ |
101 | 109 | return $req; |
102 | 110 | } |
103 | 111 | |
| 112 | + /** |
| 113 | + * @return int |
| 114 | + */ |
104 | 115 | public function getId() { |
105 | 116 | return $this->id; |
106 | 117 | } |
107 | 118 | |
| 119 | + /** |
| 120 | + * @return string |
| 121 | + */ |
108 | 122 | public function getName() { |
109 | 123 | return $this->name; |
110 | 124 | } |
111 | 125 | |
| 126 | + /** |
| 127 | + * @return sting |
| 128 | + */ |
112 | 129 | public function getRealName() { |
113 | 130 | return $this->realName; |
114 | 131 | } |
115 | 132 | |
| 133 | + /** |
| 134 | + * @return string |
| 135 | + */ |
116 | 136 | public function getEmail() { |
117 | 137 | return $this->email; |
118 | 138 | } |
119 | 139 | |
| 140 | + /** |
| 141 | + * @return string |
| 142 | + */ |
120 | 143 | public function getRegistration() { |
121 | 144 | return $this->registration; |
122 | 145 | } |
123 | 146 | |
| 147 | + /** |
| 148 | + * @return string |
| 149 | + */ |
124 | 150 | public function getBio() { |
125 | 151 | return $this->bio; |
126 | 152 | } |
127 | 153 | |
| 154 | + /** |
| 155 | + * @return string |
| 156 | + */ |
128 | 157 | public function getNotes() { |
129 | 158 | return $this->notes; |
130 | 159 | } |
131 | 160 | |
| 161 | + /** |
| 162 | + * @return array |
| 163 | + */ |
132 | 164 | public function getUrls() { |
133 | 165 | return $this->urls; |
134 | 166 | } |
135 | 167 | |
| 168 | + /** |
| 169 | + * @return array |
| 170 | + */ |
136 | 171 | public function getAreas() { |
137 | 172 | return $this->areas; |
138 | 173 | } |
139 | 174 | |
| 175 | + /** |
| 176 | + * @return string |
| 177 | + */ |
140 | 178 | public function getFileName() { |
141 | 179 | return $this->fileName; |
142 | 180 | } |
143 | 181 | |
| 182 | + /** |
| 183 | + * @return string |
| 184 | + */ |
144 | 185 | public function getFileStorageKey() { |
145 | 186 | return $this->fileStorageKey; |
146 | 187 | } |
147 | 188 | |
| 189 | + /** |
| 190 | + * @return string |
| 191 | + */ |
148 | 192 | public function getIP() { |
149 | 193 | return $this->ip; |
150 | 194 | } |
151 | 195 | |
| 196 | + /** |
| 197 | + * @return string |
| 198 | + */ |
152 | 199 | public function getEmailToken() { |
153 | 200 | return $this->emailToken; |
154 | 201 | } |
155 | 202 | |
| 203 | + /** |
| 204 | + * @return string |
| 205 | + */ |
156 | 206 | public function getEmailTokenExpires() { |
157 | 207 | return $this->emailTokenExpires; |
158 | 208 | } |
159 | 209 | |
| 210 | + /** |
| 211 | + * @return string |
| 212 | + */ |
160 | 213 | public function getEmailAuthTimestamp() { |
161 | 214 | return $this->emailAuthTimestamp; |
162 | 215 | } |
163 | 216 | |
| 217 | + /** |
| 218 | + * @return bool |
| 219 | + */ |
164 | 220 | public function isDeleted() { |
165 | 221 | return $this->deleted; |
166 | 222 | } |
167 | 223 | |
| 224 | + /** |
| 225 | + * @return string |
| 226 | + */ |
168 | 227 | public function getRejectTimestamp() { |
169 | 228 | return $this->rejectedTimestamp; |
170 | 229 | } |
171 | | - |
| 230 | + /** |
| 231 | + * @return string |
| 232 | + */ |
172 | 233 | public function getHeldTimestamp() { |
173 | 234 | return $this->heldTimestamp; |
174 | 235 | } |
175 | 236 | |
| 237 | + /** |
| 238 | + * @return User |
| 239 | + */ |
176 | 240 | public function getHandlingUser() { |
177 | 241 | return $this->user; |
178 | 242 | } |
179 | 243 | |
| 244 | + /** |
| 245 | + * @return string |
| 246 | + */ |
180 | 247 | public function getHandlingComment() { |
181 | 248 | return $this->comment; |
182 | 249 | } |
183 | 250 | |
| 251 | + /** |
| 252 | + * @return int |
| 253 | + */ |
184 | 254 | public function insertOn() { |
185 | 255 | $dbw = wfGetDB( DB_MASTER ); |
186 | 256 | # Allow for some fields to be handled automatically... |
— | — | @@ -218,6 +288,10 @@ |
219 | 289 | return $this->id; |
220 | 290 | } |
221 | 291 | |
| 292 | + /** |
| 293 | + * @return bool |
| 294 | + * @throws MWException |
| 295 | + */ |
222 | 296 | public function remove() { |
223 | 297 | if ( !$this->id ) { |
224 | 298 | throw new MWException( "Account request ID is not set." ); |
Index: trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | * Class containing hooked functions for a ConfirmAccount environment |
5 | 5 | */ |
6 | 6 | class ConfirmAccountUIHooks { |
7 | | - /* |
| 7 | + /** |
8 | 8 | * Register ConfirmAccount special pages as needed. |
9 | 9 | * Also sets $wgSpecialPages just to be consistent. |
10 | 10 | */ |
— | — | @@ -24,6 +24,10 @@ |
25 | 25 | return true; |
26 | 26 | } |
27 | 27 | |
| 28 | + /** |
| 29 | + * @param $template |
| 30 | + * @return bool |
| 31 | + */ |
28 | 32 | public static function addRequestLoginText( &$template ) { |
29 | 33 | global $wgUser, $wgOut; |
30 | 34 | # Add a link to RequestAccount from UserLogin |
— | — | @@ -34,6 +38,11 @@ |
35 | 39 | return true; |
36 | 40 | } |
37 | 41 | |
| 42 | + /** |
| 43 | + * @param $personal_urls |
| 44 | + * @param $title |
| 45 | + * @return bool |
| 46 | + */ |
38 | 47 | public static function setRequestLoginLinks( &$personal_urls, &$title ) { |
39 | 48 | if ( isset( $personal_urls['anonlogin'] ) ) { |
40 | 49 | $personal_urls['anonlogin']['text'] = wfMsg('nav-login-createaccount'); |
— | — | @@ -43,6 +52,11 @@ |
44 | 53 | return true; |
45 | 54 | } |
46 | 55 | |
| 56 | + /** |
| 57 | + * @param $user User |
| 58 | + * @param $abortError |
| 59 | + * @return bool |
| 60 | + */ |
47 | 61 | public static function checkIfAccountNameIsPending( User $user, &$abortError ) { |
48 | 62 | # If an account is made with name X, and one is pending with name X |
49 | 63 | # we will have problems if the pending one is later confirmed |
— | — | @@ -57,7 +71,12 @@ |
58 | 72 | return true; |
59 | 73 | } |
60 | 74 | |
61 | | - // FIXME: don't just take on to general site notice |
| 75 | + /** |
| 76 | + * FIXME: don't just take on to general site notice |
| 77 | + * |
| 78 | + * @param $notice |
| 79 | + * @return bool |
| 80 | + */ |
62 | 81 | public static function confirmAccountsNotice( &$notice ) { |
63 | 82 | global $wgConfirmAccountNotice, $wgUser, $wgMemc, $wgOut; |
64 | 83 | if ( !$wgConfirmAccountNotice || !$wgUser->isAllowed( 'confirmaccount' ) ) { |
— | — | @@ -100,6 +119,10 @@ |
101 | 120 | return true; |
102 | 121 | } |
103 | 122 | |
| 123 | + /** |
| 124 | + * @param $admin_links_tree |
| 125 | + * @return bool |
| 126 | + */ |
104 | 127 | public static function confirmAccountAdminLinks( &$admin_links_tree ) { |
105 | 128 | $users_section = $admin_links_tree->getSection( wfMsg( 'adminlinks_users' ) ); |
106 | 129 | $extensions_row = $users_section->getRow( 'extensions' ); |
Index: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php |
— | — | @@ -445,7 +445,7 @@ |
446 | 446 | if( !$row ) { |
447 | 447 | $out->addHTML( wfMsgHtml('confirmaccount-badid') ); |
448 | 448 | $out->returnToMain( true, $titleObj ); |
449 | | - return; |
| 449 | + return false; |
450 | 450 | } |
451 | 451 | |
452 | 452 | if( $this->submitType === 'reject' || $this->submitType === 'spam' ) { |
— | — | @@ -502,7 +502,7 @@ |
503 | 503 | $user = User::newFromName( $this->reqUsername, 'creatable' ); |
504 | 504 | if( is_null($user) ) { |
505 | 505 | $this->showAccountConfirmForm( wfMsgHtml('noname') ); |
506 | | - return; |
| 506 | + return false; |
507 | 507 | } |
508 | 508 | |
509 | 509 | # Make a random password |
— | — | @@ -511,7 +511,7 @@ |
512 | 512 | # Check if already in use |
513 | 513 | if( 0 != $user->idForName() || $wgAuth->userExists( $user->getName() ) ) { |
514 | 514 | $this->showAccountConfirmForm( wfMsgHtml('userexists') ); |
515 | | - return; |
| 515 | + return false; |
516 | 516 | } |
517 | 517 | # Add user to DB |
518 | 518 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -776,6 +776,7 @@ |
777 | 777 | } else { |
778 | 778 | $this->showAccountConfirmForm(); |
779 | 779 | } |
| 780 | + return true; |
780 | 781 | } |
781 | 782 | |
782 | 783 | /* |