r77783 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77782‎ | r77783 | r77784 >
Date:08:57, 5 December 2010
Author:dantman
Status:deferred (Comments)
Tags:
Comment:
Updates, fixes, and cleanup for Sudo extension.
Modified paths:
  • /trunk/extensions/Sudo/SpecialSudo.php (modified) (history)
  • /trunk/extensions/Sudo/Sudo.i18n.php (modified) (history)
  • /trunk/extensions/Sudo/Sudo.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Sudo/Sudo.php
@@ -2,7 +2,7 @@
33 /**
44 * Sudo
55 * @package Sudo
6 - * @author Daniel Friesen (http://mediawiki.org/wiki/User:Dantman) <wiki@danielfriesen.name>
 6+ * @author Daniel Friesen (http://mediawiki.org/wiki/User:Dantman) <mediawiki@danielfriesen.name>
77 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
88 *
99 * This program is free software; you can redistribute it and/or
@@ -22,11 +22,11 @@
2323
2424 if( !defined( 'MEDIAWIKI' ) ) die( "This is an extension to the MediaWiki package and cannot be run standalone." );
2525
26 -$wgExtensionCredits['otjher'][] = array (
 26+$wgExtensionCredits['other'][] = array (
2727 'name' => 'Sudo',
28 - 'url' => 'http://wiki-tools.com/wiki/Sudo',
29 - 'version' => '0.1a',
30 - 'author' => "[http://mediawiki.org/wiki/User:Dantman Daniel Friesen] [mailto:Daniel%20Friesen%20%3Cwiki@danielfriesen.name%3E <dan_the_man@telus.net>]",
 28+ 'url' => 'http://mediawiki.org/wiki/Extension:Sudo',
 29+ 'version' => '0.2',
 30+ 'author' => "[http://mediawiki.org/wiki/User:Dantman Daniel Friesen] [mailto:Daniel%20Friesen%20%3Cmediawiki@danielfriesen.name%3E <mediawiki@danielfriesen.name>]",
3131 'description' => "Allows sudoers to login as other users."
3232 );
3333
Index: trunk/extensions/Sudo/SpecialSudo.php
@@ -2,7 +2,7 @@
33 /**
44 * Sudo
55 * @package Sudo
6 - * @author Daniel Friesen (http://www.wikia.com/wiki/User:Dantman) <wiki@danielfriesen.name>
 6+ * @author Daniel Friesen (http://mediawiki.org/wiki/User:Dantman) <mediawiki@danielfriesen.name>
77 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
88 *
99 * This program is free software; you can redistribute it and/or
@@ -26,7 +26,7 @@
2727 protected $mMode, $mSkin, $mTarget, $mReason, $mErrors;
2828
2929 function __construct() {
30 - SpecialPage::SpecialPage( 'Sudo', 'sudo' );
 30+ parent::__construct( 'Sudo', 'sudo' );
3131 wfLoadExtensionMessages('Sudo');
3232 }
3333
@@ -150,7 +150,7 @@
151151 global $wgOut, $wgUser;
152152 $u = User::newFromName( $this->mTarget );
153153 if( is_null($u) ) return $this->addError('sudo-error-sudo-invaliduser');
154 - if( User::isIP($u->getName()) || User::isIPv6($u->getName()) ) return $this->addError('sudo-error-ip');
 154+ if( User::isIP($u->getName()) ) return $this->addError('sudo-error-ip');
155155 if( $u->isAnon() ) return $this->addError('sudo-error-sudo-nonexistant');
156156 if( $u->getName() === $wgUser->getName() ) return $this->addError('sudo-error-sudo-self');
157157
Index: trunk/extensions/Sudo/Sudo.i18n.php
@@ -2,7 +2,7 @@
33 /**
44 * Sudo
55 * @package Sudo
6 - * @author Daniel Friesen (http://www.wikia.com/wiki/User:Dantman) <wiki@danielfriesen.name>
 6+ * @author Daniel Friesen (http://mediawiki.org/wiki/User:Dantman) <mediawiki@danielfriesen.name>
77 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
88 *
99 * This program is free software; you can redistribute it and/or
@@ -47,4 +47,5 @@
4848 'sudo-logpagename' => 'Sudo log',
4949 'sudo-logpagetext' => 'This is a log of all uses of sudo.',
5050 'sudo-logentry' => 'sudoed into $2',
 51+ 'right-sudo' => "Login to another user's account",
5152 );

Comments

#Comment by Reedy (talk | contribs)   09:17, 5 December 2010

Maybe add some braces to those one line if's to meet the mw coding guidelines? :)

Status & tagging log