r49006 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49005‎ | r49006 | r49007 >
Date:15:27, 29 March 2009
Author:siebrand
Status:deferred
Tags:
Comment:
* allow for restriction type localisation in 'security-desc-LS'
* comment out message for commented out use of 'security-desc-CR'
Modified paths:
  • /trunk/extensions/SimpleSecurity/SimpleSecurity.i18n.php (modified) (history)
  • /trunk/extensions/SimpleSecurity/SimpleSecurity_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SimpleSecurity/SimpleSecurity_body.php
@@ -309,8 +309,14 @@
310310 # - also update info array with page-restriction that apply to this title (LS), and rules in effect for this user (CR)
311311 if ( $deny ) {
312312 foreach ( $restriction as $action => $reqgroups ) {
313 - if ( !is_array( $reqgroups ) ) $reqgroups = array( $reqgroups );
314 - if ( $updateInfo ) $this->info['LS'][] = array( $action, $reqgroups, wfMsg( 'security-desc-LS', strtolower( $type ), $data ) );
 313+ if ( !is_array( $reqgroups ) ) {
 314+ $reqgroups = array( $reqgroups );
 315+ }
 316+
 317+ if ( $updateInfo ) {
 318+ $this->info['LS'][] = array( $action, $reqgroups, wfMsg( 'security-desc-LS', wfMsg( 'security-type-' . strtolower( $type ) ), $data ) );
 319+ }
 320+
315321 if ( !in_array( 'sysop', $groups ) && !array_intersect( $groups, $reqgroups ) ) {
316322 foreach ( $rights as $i => $right ) if ( $right === $action ) unset( $rights[$i] );
317323 # $this->info['CR'][] = array($action, $reqgroups, wfMsg('security-desc-CR'));
Index: trunk/extensions/SimpleSecurity/SimpleSecurity.i18n.php
@@ -24,10 +24,12 @@
2525 'security-inforestrict' => '$1 is restricted to $2',
2626 'security-desc-LS' => "''(applies because this page is in the '''$2 $1''')''",
2727 'security-desc-PR' => "''(set from the '''protect tab''')''",
28 - 'security-desc-CR' => "''(this restriction is '''in effect now''')''",
 28+ #'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",
3030 'security-manygroups' => 'groups $1 and $2',
3131 'security-unchain' => 'Modify actions individually',
 32+ 'security-type-category' => 'category',
 33+ 'security-type-namespace' => 'namespace',
3234 );
3335
3436 /** Message documentation (Message documentation)

Status & tagging log