r98638 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98637‎ | r98638 | r98639 >
Date:22:53, 1 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Documentation

Fix some incorrect starts of comment blocks
Modified paths:
  • /trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/dataclasses/UserAccountRequest.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/schema/ConfirmAccountUpdater.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmAccount/schema/ConfirmAccountUpdater.hooks.php
@@ -3,6 +3,11 @@
44 * Class containing updater functions for a ConfirmAccount environment
55 */
66 class ConfirmAccountUpdaterHooks {
 7+
 8+ /**
 9+ * @param DatabaseUpdater $updater
 10+ * @return bool
 11+ */
712 public static function addSchemaUpdates( DatabaseUpdater $updater ) {
813 $base = dirname( __FILE__ );
914 if ( $updater->getDB()->getType() == 'mysql' ) {
Index: trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php
@@ -1,8 +1,8 @@
22 <?php
33 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+ */
77 public static function runAutoMaintenance() {
88 global $wgRejectedAccountMaxAge, $wgConfirmAccountFSRepos;
99
Index: trunk/extensions/ConfirmAccount/dataclasses/UserAccountRequest.php
@@ -27,6 +27,10 @@
2828
2929 private function __construct() {}
3030
 31+ /**
 32+ * @param $row
 33+ * @return UserAccountRequest
 34+ */
3135 public static function newFromRow( Object $row ) {
3236 $req = new self();
3337
@@ -55,6 +59,10 @@
5660 return $req;
5761 }
5862
 63+ /**
 64+ * @param $fields array
 65+ * @return UserAccountRequest
 66+ */
5967 public static function newFromArray( array $fields ) {
6068 $req = new self();
6169
@@ -100,86 +108,148 @@
101109 return $req;
102110 }
103111
 112+ /**
 113+ * @return int
 114+ */
104115 public function getId() {
105116 return $this->id;
106117 }
107118
 119+ /**
 120+ * @return string
 121+ */
108122 public function getName() {
109123 return $this->name;
110124 }
111125
 126+ /**
 127+ * @return sting
 128+ */
112129 public function getRealName() {
113130 return $this->realName;
114131 }
115132
 133+ /**
 134+ * @return string
 135+ */
116136 public function getEmail() {
117137 return $this->email;
118138 }
119139
 140+ /**
 141+ * @return string
 142+ */
120143 public function getRegistration() {
121144 return $this->registration;
122145 }
123146
 147+ /**
 148+ * @return string
 149+ */
124150 public function getBio() {
125151 return $this->bio;
126152 }
127153
 154+ /**
 155+ * @return string
 156+ */
128157 public function getNotes() {
129158 return $this->notes;
130159 }
131160
 161+ /**
 162+ * @return array
 163+ */
132164 public function getUrls() {
133165 return $this->urls;
134166 }
135167
 168+ /**
 169+ * @return array
 170+ */
136171 public function getAreas() {
137172 return $this->areas;
138173 }
139174
 175+ /**
 176+ * @return string
 177+ */
140178 public function getFileName() {
141179 return $this->fileName;
142180 }
143181
 182+ /**
 183+ * @return string
 184+ */
144185 public function getFileStorageKey() {
145186 return $this->fileStorageKey;
146187 }
147188
 189+ /**
 190+ * @return string
 191+ */
148192 public function getIP() {
149193 return $this->ip;
150194 }
151195
 196+ /**
 197+ * @return string
 198+ */
152199 public function getEmailToken() {
153200 return $this->emailToken;
154201 }
155202
 203+ /**
 204+ * @return string
 205+ */
156206 public function getEmailTokenExpires() {
157207 return $this->emailTokenExpires;
158208 }
159209
 210+ /**
 211+ * @return string
 212+ */
160213 public function getEmailAuthTimestamp() {
161214 return $this->emailAuthTimestamp;
162215 }
163216
 217+ /**
 218+ * @return bool
 219+ */
164220 public function isDeleted() {
165221 return $this->deleted;
166222 }
167223
 224+ /**
 225+ * @return string
 226+ */
168227 public function getRejectTimestamp() {
169228 return $this->rejectedTimestamp;
170229 }
171 -
 230+ /**
 231+ * @return string
 232+ */
172233 public function getHeldTimestamp() {
173234 return $this->heldTimestamp;
174235 }
175236
 237+ /**
 238+ * @return User
 239+ */
176240 public function getHandlingUser() {
177241 return $this->user;
178242 }
179243
 244+ /**
 245+ * @return string
 246+ */
180247 public function getHandlingComment() {
181248 return $this->comment;
182249 }
183250
 251+ /**
 252+ * @return int
 253+ */
184254 public function insertOn() {
185255 $dbw = wfGetDB( DB_MASTER );
186256 # Allow for some fields to be handled automatically...
@@ -218,6 +288,10 @@
219289 return $this->id;
220290 }
221291
 292+ /**
 293+ * @return bool
 294+ * @throws MWException
 295+ */
222296 public function remove() {
223297 if ( !$this->id ) {
224298 throw new MWException( "Account request ID is not set." );
Index: trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php
@@ -3,7 +3,7 @@
44 * Class containing hooked functions for a ConfirmAccount environment
55 */
66 class ConfirmAccountUIHooks {
7 - /*
 7+ /**
88 * Register ConfirmAccount special pages as needed.
99 * Also sets $wgSpecialPages just to be consistent.
1010 */
@@ -24,6 +24,10 @@
2525 return true;
2626 }
2727
 28+ /**
 29+ * @param $template
 30+ * @return bool
 31+ */
2832 public static function addRequestLoginText( &$template ) {
2933 global $wgUser, $wgOut;
3034 # Add a link to RequestAccount from UserLogin
@@ -34,6 +38,11 @@
3539 return true;
3640 }
3741
 42+ /**
 43+ * @param $personal_urls
 44+ * @param $title
 45+ * @return bool
 46+ */
3847 public static function setRequestLoginLinks( &$personal_urls, &$title ) {
3948 if ( isset( $personal_urls['anonlogin'] ) ) {
4049 $personal_urls['anonlogin']['text'] = wfMsg('nav-login-createaccount');
@@ -43,6 +52,11 @@
4453 return true;
4554 }
4655
 56+ /**
 57+ * @param $user User
 58+ * @param $abortError
 59+ * @return bool
 60+ */
4761 public static function checkIfAccountNameIsPending( User $user, &$abortError ) {
4862 # If an account is made with name X, and one is pending with name X
4963 # we will have problems if the pending one is later confirmed
@@ -57,7 +71,12 @@
5872 return true;
5973 }
6074
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+ */
6281 public static function confirmAccountsNotice( &$notice ) {
6382 global $wgConfirmAccountNotice, $wgUser, $wgMemc, $wgOut;
6483 if ( !$wgConfirmAccountNotice || !$wgUser->isAllowed( 'confirmaccount' ) ) {
@@ -100,6 +119,10 @@
101120 return true;
102121 }
103122
 123+ /**
 124+ * @param $admin_links_tree
 125+ * @return bool
 126+ */
104127 public static function confirmAccountAdminLinks( &$admin_links_tree ) {
105128 $users_section = $admin_links_tree->getSection( wfMsg( 'adminlinks_users' ) );
106129 $extensions_row = $users_section->getRow( 'extensions' );
Index: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php
@@ -445,7 +445,7 @@
446446 if( !$row ) {
447447 $out->addHTML( wfMsgHtml('confirmaccount-badid') );
448448 $out->returnToMain( true, $titleObj );
449 - return;
 449+ return false;
450450 }
451451
452452 if( $this->submitType === 'reject' || $this->submitType === 'spam' ) {
@@ -502,7 +502,7 @@
503503 $user = User::newFromName( $this->reqUsername, 'creatable' );
504504 if( is_null($user) ) {
505505 $this->showAccountConfirmForm( wfMsgHtml('noname') );
506 - return;
 506+ return false;
507507 }
508508
509509 # Make a random password
@@ -511,7 +511,7 @@
512512 # Check if already in use
513513 if( 0 != $user->idForName() || $wgAuth->userExists( $user->getName() ) ) {
514514 $this->showAccountConfirmForm( wfMsgHtml('userexists') );
515 - return;
 515+ return false;
516516 }
517517 # Add user to DB
518518 $dbw = wfGetDB( DB_MASTER );
@@ -776,6 +776,7 @@
777777 } else {
778778 $this->showAccountConfirmForm();
779779 }
 780+ return true;
780781 }
781782
782783 /*

Status & tagging log