r48882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48881‎ | r48882 | r48883 >
Date:15:29, 26 March 2009
Author:siebrand
Status:deferred
Tags:
Comment:
* article -> page in messages
* stylize.php
* removed trailing whitespace
* svn:eol-style native where not yet set
Modified paths:
  • /trunk/extensions/SimpleSecurity/SimpleSecurity.i18n.php (modified) (history)
  • /trunk/extensions/SimpleSecurity/SimpleSecurity.php (modified) (history)
  • /trunk/extensions/SimpleSecurity/SimpleSecurity_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SimpleSecurity/SimpleSecurity_body.php
@@ -42,7 +42,7 @@
4343 $wgRestrictionTypes[] = $k;
4444 $wgMessageCache->addMessages( array( "restriction-$k" => $v ) );
4545 }
46 -
 46+
4747 # Ensure the new groups show up in rights management
4848 # - note that 1.13 does a strange check in the ProtectionForm::buildSelector
4949 # $wgUser->isAllowed($key) where $key is an item from $wgRestrictionLevels
@@ -84,7 +84,7 @@
8585 );
8686 return true;
8787 }
88 -
 88+
8989 /**
9090 * Render security info if any restrictions on this title
9191 */
@@ -118,7 +118,7 @@
119119 info.style.display = info.style.display ? '' : 'none';
120120 }</script>"
121121 );
122 -
 122+
123123 # Add info-toggle before title and hidden info after title
124124 $link = "<a href='javascript:'>" . wfMsg( 'security-info-toggle' ) . "</a>";
125125 $link = "<span onClick='toggleSecurityInfo()'>$link</span>";
@@ -154,7 +154,7 @@
155155 $ns = $title->getNamespace();
156156 if ( $ns == NS_SPECIAL ) {
157157 list( $name, $par ) = explode( '/', $title->getDBkey() . '/', 2 );
158 - if ( $par ) $title = Title::newFromText( $par);
 158+ if ( $par ) $title = Title::newFromText( $par );
159159 elseif ( $wgRequest->getVal( 'target' ) ) $title = Title::newFromText( $wgRequest->getVal( 'target' ) );
160160 elseif ( $wgRequest->getVal( 'oldtitle' ) ) $title = Title::newFromText( $wgRequest->getVal( 'oldtitle' ) );
161161 }
@@ -187,9 +187,9 @@
188188 # If title is not readable by user, remove the read and move rights
189189 if ( !in_array( 'sysop', $groups ) && !$this->userCanReadTitle( $user, $title, $error ) ) {
190190 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', '', '');
192192 }
193 -
 193+
194194 return true;
195195 }
196196
@@ -233,8 +233,8 @@
234234 if ( !is_object( $title ) || in_array( 'sysop', $groups ) ) return true;
235235
236236 # 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 ) ) {
239239 $error = $this->cache[$key][1];
240240 return $this->cache[$key][0];
241241 }
@@ -279,8 +279,8 @@
280280 $deny = false;
281281
282282 # Validate rule against the title based on its type
283 - switch ($type) {
284 -
 283+ switch ( $type ) {
 284+
285285 case "Category":
286286
287287 # If processing first category rule, build a list of cats this article belongs to
@@ -295,7 +295,7 @@
296296
297297 $deny = in_array( $data, $cats );
298298 break;
299 -
 299+
300300 case "Namespace":
301301 $deny = $data == $title->getNsText();
302302 break;
@@ -310,7 +310,7 @@
311311 if ( $updateInfo ) $this->info['LS'][] = array( $action, $reqgroups, wfMsg( 'security-desc-LS', strtolower( $type ), $data ) );
312312 if ( !in_array( 'sysop', $groups ) && !array_intersect( $groups, $reqgroups ) ) {
313313 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'));
315315 }
316316 }
317317 }
Property changes on: trunk/extensions/SimpleSecurity/SimpleSecurity_body.php
___________________________________________________________________
Name: svn:eol-style
318318 + native
Index: trunk/extensions/SimpleSecurity/SimpleSecurity.i18n.php
@@ -14,15 +14,15 @@
1515 */
1616 $messages['en'] = array(
1717 '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',
1919 'security-logpage' => 'Security log',
2020 'security-logpagetext' => 'This is a log of actions blocked by the [http://www.mediawiki.org/wiki/Extension:SimpleSecurity SimpleSecurity extension].',
2121 'security-logentry' => '', # do not translate or duplicate this message to other languages
2222 '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',
2424 'security-info-toggle' => 'security restrictions',
2525 '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''')''",
2727 'security-desc-PR' => "''(set from the '''protect tab''')''",
2828 'security-desc-CR' => "''(this restriction is '''in effect now''')''",
2929 '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
3030 + native
Index: trunk/extensions/SimpleSecurity/SimpleSecurity.php
@@ -6,12 +6,12 @@
77 *
88 * See http://www.mediawiki.org/Extension:SimpleSecurity for installation and usage details
99 * See http://www.organicdesign.co.nz/Extension_talk:SimpleSecurity.php for development notes and disucssion
10 - *
 10+ *
1111 * Version 4.0 started Oct 2007 - new version for modern MediaWiki's using DatabaseFetchHook
1212 * Version 4.1 started Jun 2008 - development funded for a slimmed down functional version
1313 * Version 4.2 started Aug 2008 - fattened up a bit again - $wgPageRestrictions and security info added in again
1414 * Version 4.3 started Mar 2009 - bug fixes and split out to separate class and i18n files
15 - *
 15+ *
1616 * @package MediaWiki
1717 * @subpackage Extensions
1818 * @author Aran Dunkley [http://www.organicdesign.co.nz/nad User:Nad]

Status & tagging log