Index: trunk/extensions/PureWikiDeletion/PureWikiDeletion.i18n.php |
— | — | @@ -22,7 +22,9 @@ |
23 | 23 | 'blank-log-link' => '[[Special:Log/blank|blank log]]', |
24 | 24 | 'blanknologin' => 'Not logged in', |
25 | 25 | 'blanknologintext' => 'You must be a registered user and ' |
26 | | - . '[[Special:UserLogin|logged in]] to blank or unblank a page.', |
| 26 | + . '[[Special:UserLogin|logged in]] to blank a page.', |
| 27 | + 'unblanknologintext' => 'You must be a registered user and ' |
| 28 | + . '[[Special:UserLogin|logged in]] to unblank a page.', |
27 | 29 | 'blankedtext' => '[[$1]] has been blanked. See $2 for a record of recent blankings.' |
28 | 30 | ); |
29 | 31 | |
Index: trunk/extensions/PureWikiDeletion/PureWikiDeletion.php |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | 'url' => 'http://www.mediawiki.org/wiki/Extension:PureWikiDeletion', |
33 | 33 | 'description' => 'Implements pure wiki deletion', |
34 | 34 | 'descriptionmsg' => 'PureWikiDeletion-desc', |
35 | | - 'version' => '1.0.2', |
| 35 | + 'version' => '1.0.3', |
36 | 36 | ); |
37 | 37 | |
38 | 38 | $dir = dirname( __FILE__ ) . '/'; |
— | — | @@ -67,6 +67,7 @@ |
68 | 68 | $wgLogHeaders['blank'] = 'blank-log-header'; |
69 | 69 | $wgLogActions['blank/blank'] = 'blank-log-entry-blank'; |
70 | 70 | $wgLogActions['blank/unblank'] = 'blank-log-entry-unblank'; |
| 71 | + |
71 | 72 | $wgSpecialPages['RandomExcludeBlank'] = 'RandomExcludeBlank'; |
72 | 73 | $wgSpecialPages['AllPagesExcludeBlank'] = 'AllPagesExcludeBlank'; |
73 | 74 | $wgSpecialPages['PopulateBlankedPagesTable'] = 'PopulateBlankedPagesTable'; |
— | — | @@ -89,9 +90,9 @@ |
90 | 91 | |
91 | 92 | function PureWikiDeletionSaveHook( &$article, &$user, &$text, &$summary, |
92 | 93 | $minor, $watch, $sectionanchor, &$flags ) { |
93 | | - global $wgOut; |
| 94 | + global $wgOut, $wgPureWikiDeletionLoginRequiredToBlank, $wgPureWikiDeletionLoginRequiredToUnblank; |
94 | 95 | if ( $text == "" ) { |
95 | | - if ( !( $user->isLoggedIn() ) ) { |
| 96 | + if ( $wgPureWikiDeletionLoginRequiredToBlank && !( $user->isLoggedIn() ) ) { |
96 | 97 | $wgOut->showErrorPage( 'blanknologin', 'blanknologintext' ); |
97 | 98 | return false; |
98 | 99 | } |
— | — | @@ -105,8 +106,8 @@ |
106 | 107 | $result = $dbr->selectRow( 'blanked_page', 'blank_page_id' |
107 | 108 | , array( "blank_page_id" => $blank_page_id ) ); |
108 | 109 | if ( $result ) { |
109 | | - if ( !( $user->isLoggedIn() ) ) { |
110 | | - $wgOut->showErrorPage( 'blanknologin', 'blanknologintext' ); |
| 110 | + if ( $wgPureWikiDeletionLoginRequiredToUnblank && !( $user->isLoggedIn() ) ) { |
| 111 | + $wgOut->showErrorPage( 'blanknologin', 'unblanknologintext' ); |
111 | 112 | return false; |
112 | 113 | } |
113 | 114 | if ( $summary == '' ) { |
— | — | @@ -136,8 +137,8 @@ |
137 | 138 | } |
138 | 139 | |
139 | 140 | function PureWikiDeletionAlternateEditHook ( $editPage ) { |
140 | | - global $wgUser, $wgOut; |
141 | | - if ( $wgUser->isLoggedIn() ) { |
| 141 | + global $wgUser, $wgOut, $wgPureWikiDeletionLoginRequiredToUnblank; |
| 142 | + if ( $wgUser->isLoggedIn() || !$wgPureWikiDeletionLoginRequiredToUnblank ) { |
142 | 143 | return true; |
143 | 144 | } |
144 | 145 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -147,6 +148,6 @@ |
148 | 149 | if ( !$result ) { |
149 | 150 | return true; |
150 | 151 | } |
151 | | - $wgOut->showErrorPage( 'blanknologin', 'blanknologintext' ); |
| 152 | + $wgOut->showErrorPage( 'blanknologin', 'unblanknologintext' ); |
152 | 153 | return false; |
153 | 154 | } |
\ No newline at end of file |
Index: trunk/extensions/PureWikiDeletion/PureWikiDeletion.hooks.php |
— | — | @@ -137,7 +137,7 @@ |
138 | 138 | } |
139 | 139 | |
140 | 140 | public static function PureWikiDeletionEditHook( &$editPage ) { |
141 | | - global $wgLang; |
| 141 | + global $wgLang, $wgUser; |
142 | 142 | wfLoadExtensionMessages( 'PureWikiDeletion' ); |
143 | 143 | $dbr = wfGetDB( DB_SLAVE ); |
144 | 144 | $blank_page_id = $editPage->getArticle()->getID(); |
— | — | @@ -170,7 +170,7 @@ |
171 | 171 | , $result->blank_parent_id ) ); |
172 | 172 | $editPage->editFormPageTop .= $html; |
173 | 173 | |
174 | | - if ($blanking_user->getOption( 'watchunblank' )){ |
| 174 | + if ($wgUser->getOption( 'watchunblank' )){ |
175 | 175 | $editPage->watchthis = true; |
176 | 176 | } |
177 | 177 | |