Index: trunk/extensions/Nuke/Nuke_body.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class SpecialNuke extends SpecialPage { |
5 | | - |
| 5 | + |
6 | 6 | public function __construct() { |
7 | 7 | parent::__construct( 'Nuke', 'nuke' ); |
8 | 8 | } |
— | — | @@ -16,10 +16,10 @@ |
17 | 17 | |
18 | 18 | $this->setHeaders(); |
19 | 19 | $this->outputHeader(); |
20 | | - |
| 20 | + |
21 | 21 | if( $wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { |
22 | 22 | $target = $wgRequest->getText( 'target', $par ); |
23 | | - |
| 23 | + |
24 | 24 | // Normalise name |
25 | 25 | if ( $target !== '' ) { |
26 | 26 | $user = User::newFromName( $target ); |
— | — | @@ -33,19 +33,17 @@ |
34 | 34 | $target === '' ? wfMsg( 'nuke-multiplepeople' ) : $target |
35 | 35 | ) |
36 | 36 | ); |
37 | | - |
| 37 | + |
38 | 38 | if ( $wgRequest->getVal( 'action' ) == 'delete' ) { |
39 | 39 | $pages = $wgRequest->getArray( 'pages' ); |
40 | | - |
| 40 | + |
41 | 41 | if( $pages ) { |
42 | 42 | return $this->doDelete( $pages, $reason ); |
43 | 43 | } |
44 | | - } |
45 | | - else { |
| 44 | + } else { |
46 | 45 | $this->listForm( $target, $reason, $wgRequest->getInt( 'limit' ) ); |
47 | 46 | } |
48 | | - } |
49 | | - else { |
| 47 | + } else { |
50 | 48 | $this->promptForm(); |
51 | 49 | } |
52 | 50 | } |
— | — | @@ -57,7 +55,7 @@ |
58 | 56 | global $wgOut, $wgUser; |
59 | 57 | |
60 | 58 | $wgOut->addWikiMsg( 'nuke-tools' ); |
61 | | - |
| 59 | + |
62 | 60 | $wgOut->addHTML( |
63 | 61 | Xml::openElement( |
64 | 62 | 'form', |
— | — | @@ -75,15 +73,15 @@ |
76 | 74 | . '</tr><tr>' |
77 | 75 | . '<td></td>' |
78 | 76 | . '<td>' . Xml::submitButton( wfMsg( 'nuke-submit-user' ) ) . '</td>' |
79 | | - .'</tr></table>' |
80 | | - . Html::hidden( 'wpEditToken', $wgUser->editToken() ) |
| 77 | + .'</tr></table>' |
| 78 | + . Html::hidden( 'wpEditToken', $wgUser->editToken() ) |
81 | 79 | . Xml::closeElement( 'form' ) |
82 | 80 | ); |
83 | 81 | } |
84 | 82 | |
85 | 83 | /** |
86 | 84 | * Display list of pages to delete. |
87 | | - * |
| 85 | + * |
88 | 86 | * @param string $username |
89 | 87 | * @param string $reason |
90 | 88 | * @param integer $limit |
— | — | @@ -97,11 +95,10 @@ |
98 | 96 | $wgOut->addWikiMsg( 'nuke-nopages', $username ); |
99 | 97 | return $this->promptForm(); |
100 | 98 | } |
101 | | - |
| 99 | + |
102 | 100 | if ( $username == '' ) { |
103 | 101 | $wgOut->addWikiMsg( 'nuke-list-multiple' ); |
104 | | - } |
105 | | - else { |
| 102 | + } else { |
106 | 103 | $wgOut->addWikiMsg( 'nuke-list', $username ); |
107 | 104 | } |
108 | 105 | |
— | — | @@ -138,9 +135,9 @@ |
139 | 136 | |
140 | 137 | // Select: All, None |
141 | 138 | $links = array(); |
142 | | - $links[] = '<a href="#" onclick="selectPages( true ); return false;">' . |
| 139 | + $links[] = '<a href="#" onclick="selectPages( true ); return false;">' . |
143 | 140 | wfMsg( 'powersearch-toggleall' ) . '</a>'; |
144 | | - $links[] = '<a href="#" onclick="selectPages( false ); return false;">' . |
| 141 | + $links[] = '<a href="#" onclick="selectPages( false ); return false;">' . |
145 | 142 | wfMsg( 'powersearch-togglenone' ) . '</a>'; |
146 | 143 | $wgOut->addHTML( |
147 | 144 | Xml::tags( 'p', |
— | — | @@ -163,7 +160,7 @@ |
164 | 161 | $thumb = $image && $image->exists() ? $image->transform( array( 'width' => 120, 'height' => 120 ), 0 ) : false; |
165 | 162 | |
166 | 163 | $changes = wfMsgExt( 'nchanges', 'parsemag', $wgLang->formatNum( $edits ) ); |
167 | | - |
| 164 | + |
168 | 165 | $wgOut->addHTML( '<li>' . |
169 | 166 | Xml::check( 'pages[]', true, |
170 | 167 | array( 'value' => $title->getPrefixedDbKey() ) |
— | — | @@ -176,7 +173,7 @@ |
177 | 174 | $sk->makeKnownLinkObj( $title, $changes, 'action=history' ) . |
178 | 175 | ")</li>\n" ); |
179 | 176 | } |
180 | | - |
| 177 | + |
181 | 178 | $wgOut->addHTML( |
182 | 179 | "</ul>\n" . |
183 | 180 | Xml::submitButton( wfMsg( 'nuke-submit-delete' ) ) . |
— | — | @@ -186,31 +183,30 @@ |
187 | 184 | |
188 | 185 | /** |
189 | 186 | * Gets a list of new pages by the specified user or everyone when none is specified. |
190 | | - * |
| 187 | + * |
191 | 188 | * @param string $username |
192 | 189 | * @param integer $limit |
193 | | - * |
| 190 | + * |
194 | 191 | * @return array |
195 | 192 | */ |
196 | 193 | protected function getNewPages( $username, $limit ) { |
197 | 194 | $dbr = wfGetDB( DB_SLAVE ); |
198 | | - |
| 195 | + |
199 | 196 | $what = array( |
200 | 197 | 'rc_namespace', |
201 | 198 | 'rc_title', |
202 | 199 | 'rc_timestamp', |
203 | 200 | 'COUNT(*) AS edits' |
204 | | - ); |
205 | | - |
| 201 | + ); |
| 202 | + |
206 | 203 | $where = array( "(rc_new = 1) OR (rc_log_type = 'upload' AND rc_log_action = 'upload')" ); |
207 | | - |
| 204 | + |
208 | 205 | if ( $username == '' ) { |
209 | 206 | $what[] = 'rc_user_text'; |
210 | | - } |
211 | | - else { |
| 207 | + } else { |
212 | 208 | $where['rc_user_text'] = $username; |
213 | 209 | } |
214 | | - |
| 210 | + |
215 | 211 | $result = $dbr->select( 'recentchanges', |
216 | 212 | $what, |
217 | 213 | $where, |
— | — | @@ -221,9 +217,9 @@ |
222 | 218 | 'LIMIT' => $limit |
223 | 219 | ) |
224 | 220 | ); |
225 | | - |
| 221 | + |
226 | 222 | $pages = array(); |
227 | | - |
| 223 | + |
228 | 224 | foreach ( $result as $row ) { |
229 | 225 | $pages[] = array( |
230 | 226 | Title::makeTitle( $row->rc_namespace, $row->rc_title ), |
— | — | @@ -231,15 +227,13 @@ |
232 | 228 | $username == '' ? $row->rc_user_text : false |
233 | 229 | ); |
234 | 230 | } |
235 | | - |
236 | | - $dbr->freeResult( $result ); |
237 | | - |
| 231 | + |
238 | 232 | return $pages; |
239 | 233 | } |
240 | 234 | |
241 | 235 | /** |
242 | 236 | * Does the actual deletion of the pages. |
243 | | - * |
| 237 | + * |
244 | 238 | * @param array $pages The pages to delete |
245 | 239 | * @param string $reason |
246 | 240 | */ |
— | — | @@ -263,6 +257,6 @@ |
264 | 258 | $res[] = wfMsgExt( 'nuke-not-deleted', array( 'parseinline' ), $title->getPrefixedText() ); |
265 | 259 | } |
266 | 260 | } |
267 | | - $wgOut->addHTML( "<ul>\n<li>" .implode( "</li>\n<li>", $res ) . "</li>\n</ul>\n" ); |
| 261 | + $wgOut->addHTML( "<ul>\n<li>" . implode( "</li>\n<li>", $res ) . "</li>\n</ul>\n" ); |
268 | 262 | } |
269 | 263 | } |
Index: trunk/extensions/CentralAuth/CentralAuthHooks.php |
— | — | @@ -101,9 +101,9 @@ |
102 | 102 | /** |
103 | 103 | * Show a nicer error when the user account does not exist on the local wiki, but |
104 | 104 | * does exist globally |
105 | | - * @param $users Array |
106 | | - * @param $data Array |
107 | | - * @param $abortError String |
| 105 | + * @param $users Array |
| 106 | + * @param $data Array |
| 107 | + * @param $abortError String |
108 | 108 | * @return bool |
109 | 109 | */ |
110 | 110 | static function onSpecialPasswordResetOnSubmit( &$users, $data, &$abortError ) { |
— | — | @@ -124,6 +124,11 @@ |
125 | 125 | return true; |
126 | 126 | } |
127 | 127 | |
| 128 | + /** |
| 129 | + * @param $user User |
| 130 | + * @param $inject_html string |
| 131 | + * @return bool |
| 132 | + */ |
128 | 133 | static function onUserLoginComplete( &$user, &$inject_html ) { |
129 | 134 | global $wgCentralAuthCookies, $wgRequest; |
130 | 135 | if ( !$wgCentralAuthCookies ) { |
— | — | @@ -182,6 +187,11 @@ |
183 | 188 | return true; |
184 | 189 | } |
185 | 190 | |
| 191 | + /** |
| 192 | + * @param $user User |
| 193 | + * @param $result |
| 194 | + * @return bool |
| 195 | + */ |
186 | 196 | static function onUserLoadFromSession( $user, &$result ) { |
187 | 197 | global $wgCentralAuthCookies, $wgCentralAuthCookiePrefix; |
188 | 198 | if ( !$wgCentralAuthCookies ) { |
— | — | @@ -267,6 +277,10 @@ |
268 | 278 | return true; |
269 | 279 | } |
270 | 280 | |
| 281 | + /** |
| 282 | + * @param $user User |
| 283 | + * @return bool |
| 284 | + */ |
271 | 285 | static function onUserLogout( &$user ) { |
272 | 286 | global $wgCentralAuthCookies; |
273 | 287 | if ( !$wgCentralAuthCookies ) { |
— | — | @@ -465,17 +479,17 @@ |
466 | 480 | return false; |
467 | 481 | } |
468 | 482 | |
469 | | - // Give other extensions a chance to stop auto creation, but they cannot |
470 | | - // change $userName, because CentralAuth expects user names on all wikis |
471 | | - // are the same. |
| 483 | + // Give other extensions a chance to stop auto creation, but they cannot |
| 484 | + // change $userName, because CentralAuth expects user names on all wikis |
| 485 | + // are the same. |
472 | 486 | // |
473 | | - // * $user (and usually $wgUser) is the half-created User object and |
474 | | - // should not be accessed in any way since calling any User methods |
| 487 | + // * $user (and usually $wgUser) is the half-created User object and |
| 488 | + // should not be accessed in any way since calling any User methods |
475 | 489 | // in its half-initialised state will give incorrect results. |
476 | 490 | // |
477 | 491 | // * $userName is the new user name |
478 | 492 | // |
479 | | - // * $anon is an anonymous user object which can be safely used for |
| 493 | + // * $anon is an anonymous user object which can be safely used for |
480 | 494 | // permissions checks. |
481 | 495 | if ( !wfRunHooks( 'CentralAuthAutoCreate', array( $user, $userName, $anon ) ) ) { |
482 | 496 | wfDebug( __METHOD__ . ": denied by other extensions\n" ); |
Index: trunk/extensions/SignupAPI/includes/ApiSignup.php |
— | — | @@ -197,8 +197,8 @@ |
198 | 198 | return array_merge( parent::getPossibleErrors(), array( |
199 | 199 | array( 'code' => 'WrongPassword', 'info' => 'Incorrect password entered. Please try again.' ), |
200 | 200 | array( 'code' => 'ReadOnlyPage', 'info' => 'Accounts cannot be created with read-only permissions' ), |
201 | | - array( 'code' => 'NoCookies', 'info' => 'The user account was not created, as we could not confirm its source. |
202 | | - Ensure you have cookies enabled, reload this page and try again.' ), |
| 201 | + array( 'code' => 'NoCookies', 'info' => 'The user account was not created, as we could not confirm its source. ' . |
| 202 | + 'Ensure you have cookies enabled, reload this page and try again.' ), |
203 | 203 | array( 'code' => 'NeedToken', 'info' => 'You need to resubmit your signup with the specified token' ), |
204 | 204 | array( 'code' => 'WrongToken', 'info' => 'You specified an invalid token' ), |
205 | 205 | array( 'code' => 'InsufficientPermission', 'info' => 'You do not have sufficient permissions to create account' ), |