Index: trunk/extensions/Nuke/Nuke_body.php |
— | — | @@ -7,18 +7,14 @@ |
8 | 8 | } |
9 | 9 | |
10 | 10 | public function execute( $par ) { |
11 | | - if ( !$this->userCanExecute( $this->getUser() ) ) { |
| 11 | + if( !$this->userCanExecute( $this->getUser() ) ) { |
12 | 12 | $this->displayRestrictionError(); |
| 13 | + return; |
13 | 14 | } |
| 15 | + |
14 | 16 | $this->setHeaders(); |
15 | 17 | $this->outputHeader(); |
16 | 18 | |
17 | | - if ( $this->getUser()->isBlocked() ) { |
18 | | - $block = $this->getUser()->getBlock(); |
19 | | - throw new UserBlockedError( $block ); |
20 | | - } |
21 | | - $this->checkReadOnly(); |
22 | | - |
23 | 19 | $req = $this->getRequest(); |
24 | 20 | |
25 | 21 | $target = trim( $req->getText( 'target', $par ) ); |
— | — | @@ -165,13 +161,11 @@ |
166 | 162 | /** |
167 | 163 | * @var $title Title |
168 | 164 | */ |
169 | | - list( $title, $userName, $edits ) = $info; |
| 165 | + list( $title, $userName ) = $info; |
170 | 166 | |
171 | 167 | $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false; |
172 | 168 | $thumb = $image && $image->exists() ? $image->transform( array( 'width' => 120, 'height' => 120 ), 0 ) : false; |
173 | 169 | |
174 | | - $changes = wfMsgExt( 'nchanges', 'parsemag', $this->getLanguage()->formatNum( $edits ) ); |
175 | | - |
176 | 170 | $out->addHTML( '<li>' . |
177 | 171 | Xml::check( |
178 | 172 | 'pages[]', |
— | — | @@ -185,7 +179,7 @@ |
186 | 180 | ( $userName ? wfMsgExt( 'nuke-editby', 'parseinline', $userName ) . ', ' : '' ) . |
187 | 181 | Linker::linkKnown( |
188 | 182 | $title, |
189 | | - $changes, |
| 183 | + wfMsg( 'nuke-viewchanges' ), |
190 | 184 | array(), |
191 | 185 | array( 'action' => 'history' ) |
192 | 186 | ) . |
— | — | @@ -210,29 +204,13 @@ |
211 | 205 | protected function getNewPages( $username, $limit ) { |
212 | 206 | $dbr = wfGetDB( DB_SLAVE ); |
213 | 207 | |
214 | | - /** |
215 | | - * This is the worst-case query: |
216 | | - * |
217 | | - * SELECT rc_user_text, rc_namespace, rc_title, SUM(1) AS edits, MAX(rc_new) |
218 | | - * FROM recentchanges |
219 | | - * WHERE (rc_log_type IS NULL OR (rc_log_type = 'upload' AND rc_log_action='upload')) |
220 | | - * AND rc_title LIKE 'Test%' |
221 | | - * GROUP BY rc_user_text, rc_namespace, rc_title |
222 | | - * HAVING MIN(CASE |
223 | | - * WHEN rc_log_type IS NULL THEN 2 |
224 | | - * WHEN rc_log_type = 'upload' THEN 1 |
225 | | - * ELSE 0 END) = 1 |
226 | | - * OR MAX(rc_new) = 1 |
227 | | - * ORDER BY min(rc_timestamp) DESC; |
228 | | - * |
229 | | - */ |
230 | | - |
231 | 208 | $what = array( |
232 | 209 | 'rc_namespace', |
233 | 210 | 'rc_title', |
| 211 | + 'rc_timestamp', |
234 | 212 | ); |
235 | 213 | |
236 | | - $where = array( "(rc_log_type IS NULL) OR (rc_log_type = 'upload' AND rc_log_action = 'upload')" ); |
| 214 | + $where = array( "(rc_new = 1) OR (rc_log_type = 'upload' AND rc_log_action = 'upload')" ); |
237 | 215 | |
238 | 216 | if ( $username === '' ) { |
239 | 217 | $what[] = 'rc_user_text'; |
— | — | @@ -244,23 +222,15 @@ |
245 | 223 | if ( !is_null( $pattern ) && trim( $pattern ) !== '' ) { |
246 | 224 | $where[] = 'rc_title LIKE ' . $dbr->addQuotes( $pattern ); |
247 | 225 | } |
248 | | - $group = implode( ', ', $what ); |
249 | | - $what[] = "sum(1) AS edits"; |
250 | 226 | |
251 | 227 | $result = $dbr->select( 'recentchanges', |
252 | 228 | $what, |
253 | 229 | $where, |
254 | 230 | __METHOD__, |
255 | 231 | array( |
256 | | - 'GROUP BY' => $group, |
257 | | - 'LIMIT' => $limit, |
258 | | - 'ORDER BY' => 'MIN(rc_timestamp) DESC', |
259 | | - 'HAVING' => <<<QUERY |
260 | | - MIN(CASE WHEN rc_log_type IS NULL THEN 2 |
261 | | - WHEN rc_log_type = 'upload' THEN 1 |
262 | | - ELSE 0 END) = 1 |
263 | | - OR MAX(rc_new) = 1 |
264 | | -QUERY |
| 232 | + 'ORDER BY' => 'rc_timestamp DESC', |
| 233 | + 'GROUP BY' => 'rc_namespace, rc_title', |
| 234 | + 'LIMIT' => $limit |
265 | 235 | ) |
266 | 236 | ); |
267 | 237 | |
— | — | @@ -269,8 +239,7 @@ |
270 | 240 | foreach ( $result as $row ) { |
271 | 241 | $pages[] = array( |
272 | 242 | Title::makeTitle( $row->rc_namespace, $row->rc_title ), |
273 | | - $username === '' ? $row->rc_user_text : false, |
274 | | - $row->edits, |
| 243 | + $username === '' ? $row->rc_user_text : false |
275 | 244 | ); |
276 | 245 | } |
277 | 246 | |
— | — | @@ -290,12 +259,6 @@ |
291 | 260 | $title = Title::newFromURL( $page ); |
292 | 261 | $file = $title->getNamespace() == NS_FILE ? wfLocalFile( $title ) : false; |
293 | 262 | |
294 | | - $permission_errors = $title->getUserPermissionsErrors( 'delete', $this->getUser()); |
295 | | - |
296 | | - if ( count( $permission_errors )) { |
297 | | - throw new PermissionsError( 'delete', $permission_errors ); |
298 | | - } |
299 | | - |
300 | 263 | if ( $file ) { |
301 | 264 | $oldimage = null; // Must be passed by reference |
302 | 265 | $ok = FileDeleteForm::doDelete( $title, $file, $oldimage, $reason, false )->isOK(); |
Index: trunk/extensions/Nuke/Nuke.i18n.php |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 | 'nuke-delete-more' => '[[Special:Nuke|Delete more pages]]', |
39 | 39 | 'nuke-pattern' => 'Pattern for the page name:', |
40 | 40 | 'nuke-nopages-global'=> 'There are no new pages in [[Special:RecentChanges|recent changes]].', |
| 41 | + 'nuke-viewchanges' => 'view changes', |
41 | 42 | ); |
42 | 43 | |
43 | 44 | /** Message documentation (Message documentation) |
— | — | @@ -195,6 +196,7 @@ |
196 | 197 | 'nuke-delete-more' => '[[Special:Nuke|Desaniciar más páxines]]', |
197 | 198 | 'nuke-pattern' => 'Patrón pal nome de páxina:', |
198 | 199 | 'nuke-nopages-global' => 'Nun hai páxines nueves nos [[Special:RecentChanges|cambios recientes]].', |
| 200 | + 'nuke-viewchanges' => 'ver los cambios', |
199 | 201 | ); |
200 | 202 | |
201 | 203 | /** Azerbaijani (Azərbaycanca) |
— | — | @@ -286,6 +288,7 @@ |
287 | 289 | 'nuke-delete-more' => '[[Special:Nuke|Масавае выдаленьне старонак]]', |
288 | 290 | 'nuke-pattern' => 'Узор для назвы старонкі:', |
289 | 291 | 'nuke-nopages-global' => 'У [[Special:RecentChanges|апошніх зьменах]] больш няма новых старонак.', |
| 292 | + 'nuke-viewchanges' => 'праглядзець зьмены', |
290 | 293 | ); |
291 | 294 | |
292 | 295 | /** Bulgarian (Български) |
— | — | @@ -353,6 +356,7 @@ |
354 | 357 | 'nuke-delete-more' => '[[Special:Nuke|Diverkañ pajennoù all]]', |
355 | 358 | 'nuke-pattern' => 'Patrom evit anv ar bajenn :', |
356 | 359 | 'nuke-nopages-global' => "N'eus pajenn nevez ebet er [[Special:RecentChanges|c'hemmoù diwezhañ]].", |
| 360 | + 'nuke-viewchanges' => "Diskouez ar c'hemmoù", |
357 | 361 | ); |
358 | 362 | |
359 | 363 | /** Bosnian (Bosanski) |
— | — | @@ -505,6 +509,7 @@ |
506 | 510 | 'nuke-delete-more' => '[[Special:Nuke|Weitere Seiten löschen]]', |
507 | 511 | 'nuke-pattern' => 'Muster für den Seitennamen:', |
508 | 512 | 'nuke-nopages-global' => 'Es gibt keine neuen Seiten unter den [[Special:RecentChanges|letzten Änderungen]].', |
| 513 | + 'nuke-viewchanges' => 'Änderungen ansehen', |
509 | 514 | ); |
510 | 515 | |
511 | 516 | /** German (formal address) (Deutsch (Sie-Form)) |
— | — | @@ -564,6 +569,7 @@ |
565 | 570 | 'nuke-delete-more' => '[[Special:Nuke|Dalšne boki lašowaś]]', |
566 | 571 | 'nuke-pattern' => 'Pśikład za bokowe mě:', |
567 | 572 | 'nuke-nopages-global' => 'Njejsu žedne nowe boki w [[Special:RecentChanges|aktualnych změnach]].', |
| 573 | + 'nuke-viewchanges' => 'změny pokazaś', |
568 | 574 | ); |
569 | 575 | |
570 | 576 | /** Ewe (Eʋegbe) */ |
— | — | @@ -662,6 +668,7 @@ |
663 | 669 | 'nuke-delete-more' => '[[Special:Nuke|Borrar más páginas]]', |
664 | 670 | 'nuke-pattern' => 'Patrón del título de la página:', |
665 | 671 | 'nuke-nopages-global' => 'No hay nuevas páginas en los [[Special:RecentChanges|cambios recientes]].', |
| 672 | + 'nuke-viewchanges' => 'Mostrar cambios', |
666 | 673 | ); |
667 | 674 | |
668 | 675 | /** Estonian (Eesti) |
— | — | @@ -734,6 +741,7 @@ |
735 | 742 | 'nuke-delete-more' => '[[Special:Nuke|حذف صفحههای بیشتر]]', |
736 | 743 | 'nuke-pattern' => 'الگو برای نام صفحه:', |
737 | 744 | 'nuke-nopages-global' => 'هیچ صفحهٔ جدیدی در [[Special:RecentChanges|فهرست تغییرات اخیر]] نیست.', |
| 745 | + 'nuke-viewchanges' => 'نمایش تغییرات', |
738 | 746 | ); |
739 | 747 | |
740 | 748 | /** Finnish (Suomi) |
— | — | @@ -805,6 +813,7 @@ |
806 | 814 | 'nuke-delete-more' => '[[Special:Nuke|Supprimer plus de pages]]', |
807 | 815 | 'nuke-pattern' => 'Modèle pour le nom de page:', |
808 | 816 | 'nuke-nopages-global' => "Il n'y a pas de nouvelle page dans [[Special:RecentChanges|changements récents]].", |
| 817 | + 'nuke-viewchanges' => 'voir les modifications', |
809 | 818 | ); |
810 | 819 | |
811 | 820 | /** Franco-Provençal (Arpetan) |
— | — | @@ -874,6 +883,7 @@ |
875 | 884 | 'nuke-delete-more' => '[[Special:Nuke|Borrar máis páxinas]]', |
876 | 885 | 'nuke-pattern' => 'Patrón para o nome de páxina:', |
877 | 886 | 'nuke-nopages-global' => 'Non hai páxinas novas nos [[Special:RecentChanges|cambios recentes]].', |
| 887 | + 'nuke-viewchanges' => 'ollar os cambios', |
878 | 888 | ); |
879 | 889 | |
880 | 890 | /** Ancient Greek (Ἀρχαία ἑλληνικὴ) |
— | — | @@ -957,6 +967,7 @@ |
958 | 968 | 'nuke-delete-more' => '[[Special:Nuke|למחוק עוד דפים]]', |
959 | 969 | 'nuke-pattern' => 'תבנית עבור שם הדף:', |
960 | 970 | 'nuke-nopages-global' => 'אין דפים חדשים ב[[Special:RecentChanges|שינויים אחרונים]].', |
| 971 | + 'nuke-viewchanges' => 'הצגת שינויים', |
961 | 972 | ); |
962 | 973 | |
963 | 974 | /** Hindi (हिन्दी) |
— | — | @@ -1032,6 +1043,7 @@ |
1033 | 1044 | 'nuke-delete-more' => '[[Special:Nuke|Dalše strony wušmórnyć]]', |
1034 | 1045 | 'nuke-pattern' => 'Přikład za mjeno strony:', |
1035 | 1046 | 'nuke-nopages-global' => 'Njejsu žane nowe strony w [[Special:RecentChanges|aktualnych změnach]].', |
| 1047 | + 'nuke-viewchanges' => 'změny pokazać', |
1036 | 1048 | ); |
1037 | 1049 | |
1038 | 1050 | /** Hungarian (Magyar) |
— | — | @@ -1087,6 +1099,7 @@ |
1088 | 1100 | 'nuke-delete-more' => '[[Special:Nuke|Deler plus paginas]]', |
1089 | 1101 | 'nuke-pattern' => 'Patrono pro le nomine de pagina:', |
1090 | 1102 | 'nuke-nopages-global' => 'Il non ha nove paginas in le [[Special:RecentChanges|modificationes recente]].', |
| 1103 | + 'nuke-viewchanges' => 'vider modificationes', |
1091 | 1104 | ); |
1092 | 1105 | |
1093 | 1106 | /** Indonesian (Bahasa Indonesia) |
— | — | @@ -1221,6 +1234,7 @@ |
1222 | 1235 | 'nuke-delete-more' => '[[Special:Nuke|Cancella più pagine]]', |
1223 | 1236 | 'nuke-pattern' => 'Modello per il titolo della pagina:', |
1224 | 1237 | 'nuke-nopages-global' => 'Non ci sono nuove pagine negli [[Special:RecentChanges|ultimi cambiamenti]].', |
| 1238 | + 'nuke-viewchanges' => 'vedi modifiche', |
1225 | 1239 | ); |
1226 | 1240 | |
1227 | 1241 | /** Japanese (日本語) |
— | — | @@ -1443,6 +1457,7 @@ |
1444 | 1458 | 'nuke-delete-more' => '[[Special:Nuke|Méi Säite läschen]]', |
1445 | 1459 | 'nuke-pattern' => 'Muster fir de Säitennumm:', |
1446 | 1460 | 'nuke-nopages-global' => 'Et si keng nei Säiten an de [[Special:RecentChanges|rezenten Ännerungen]].', |
| 1461 | + 'nuke-viewchanges' => 'Ännerunge weisen', |
1447 | 1462 | ); |
1448 | 1463 | |
1449 | 1464 | /** Limburgish (Limburgs) |
— | — | @@ -1535,6 +1550,7 @@ |
1536 | 1551 | 'nuke-delete-more' => '[[Special:Nuke|Избриши уште страници]]', |
1537 | 1552 | 'nuke-pattern' => 'Мостра за име на страница:', |
1538 | 1553 | 'nuke-nopages-global' => 'Нема нови страници во [[Special:RecentChanges|скорешните промени]].', |
| 1554 | + 'nuke-viewchanges' => 'прикажи промени', |
1539 | 1555 | ); |
1540 | 1556 | |
1541 | 1557 | /** Malayalam (മലയാളം) |
— | — | @@ -1610,6 +1626,7 @@ |
1611 | 1627 | 'nuke-delete-more' => '[[Special:Nuke|Hapuskan lebih banyak laman]]', |
1612 | 1628 | 'nuke-pattern' => 'Pola nama laman:', |
1613 | 1629 | 'nuke-nopages-global' => 'Tiada laman baru dalam [[Special:RecentChanges|perubahan terkini]].', |
| 1630 | + 'nuke-viewchanges' => 'lihat perubahan', |
1614 | 1631 | ); |
1615 | 1632 | |
1616 | 1633 | /** Maltese (Malti) |
— | — | @@ -1746,6 +1763,7 @@ |
1747 | 1764 | 'nuke-delete-more' => "[[Special:Nuke|Meer pagina's verwijderen]]", |
1748 | 1765 | 'nuke-pattern' => 'Patroon voor de paginanaam:', |
1749 | 1766 | 'nuke-nopages-global' => "Er zijn geen nieuwe pagina's in de [[Special:RecentChanges|recente wijzigingen]].", |
| 1767 | + 'nuke-viewchanges' => 'wijzigingen bekijken', |
1750 | 1768 | ); |
1751 | 1769 | |
1752 | 1770 | /** Norwegian Nynorsk (Norsk (nynorsk)) |
— | — | @@ -1868,6 +1886,7 @@ |
1869 | 1887 | 'nuke-delete-more' => '[[Special:Nuke|Usuń więcej stron]]', |
1870 | 1888 | 'nuke-pattern' => 'Wzór nazwy strony:', |
1871 | 1889 | 'nuke-nopages-global' => 'Brak nowych stron w [[Special:RecentChanges|ostatnich zmianach]].', |
| 1890 | + 'nuke-viewchanges' => 'widok zmian', |
1872 | 1891 | ); |
1873 | 1892 | |
1874 | 1893 | /** Piedmontese (Piemontèis) |
— | — | @@ -1898,6 +1917,7 @@ |
1899 | 1918 | 'nuke-delete-more' => "[[Special:Nuke|Scancelé pì 'd pàgine]]", |
1900 | 1919 | 'nuke-pattern' => 'Model për ël nòm ëd pàgina:', |
1901 | 1920 | 'nuke-nopages-global' => "A-i é pa 'd pàgine neuve an [[Special:RecentChanges|ùltime modìfiche]].", |
| 1921 | + 'nuke-viewchanges' => 'varda modìfiche', |
1902 | 1922 | ); |
1903 | 1923 | |
1904 | 1924 | /** Pashto (پښتو) |
— | — | @@ -2090,6 +2110,7 @@ |
2091 | 2111 | 'nuke-delete-more' => '[[Special:Nuke|Множественное удаление страниц]]', |
2092 | 2112 | 'nuke-pattern' => 'Шаблон для имени страницы:', |
2093 | 2113 | 'nuke-nopages-global' => 'В [[Special:RecentChanges|недавних изменениях]] нет новых страниц.', |
| 2114 | + 'nuke-viewchanges' => 'Внесённые изменения', |
2094 | 2115 | ); |
2095 | 2116 | |
2096 | 2117 | /** Rusyn (Русиньскый) |
— | — | @@ -2230,6 +2251,7 @@ |
2231 | 2252 | 'nuke-delete-more' => '[[Special:Nuke|Izbriši več strani]]', |
2232 | 2253 | 'nuke-pattern' => 'Vzorec imena strani:', |
2233 | 2254 | 'nuke-nopages-global' => 'V [[Special:RecentChanges|zadnjih spremembah]] ni novih strani.', |
| 2255 | + 'nuke-viewchanges' => 'ogled sprememb', |
2234 | 2256 | ); |
2235 | 2257 | |
2236 | 2258 | /** Serbian (Cyrillic script) (Српски (ћирилица)) |
— | — | @@ -2558,6 +2580,7 @@ |
2559 | 2581 | 'nuke-delete-more' => '[[Special:Nuke|Xóa thêm trang]]', |
2560 | 2582 | 'nuke-pattern' => 'Mẫu tên trang:', |
2561 | 2583 | 'nuke-nopages-global' => 'Không có trang mới trong các [[Special:RecentChanges|thay đổi gần đây]].', |
| 2584 | + 'nuke-viewchanges' => 'xem thay đổi', |
2562 | 2585 | ); |
2563 | 2586 | |
2564 | 2587 | /** Volapük (Volapük) |
Index: trunk/extensions/Nuke/RELEASE-NOTES |
— | — | @@ -1,14 +1,10 @@ |
2 | 2 | These are the release notes for the Nuke extension. |
3 | | - |
| 3 | + |
4 | 4 | Extension page on mediawiki.org: https://www.mediawiki.org/wiki/Extension:Nuke |
5 | 5 | Latest version of the release notes: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Nuke/RELEASE-NOTES?view=co |
6 | 6 | |
7 | | -=== Version 1.1.5 == |
8 | | -(2012-03-14) |
9 | | -* (bug 35214) Special:Nuke allows deletions even when blocked |
10 | | -* (bug 16985) Show number of recent edits in Special:Nuke |
11 | | -* (bug 23600) Nuke extension w/PostgreSQL: column "recentchanges.rc_timestamp" should be in GROUP BY |
12 | 7 | |
| 8 | + |
13 | 9 | === Version 1.1.4 === |
14 | 10 | (2012-2-12) |
15 | 11 | |
— | — | @@ -37,4 +33,4 @@ |
38 | 34 | === Version 1.1 === |
39 | 35 | (2011-2-14) |
40 | 36 | |
41 | | -* Added a changable limit and the option to not filter the recent changes on a single user. |
| 37 | +* Added a changable limit and the option to not filter the recent changes on a single user. |
\ No newline at end of file |
Index: trunk/extensions/Nuke/Nuke.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | die( 'Not an entry point.' ); |
6 | 6 | } |
7 | 7 | |
8 | | -define( 'Nuke_VERSION', '1.1.5' ); |
| 8 | +define( 'Nuke_VERSION', '1.1.4' ); |
9 | 9 | |
10 | 10 | $dir = dirname(__FILE__) . '/'; |
11 | 11 | |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | 'path' => __FILE__, |
17 | 17 | 'name' => 'Nuke', |
18 | 18 | 'descriptionmsg' => 'nuke-desc', |
19 | | - 'author' => array( 'Brion Vibber', 'Jeroen De Dauw', 'Marcin Cieślak' ), |
| 19 | + 'author' => array( 'Brion Vibber', 'Jeroen De Dauw' ), |
20 | 20 | 'url' => 'https://www.mediawiki.org/wiki/Extension:Nuke', |
21 | 21 | 'version' => Nuke_VERSION, |
22 | 22 | ); |