Index: trunk/extensions/SimpleSecurity/SimpleSecurity_body.php |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | $wgRestrictionTypes[] = $k; |
44 | 44 | $wgMessageCache->addMessages( array( "restriction-$k" => $v ) ); |
45 | 45 | } |
46 | | - |
| 46 | + |
47 | 47 | # Ensure the new groups show up in rights management |
48 | 48 | # - note that 1.13 does a strange check in the ProtectionForm::buildSelector |
49 | 49 | # $wgUser->isAllowed($key) where $key is an item from $wgRestrictionLevels |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | ); |
86 | 86 | return true; |
87 | 87 | } |
88 | | - |
| 88 | + |
89 | 89 | /** |
90 | 90 | * Render security info if any restrictions on this title |
91 | 91 | */ |
— | — | @@ -118,7 +118,7 @@ |
119 | 119 | info.style.display = info.style.display ? '' : 'none'; |
120 | 120 | }</script>" |
121 | 121 | ); |
122 | | - |
| 122 | + |
123 | 123 | # Add info-toggle before title and hidden info after title |
124 | 124 | $link = "<a href='javascript:'>" . wfMsg( 'security-info-toggle' ) . "</a>"; |
125 | 125 | $link = "<span onClick='toggleSecurityInfo()'>$link</span>"; |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | $ns = $title->getNamespace(); |
156 | 156 | if ( $ns == NS_SPECIAL ) { |
157 | 157 | list( $name, $par ) = explode( '/', $title->getDBkey() . '/', 2 ); |
158 | | - if ( $par ) $title = Title::newFromText( $par); |
| 158 | + if ( $par ) $title = Title::newFromText( $par ); |
159 | 159 | elseif ( $wgRequest->getVal( 'target' ) ) $title = Title::newFromText( $wgRequest->getVal( 'target' ) ); |
160 | 160 | elseif ( $wgRequest->getVal( 'oldtitle' ) ) $title = Title::newFromText( $wgRequest->getVal( 'oldtitle' ) ); |
161 | 161 | } |
— | — | @@ -187,9 +187,9 @@ |
188 | 188 | # If title is not readable by user, remove the read and move rights |
189 | 189 | if ( !in_array( 'sysop', $groups ) && !$this->userCanReadTitle( $user, $title, $error ) ) { |
190 | 190 | foreach ( $rights as $i => $right ) if ( $right === 'read' || $right === 'move' ) unset( $rights[$i] ); |
191 | | - #$this->info['CR'] = array('read', '', ''); |
| 191 | + # $this->info['CR'] = array('read', '', ''); |
192 | 192 | } |
193 | | - |
| 193 | + |
194 | 194 | return true; |
195 | 195 | } |
196 | 196 | |
— | — | @@ -233,8 +233,8 @@ |
234 | 234 | if ( !is_object( $title ) || in_array( 'sysop', $groups ) ) return true; |
235 | 235 | |
236 | 236 | # Retrieve result from cache if exists (for re-use within current request) |
237 | | - $key = $user->getID().'\x07'.$title->getPrefixedText(); |
238 | | - if (array_key_exists($key, $this->cache)) { |
| 237 | + $key = $user->getID() . '\x07' . $title->getPrefixedText(); |
| 238 | + if ( array_key_exists( $key, $this->cache ) ) { |
239 | 239 | $error = $this->cache[$key][1]; |
240 | 240 | return $this->cache[$key][0]; |
241 | 241 | } |
— | — | @@ -279,8 +279,8 @@ |
280 | 280 | $deny = false; |
281 | 281 | |
282 | 282 | # Validate rule against the title based on its type |
283 | | - switch ($type) { |
284 | | - |
| 283 | + switch ( $type ) { |
| 284 | + |
285 | 285 | case "Category": |
286 | 286 | |
287 | 287 | # If processing first category rule, build a list of cats this article belongs to |
— | — | @@ -295,7 +295,7 @@ |
296 | 296 | |
297 | 297 | $deny = in_array( $data, $cats ); |
298 | 298 | break; |
299 | | - |
| 299 | + |
300 | 300 | case "Namespace": |
301 | 301 | $deny = $data == $title->getNsText(); |
302 | 302 | break; |
— | — | @@ -310,7 +310,7 @@ |
311 | 311 | if ( $updateInfo ) $this->info['LS'][] = array( $action, $reqgroups, wfMsg( 'security-desc-LS', strtolower( $type ), $data ) ); |
312 | 312 | if ( !in_array( 'sysop', $groups ) && !array_intersect( $groups, $reqgroups ) ) { |
313 | 313 | foreach ( $rights as $i => $right ) if ( $right === $action ) unset( $rights[$i] ); |
314 | | - #$this->info['CR'][] = array($action, $reqgroups, wfMsg('security-desc-CR')); |
| 314 | + # $this->info['CR'][] = array($action, $reqgroups, wfMsg('security-desc-CR')); |
315 | 315 | } |
316 | 316 | } |
317 | 317 | } |
Property changes on: trunk/extensions/SimpleSecurity/SimpleSecurity_body.php |
___________________________________________________________________ |
Name: svn:eol-style |
318 | 318 | + native |
Index: trunk/extensions/SimpleSecurity/SimpleSecurity.i18n.php |
— | — | @@ -14,15 +14,15 @@ |
15 | 15 | */ |
16 | 16 | $messages['en'] = array( |
17 | 17 | 'security' => 'Security log', |
18 | | - 'security-desc' => 'Extends the MediaWiki article protection to allow restricting viewing of article content', |
| 18 | + 'security-desc' => 'Extends the MediaWiki page protection to allow restricting viewing of page content', |
19 | 19 | 'security-logpage' => 'Security log', |
20 | 20 | 'security-logpagetext' => 'This is a log of actions blocked by the [http://www.mediawiki.org/wiki/Extension:SimpleSecurity SimpleSecurity extension].', |
21 | 21 | 'security-logentry' => '', # do not translate or duplicate this message to other languages |
22 | 22 | 'badaccess-read' => 'Warning: "$1" is referred to here, but you do not have sufficient permissions to access it.', |
23 | | - 'security-info' => 'There are $1 on this article', |
| 23 | + 'security-info' => 'There are $1 on this page', |
24 | 24 | 'security-info-toggle' => 'security restrictions', |
25 | 25 | 'security-inforestrict' => '$1 is restricted to $2', |
26 | | - 'security-desc-LS' => "''(applies because this article is in the '''$2 $1''')''", |
| 26 | + 'security-desc-LS' => "''(applies because this page is in the '''$2 $1''')''", |
27 | 27 | 'security-desc-PR' => "''(set from the '''protect tab''')''", |
28 | 28 | 'security-desc-CR' => "''(this restriction is '''in effect now''')''", |
29 | 29 | 'security-infosysops' => "No restrictions are in effect because you are a member of the '''sysop''' group", |
Property changes on: trunk/extensions/SimpleSecurity/SimpleSecurity.i18n.php |
___________________________________________________________________ |
Name: svn:eol-style |
30 | 30 | + native |
Index: trunk/extensions/SimpleSecurity/SimpleSecurity.php |
— | — | @@ -6,12 +6,12 @@ |
7 | 7 | * |
8 | 8 | * See http://www.mediawiki.org/Extension:SimpleSecurity for installation and usage details |
9 | 9 | * See http://www.organicdesign.co.nz/Extension_talk:SimpleSecurity.php for development notes and disucssion |
10 | | - * |
| 10 | + * |
11 | 11 | * Version 4.0 started Oct 2007 - new version for modern MediaWiki's using DatabaseFetchHook |
12 | 12 | * Version 4.1 started Jun 2008 - development funded for a slimmed down functional version |
13 | 13 | * Version 4.2 started Aug 2008 - fattened up a bit again - $wgPageRestrictions and security info added in again |
14 | 14 | * Version 4.3 started Mar 2009 - bug fixes and split out to separate class and i18n files |
15 | | - * |
| 15 | + * |
16 | 16 | * @package MediaWiki |
17 | 17 | * @subpackage Extensions |
18 | 18 | * @author Aran Dunkley [http://www.organicdesign.co.nz/nad User:Nad] |