r107238 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107237‎ | r107238 | r107239 >
Date:23:17, 24 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Remove unused global and variables

Fix one unreachable debug line as it's after a return false
Modified paths:
  • /trunk/extensions/OpenStackManager/OpenStackNovaController.php (modified) (history)
  • /trunk/extensions/OpenStackManager/OpenStackNovaRole.php (modified) (history)
  • /trunk/extensions/OpenStackManager/OpenStackNovaSudoer.php (modified) (history)
  • /trunk/extensions/OpenStackManager/OpenStackNovaUser.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaPuppetGroup.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaSudoer.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php
@@ -563,7 +563,6 @@
564564 */
565565 function tryCreateSubmit( $formData, $entryPoint = 'internal' ) {
566566 global $wgOut;
567 - global $wgOpenStackManagerPuppetOptions;
568567
569568 $domain = OpenStackNovaDomain::getDomainByName( $formData['domain'] );
570569 if ( !$domain ) {
@@ -659,7 +658,7 @@
660659 * @return bool
661660 */
662661 function tryConfigureSubmit( $formData, $entryPoint = 'internal' ) {
663 - global $wgOut, $wgOpenStackManagerPuppetOptions;
 662+ global $wgOut;
664663
665664 $instance = $this->adminNova->getInstance( $formData['instanceid'] );
666665 $host = $instance->getHost();
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php
@@ -337,7 +337,7 @@
338338 $this->notInRole( 'netadmin' );
339339 return false;
340340 }
341 - $group_keys = array();
 341+
342342 $info = array();
343343 $securityGroups = $this->adminNova->getSecurityGroups();
344344 foreach ( $securityGroups as $securityGroup ) {
@@ -628,7 +628,7 @@
629629 * @return bool
630630 */
631631 function tryRemoveRuleSubmit( $formData, $entryPoint = 'internal' ) {
632 - global $wgOut, $wgUser;
 632+ global $wgOut;
633633
634634 $project = $formData['project'];
635635 $fromport = $formData['fromport'];
Index: trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php
@@ -663,8 +663,7 @@
664664 $wgOut->addWikiMsg( 'openstackmanager-nonexistenthost' );
665665 }
666666 $out = '<br />';
667 - $sk = $wgOut->getSkin();
668 - $out .= $sk->link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) );
 667+ $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) );
669668 $wgOut->addHTML( $out );
670669 return true;
671670 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaPuppetGroup.php
@@ -506,7 +506,6 @@
507507 */
508508 function tryCreateSubmit( $formData, $entryPoint = 'internal' ) {
509509 global $wgOut;
510 - global $wgOpenStackManagerDefaultSecurityGroupRules;
511510
512511 $success = OpenStackNovaPuppetGroup::addGroup( $formData['puppetgroupname'], $formData['puppetgroupposition'] );
513512 if ( $success ) {
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSudoer.php
@@ -280,7 +280,7 @@
281281 * @return bool
282282 */
283283 function tryCreateSubmit( $formData, $entryPoint = 'internal' ) {
284 - global $wgOut, $wgUser;
 284+ global $wgOut;
285285
286286 if ( $formData['users'] ) {
287287 $users = explode( ',', $formData['users'] );
Index: trunk/extensions/OpenStackManager/OpenStackNovaSudoer.php
@@ -123,8 +123,6 @@
124124 */
125125 function modifySudoer( $users, $hosts, $commands, $options ) {
126126 global $wgAuth;
127 - global $wgOpenStackManagerLDAPUser, $wgOpenStackManagerLDAPUserPassword;
128 - global $wgOpenStackManagerLDAPDomain;
129127
130128 $sudoer = array();
131129 foreach ( $users as $user ) {
Index: trunk/extensions/OpenStackManager/OpenStackNovaRole.php
@@ -200,7 +200,6 @@
201201 * @return array
202202 */
203203 static function getAllGlobalRoles() {
204 - global $wgAuth;
205204 global $wgOpenStackManagerLDAPGlobalRoles;
206205
207206 OpenStackNovaLdapConnection::connect();
Index: trunk/extensions/OpenStackManager/OpenStackNovaUser.php
@@ -451,8 +451,8 @@
452452
453453 if ( $wgOpenStackManagerLDAPUseUidAsNamingAttribute ) {
454454 if ( $writeloc == '' ) {
 455+ $auth->printDebug( "Trying to set the userdn, but write location isn't set.", NONSENSITIVE );
455456 return false;
456 - $auth->printDebug( "Trying to set the userdn, but write location isn't set.", NONSENSITIVE );
457457 } else {
458458 $userdn = 'uid=' . $username . ',' . $writeloc;
459459 $auth->printDebug( "Using uid as the naming attribute, dn is: $userdn", NONSENSITIVE );
Index: trunk/extensions/OpenStackManager/OpenStackNovaController.php
@@ -208,6 +208,7 @@
209209 * Get the console output of an instance
210210 *
211211 * @param $instanceid string
 212+ * @return string
212213 */
213214 function getConsoleOutput( $instanceid ) {
214215 $consoleOutput = $this->novaConnection->get_console_output( $instanceid, array() );

Status & tagging log