r107244 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107243‎ | r107244 | r107245 >
Date:23:44, 24 December 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Bye bye $wgOut, bye bye
Modified paths:
  • /trunk/extensions/OpenStackManager/special/SpecialNova.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaKey.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaProject.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaPuppetGroup.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaRole.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaSudoer.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaVolume.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php
@@ -75,12 +75,12 @@
7676 * @return bool
7777 */
7878 function createInstance() {
79 - global $wgRequest, $wgOut;
 79+ global $wgRequest;
8080 global $wgOpenStackManagerPuppetOptions;
8181 global $wgOpenStackManagerInstanceDefaultImage;
8282
8383 $this->setHeaders();
84 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createinstance' ) );
 84+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createinstance' ) );
8585
8686 $project = $wgRequest->getText( 'project' );
8787 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
@@ -246,11 +246,11 @@
247247 * @return bool
248248 */
249249 function configureInstance() {
250 - global $wgRequest, $wgOut;
 250+ global $wgRequest;
251251 global $wgOpenStackManagerPuppetOptions;
252252
253253 $this->setHeaders();
254 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-configureinstance' ) );
 254+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-configureinstance' ) );
255255
256256 $project = $wgRequest->getText( 'project' );
257257 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
@@ -273,7 +273,7 @@
274274 if ( $wgOpenStackManagerPuppetOptions['enabled'] ) {
275275 $host = OpenStackNovaHost::getHostByInstanceId( $instanceid );
276276 if ( ! $host ) {
277 - $wgOut->addWikiMsg( 'openstackmanager-nonexistenthost' );
 277+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistenthost' );
278278 return false;
279279 }
280280 $puppetinfo = $host->getPuppetConfiguration();
@@ -349,10 +349,10 @@
350350 * @return bool
351351 */
352352 function deleteInstance() {
353 - global $wgOut, $wgRequest;
 353+ global $wgRequest;
354354
355355 $this->setHeaders();
356 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deleteinstance' ) );
 356+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deleteinstance' ) );
357357
358358 $project = $wgRequest->getText( 'project' );
359359 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
@@ -361,7 +361,7 @@
362362 }
363363 $instanceid = $wgRequest->getText( 'instanceid' );
364364 if ( ! $wgRequest->wasPosted() ) {
365 - $wgOut->addWikiMsg( 'openstackmanager-deleteinstancequestion', $instanceid );
 365+ $this->getOutput()->addWikiMsg( 'openstackmanager-deleteinstancequestion', $instanceid );
366366 }
367367 $instanceInfo = array();
368368 $instanceInfo['instanceid'] = array(
@@ -392,10 +392,10 @@
393393 * @return bool
394394 */
395395 function rebootInstance() {
396 - global $wgOut, $wgRequest;
 396+ global $wgRequest;
397397
398398 $this->setHeaders();
399 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-rebootinstance' ) );
 399+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-rebootinstance' ) );
400400
401401 $project = $wgRequest->getText( 'project' );
402402 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
@@ -404,7 +404,7 @@
405405 }
406406 $instanceid = $wgRequest->getText( 'instanceid' );
407407 if ( ! $wgRequest->wasPosted() ) {
408 - $wgOut->addWikiMsg( 'openstackmanager-rebootinstancequestion', $instanceid );
 408+ $this->getOutput()->addWikiMsg( 'openstackmanager-rebootinstancequestion', $instanceid );
409409 }
410410 $instanceInfo = array();
411411 $instanceInfo['instanceid'] = array(
@@ -434,10 +434,10 @@
435435 * @return bool
436436 */
437437 function getConsoleOutput() {
438 - global $wgOut, $wgRequest;
 438+ global $wgRequest;
439439
440440 $this->setHeaders();
441 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-consoleoutput' ) );
 441+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-consoleoutput' ) );
442442
443443 $project = $wgRequest->getText( 'project' );
444444 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
@@ -448,17 +448,15 @@
449449 $consoleOutput = $this->userNova->getConsoleOutput( $instanceid );
450450 $out = Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) );
451451 $out .= Html::element( 'pre', array(), $consoleOutput );
452 - $wgOut->addHTML( $out );
 452+ $this->getOutput()->addHTML( $out );
453453 }
454454
455455 /**
456456 * @return void
457457 */
458458 function listInstances() {
459 - global $wgOut;
460 -
461459 $this->setHeaders();
462 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-instancelist' ) );
 460+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-instancelist' ) );
463461
464462 $userProjects = $this->userLDAP->getProjects();
465463
@@ -552,7 +550,7 @@
553551 }
554552 }
555553
556 - $wgOut->addHTML( $out );
 554+ $this->getOutput()->addHTML( $out );
557555 }
558556
559557 /**
@@ -561,11 +559,9 @@
562560 * @return bool
563561 */
564562 function tryCreateSubmit( $formData, $entryPoint = 'internal' ) {
565 - global $wgOut;
566 -
567563 $domain = OpenStackNovaDomain::getDomainByName( $formData['domain'] );
568564 if ( !$domain ) {
569 - $wgOut->addWikiMsg( 'openstackmanager-invaliddomain' );
 565+ $this->getOutput()->addWikiMsg( 'openstackmanager-invaliddomain' );
570566 return true;
571567 }
572568 $instance = $this->userNova->createInstance( $formData['instancename'], $formData['imageType'], '', $formData['instanceType'], $formData['availabilityZone'], $formData['groups'] );
@@ -573,23 +569,23 @@
574570 $host = OpenStackNovaHost::addHost( $instance, $domain, $this->getPuppetInfo( $formData ) );
575571
576572 if ( $host ) {
577 - $title = Title::newFromText( $wgOut->getPageTitle() );
 573+ $title = Title::newFromText( $this->getOutput()->getPageTitle() );
578574 $job = new OpenStackNovaHostJob( $title, array( 'instanceid' => $instance->getInstanceId() ) );
579575 $job->insert();
580 - $wgOut->addWikiMsg( 'openstackmanager-createdinstance', $instance->getInstanceID(), $instance->getImageId(), $host->getFullyQualifiedHostName() );
 576+ $this->getOutput()->addWikiMsg( 'openstackmanager-createdinstance', $instance->getInstanceID(), $instance->getImageId(), $host->getFullyQualifiedHostName() );
581577 } else {
582578 $this->userNova->terminateInstance( $instance->getInstanceId() );
583 - $wgOut->addWikiMsg( 'openstackmanager-createfailedldap' );
 579+ $this->getOutput()->addWikiMsg( 'openstackmanager-createfailedldap' );
584580 }
585581 # TODO: also add puppet
586582 } else {
587 - $wgOut->addWikiMsg( 'openstackmanager-createinstancefailed' );
 583+ $this->getOutput()->addWikiMsg( 'openstackmanager-createinstancefailed' );
588584 }
589585
590586 $out = '<br />';
591587 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) );
592588
593 - $wgOut->addHTML( $out );
 589+ $this->getOutput()->addHTML( $out );
594590 return true;
595591 }
596592
@@ -599,11 +595,9 @@
600596 * @return bool
601597 */
602598 function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) {
603 - global $wgOut;
604 -
605599 $instance = $this->adminNova->getInstance( $formData['instanceid'] );
606600 if ( ! $instance ) {
607 - $wgOut->addWikiMsg( 'openstackmanager-nonexistanthost' );
 601+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistanthost' );
608602 return true;
609603 }
610604 $instancename = $instance->getInstanceName();
@@ -613,18 +607,18 @@
614608 $instance->deleteArticle();
615609 $success = OpenStackNovaHost::deleteHostByInstanceId( $instanceid );
616610 if ( $success ) {
617 - $wgOut->addWikiMsg( 'openstackmanager-deletedinstance', $instanceid );
 611+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedinstance', $instanceid );
618612 } else {
619 - $wgOut->addWikiMsg( 'openstackmanager-deletedinstance-faileddns', $instancename, $instanceid );
 613+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedinstance-faileddns', $instancename, $instanceid );
620614 }
621615 } else {
622 - $wgOut->addWikiMsg( 'openstackmanager-deleteinstancefailed' );
 616+ $this->getOutput()->addWikiMsg( 'openstackmanager-deleteinstancefailed' );
623617 }
624618
625619 $out = '<br />';
626620 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) );
627621
628 - $wgOut->addHTML( $out );
 622+ $this->getOutput()->addHTML( $out );
629623 return true;
630624 }
631625
@@ -634,20 +628,18 @@
635629 * @return bool
636630 */
637631 function tryRebootSubmit( $formData, $entryPoint = 'internal' ) {
638 - global $wgOut;
639 -
640632 $instanceid = $formData['instanceid'];
641633 $success = $this->userNova->rebootInstance( $instanceid );
642634 if ( $success ) {
643 - $wgOut->addWikiMsg( 'openstackmanager-rebootedinstance', $instanceid );
 635+ $this->getOutput()->addWikiMsg( 'openstackmanager-rebootedinstance', $instanceid );
644636 } else {
645 - $wgOut->addWikiMsg( 'openstackmanager-rebootinstancefailed' );
 637+ $this->getOutput()->addWikiMsg( 'openstackmanager-rebootinstancefailed' );
646638 }
647639
648640 $out = '<br />';
649641 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) );
650642
651 - $wgOut->addHTML( $out );
 643+ $this->getOutput()->addHTML( $out );
652644 return true;
653645 }
654646
@@ -657,26 +649,24 @@
658650 * @return bool
659651 */
660652 function tryConfigureSubmit( $formData, $entryPoint = 'internal' ) {
661 - global $wgOut;
662 -
663653 $instance = $this->adminNova->getInstance( $formData['instanceid'] );
664654 $host = $instance->getHost();
665655 if ( $host ) {
666656 $success = $host->modifyPuppetConfiguration( $this->getPuppetInfo( $formData ) );
667657 if ( $success ) {
668658 $instance->editArticle();
669 - $wgOut->addWikiMsg( 'openstackmanager-modifiedinstance' );
 659+ $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedinstance' );
670660 } else {
671 - $wgOut->addWikiMsg( 'openstackmanager-modifyinstancefailed' );
 661+ $this->getOutput()->addWikiMsg( 'openstackmanager-modifyinstancefailed' );
672662 }
673663 } else {
674 - $wgOut->addWikiMsg( 'openstackmanager-nonexistanthost' );
 664+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistanthost' );
675665 }
676666
677667 $out = '<br />';
678668 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) );
679669
680 - $wgOut->addHTML( $out );
 670+ $this->getOutput()->addHTML( $out );
681671 return true;
682672 }
683673
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php
@@ -54,10 +54,10 @@
5555 * @return bool
5656 */
5757 function createSecurityGroup() {
58 - global $wgRequest, $wgOut;
 58+ global $wgRequest;
5959
6060 $this->setHeaders();
61 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createsecuritygroup' ) );
 61+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createsecuritygroup' ) );
6262
6363 $project = $wgRequest->getText( 'project' );
6464 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
@@ -103,10 +103,10 @@
104104 * @return bool
105105 */
106106 function configureSecurityGroup() {
107 - global $wgRequest, $wgOut;
 107+ global $wgRequest;
108108
109109 $this->setHeaders();
110 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-configuresecuritygroup' ) );
 110+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-configuresecuritygroup' ) );
111111
112112 $securitygroupname = $wgRequest->getText( 'groupname' );
113113 $project = $wgRequest->getText( 'project' );
@@ -154,10 +154,10 @@
155155 * @return bool
156156 */
157157 function deleteSecurityGroup() {
158 - global $wgOut, $wgRequest;
 158+ global $wgRequest;
159159
160160 $this->setHeaders();
161 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletesecuritygroup' ) );
 161+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletesecuritygroup' ) );
162162
163163 $project = $wgRequest->getText( 'project' );
164164 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
@@ -166,7 +166,7 @@
167167 }
168168 $securitygroupname = $wgRequest->getText( 'groupname' );
169169 if ( ! $wgRequest->wasPosted() ) {
170 - $wgOut->addWikiMsg( 'openstackmanager-deletesecuritygroup-confirm', $securitygroupname );
 170+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletesecuritygroup-confirm', $securitygroupname );
171171 }
172172 $securityGroupInfo = array();
173173 $securityGroupInfo['groupname'] = array(
@@ -197,10 +197,8 @@
198198 * @return bool
199199 */
200200 function listSecurityGroups() {
201 - global $wgOut;
202 -
203201 $this->setHeaders();
204 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-securitygrouplist' ) );
 202+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-securitygrouplist' ) );
205203
206204 $userProjects = $this->userLDAP->getProjects();
207205
@@ -319,7 +317,7 @@
320318 }
321319 }
322320
323 - $wgOut->addHTML( $out );
 321+ $this->getOutput()->addHTML( $out );
324322 return true;
325323 }
326324
@@ -327,10 +325,10 @@
328326 * @return bool
329327 */
330328 function addRule() {
331 - global $wgOut, $wgRequest;
 329+ global $wgRequest;
332330
333331 $this->setHeaders();
334 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addrule' ) );
 332+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addrule' ) );
335333
336334 $project = $wgRequest->getText( 'project' );
337335 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
@@ -419,10 +417,10 @@
420418 * @return bool
421419 */
422420 function removeRule() {
423 - global $wgOut, $wgRequest;
 421+ global $wgRequest;
424422
425423 $this->setHeaders();
426 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removerule' ) );
 424+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removerule' ) );
427425
428426 $project = $wgRequest->getText( 'project' );
429427 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
@@ -431,7 +429,7 @@
432430 }
433431 $securitygroupname = $wgRequest->getText( 'groupname' );
434432 if ( ! $wgRequest->wasPosted() ) {
435 - $wgOut->addWikiMsg( 'openstackmanager-removerule-confirm', $securitygroupname );
 433+ $this->getOutput()->addWikiMsg( 'openstackmanager-removerule-confirm', $securitygroupname );
436434 }
437435 $securityGroupInfo = array();
438436 $securityGroupInfo['groupname'] = array(
@@ -493,8 +491,6 @@
494492 * @return bool
495493 */
496494 function tryCreateSubmit( $formData, $entryPoint = 'internal' ) {
497 - global $wgOut;
498 -
499495 $project = $formData['project'];
500496 $groupname = $formData['groupname'];
501497 $description = $formData['description'];
@@ -502,15 +498,15 @@
503499 $this->userNova = new OpenStackNovaController( $userCredentials, $project );
504500 $securitygroup = $this->userNova->createSecurityGroup( $groupname, $description );
505501 if ( $securitygroup ) {
506 - $wgOut->addWikiMsg( 'openstackmanager-createdsecuritygroup' );
 502+ $this->getOutput()->addWikiMsg( 'openstackmanager-createdsecuritygroup' );
507503 } else {
508 - $wgOut->addWikiMsg( 'openstackmanager-createsecuritygroupfailed' );
 504+ $this->getOutput()->addWikiMsg( 'openstackmanager-createsecuritygroupfailed' );
509505 }
510506
511507 $out = '<br />';
512508 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsecuritygrouplist' ) );
513509
514 - $wgOut->addHTML( $out );
 510+ $this->getOutput()->addHTML( $out );
515511 return true;
516512 }
517513
@@ -520,29 +516,27 @@
521517 * @return bool
522518 */
523519 function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) {
524 - global $wgOut;
525 -
526520 $project = $formData['project'];
527521 $userCredentials = $this->userLDAP->getCredentials();
528522 $this->userNova = new OpenStackNovaController( $userCredentials, $project );
529523 $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'], $project );
530524 if ( !$securitygroup ) {
531 - $wgOut->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' );
 525+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' );
532526 return true;
533527 }
534528 $groupname = $securitygroup->getGroupName();
535529 $success = $this->userNova->deleteSecurityGroup( $groupname );
536530 if ( $success ) {
537531 # TODO: Ensure group isn't being used
538 - $wgOut->addWikiMsg( 'openstackmanager-deletedsecuritygroup' );
 532+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedsecuritygroup' );
539533 } else {
540 - $wgOut->addWikiMsg( 'openstackmanager-deletesecuritygroupfailed' );
 534+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletesecuritygroupfailed' );
541535 }
542536
543537 $out = '<br />';
544538 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsecuritygrouplist' ) );
545539
546 - $wgOut->addHTML( $out );
 540+ $this->getOutput()->addHTML( $out );
547541 return true;
548542 }
549543
@@ -552,8 +546,6 @@
553547 * @return bool
554548 */
555549 function tryConfigureSubmit( $formData, $entryPoint = 'internal' ) {
556 - global $wgOut;
557 -
558550 $project = $formData['project'];
559551 $groupname = $formData['groupname'];
560552 $description = $formData['description'];
@@ -562,18 +554,18 @@
563555 # This isn't a supported function in the API for now. Leave this action out for now
564556 $success = $this->userNova->modifySecurityGroup( $groupname, array( 'description' => $description ) );
565557 if ( $success ) {
566 - $wgOut->addWikiMsg( 'openstackmanager-modifiedgroup' );
 558+ $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedgroup' );
567559 } else {
568 - $wgOut->addWikiMsg( 'openstackmanager-modifygroupfailed' );
 560+ $this->getOutput()->addWikiMsg( 'openstackmanager-modifygroupfailed' );
569561 }
570562 } else {
571 - $wgOut->addWikiMsg( 'openstackmanager-nonexistantgroup' );
 563+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantgroup' );
572564 }
573565
574566 $out = '<br />';
575567 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsecuritygrouplist' ) );
576568
577 - $wgOut->addHTML( $out );
 569+ $this->getOutput()->addHTML( $out );
578570 return true;
579571 }
580572
@@ -583,8 +575,6 @@
584576 * @return bool
585577 */
586578 function tryAddRuleSubmit( $formData, $entryPoint = 'internal' ) {
587 - global $wgOut;
588 -
589579 $project = $formData['project'];
590580 $fromport = $formData['fromport'];
591581 $toport = $formData['toport'];
@@ -603,22 +593,22 @@
604594 $this->userNova = new OpenStackNovaController( $userCredentials, $project );
605595 $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'], $project );
606596 if ( ! $securitygroup ) {
607 - $wgOut->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' );
 597+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' );
608598 return false;
609599 }
610600 $groupname = $securitygroup->getGroupName();
611601 $success = $this->userNova->addSecurityGroupRule( $groupname, $fromport, $toport, $protocol, $ranges, $groups );
612602 if ( $success ) {
613603 # TODO: Ensure group isn't being used
614 - $wgOut->addWikiMsg( 'openstackmanager-addedrule' );
 604+ $this->getOutput()->addWikiMsg( 'openstackmanager-addedrule' );
615605 } else {
616 - $wgOut->addWikiMsg( 'openstackmanager-addrulefailed' );
 606+ $this->getOutput()->addWikiMsg( 'openstackmanager-addrulefailed' );
617607 }
618608
619609 $out = '<br />';
620610 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsecuritygrouplist' ) );
621611
622 - $wgOut->addHTML( $out );
 612+ $this->getOutput()->addHTML( $out );
623613 return true;
624614 }
625615
@@ -628,8 +618,6 @@
629619 * @return bool
630620 */
631621 function tryRemoveRuleSubmit( $formData, $entryPoint = 'internal' ) {
632 - global $wgOut;
633 -
634622 $project = $formData['project'];
635623 $fromport = $formData['fromport'];
636624 $toport = $formData['toport'];
@@ -651,22 +639,22 @@
652640 $this->userNova = new OpenStackNovaController( $userCredentials, $project );
653641 $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'], $project );
654642 if ( ! $securitygroup ) {
655 - $wgOut->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' );
 643+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' );
656644 return false;
657645 }
658646 $groupname = $securitygroup->getGroupName();
659647 $success = $this->userNova->removeSecurityGroupRule( $groupname, $fromport, $toport, $protocol, $ranges, $groups );
660648 if ( $success ) {
661649 # TODO: Ensure group isn't being used
662 - $wgOut->addWikiMsg( 'openstackmanager-removedrule' );
 650+ $this->getOutput()->addWikiMsg( 'openstackmanager-removedrule' );
663651 } else {
664 - $wgOut->addWikiMsg( 'openstackmanager-removerulefailed' );
 652+ $this->getOutput()->addWikiMsg( 'openstackmanager-removerulefailed' );
665653 }
666654
667655 $out = '<br />';
668656 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsecuritygrouplist' ) );
669657
670 - $wgOut->addHTML( $out );
 658+ $this->getOutput()->addHTML( $out );
671659 return true;
672660 }
673661 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php
@@ -51,10 +51,10 @@
5252 * @return bool
5353 */
5454 function allocateAddress() {
55 - global $wgRequest, $wgOut;
 55+ global $wgRequest;
5656
5757 $this->setHeaders();
58 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-allocateaddress' ) );
 58+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-allocateaddress' ) );
5959
6060 $project = $wgRequest->getText( 'project' );
6161 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
@@ -64,7 +64,7 @@
6565 $userCredentials = $this->userLDAP->getCredentials();
6666 $this->userNova = new OpenStackNovaController( $userCredentials, $project );
6767 if ( ! $wgRequest->wasPosted() ) {
68 - $wgOut->addWikiMsg( 'openstackmanager-allocateaddress-confirm', $project );
 68+ $this->getOutput()->addWikiMsg( 'openstackmanager-allocateaddress-confirm', $project );
6969 }
7070 $addressInfo = array();
7171 $addressInfo['project'] = array(
@@ -91,10 +91,10 @@
9292 * @return bool
9393 */
9494 function releaseAddress() {
95 - global $wgOut, $wgRequest;
 95+ global $wgRequest;
9696
9797 $this->setHeaders();
98 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-releaseaddress' ) );
 98+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-releaseaddress' ) );
9999
100100 $project = $wgRequest->getText( 'project' );
101101 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
@@ -105,7 +105,7 @@
106106 $this->userNova = new OpenStackNovaController( $userCredentials, $project );
107107 $ip = $wgRequest->getText( 'ip' );
108108 if ( ! $wgRequest->wasPosted() ) {
109 - $wgOut->addWikiMsg( 'openstackmanager-releaseaddress-confirm', $ip );
 109+ $this->getOutput()->addWikiMsg( 'openstackmanager-releaseaddress-confirm', $ip );
110110 }
111111 $addressInfo = array();
112112 $addressInfo['project'] = array(
@@ -137,10 +137,10 @@
138138 * @return bool
139139 */
140140 function associateAddress() {
141 - global $wgOut, $wgRequest;
 141+ global $wgRequest;
142142
143143 $this->setHeaders();
144 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-associateaddress' ) );
 144+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-associateaddress' ) );
145145
146146 $ip = $wgRequest->getText( 'ip' );
147147 $project = $wgRequest->getText( 'project' );
@@ -194,10 +194,10 @@
195195 * @return bool
196196 */
197197 function disassociateAddress() {
198 - global $wgOut, $wgRequest;
 198+ global $wgRequest;
199199
200200 $this->setHeaders();
201 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-disassociateaddress' ) );
 201+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-disassociateaddress' ) );
202202
203203 $project = $wgRequest->getText( 'project' );
204204 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
@@ -208,7 +208,7 @@
209209 $this->userNova = new OpenStackNovaController( $userCredentials, $project );
210210 $ip = $wgRequest->getText( 'ip' );
211211 if ( ! $wgRequest->wasPosted() ) {
212 - $wgOut->addWikiMsg( 'openstackmanager-disassociateaddress-confirm', $ip );
 212+ $this->getOutput()->addWikiMsg( 'openstackmanager-disassociateaddress-confirm', $ip );
213213 }
214214 $addressInfo = array();
215215 $addressInfo['project'] = array(
@@ -240,10 +240,10 @@
241241 * @return bool
242242 */
243243 function addHost() {
244 - global $wgOut, $wgRequest;
 244+ global $wgRequest;
245245
246246 $this->setHeaders();
247 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addhost' ) );
 247+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addhost' ) );
248248
249249 $project = $wgRequest->getText( 'project' );
250250 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
@@ -299,10 +299,10 @@
300300 * @return bool
301301 */
302302 function removeHost() {
303 - global $wgOut, $wgRequest;
 303+ global $wgRequest;
304304
305305 $this->setHeaders();
306 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removehost' ) );
 306+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removehost' ) );
307307
308308 $project = $wgRequest->getText( 'project' );
309309 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
@@ -315,7 +315,7 @@
316316 $domain = $wgRequest->getText( 'domain' );
317317 $hostname = $wgRequest->getText( 'hostname' );
318318 if ( ! $wgRequest->wasPosted() ) {
319 - $wgOut->addWikiMsg( 'openstackmanager-removehost-confirm', $hostname, $ip );
 319+ $this->getOutput()->addWikiMsg( 'openstackmanager-removehost-confirm', $hostname, $ip );
320320 }
321321 $addressInfo = array();
322322 $addressInfo['project'] = array(
@@ -357,10 +357,8 @@
358358 * @return bool
359359 */
360360 function listAddresses() {
361 - global $wgOut;
362 -
363361 $this->setHeaders();
364 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addresslist' ) );
 362+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addresslist' ) );
365363
366364 $userProjects = $this->userLDAP->getProjects();
367365 $out = '';
@@ -448,7 +446,7 @@
449447 array( 'id' => 'novainstancelist', 'class' => 'wikitable sortable collapsible' ), $projectOut );
450448 }
451449 }
452 - $wgOut->addHTML( $out );
 450+ $this->getOutput()->addHTML( $out );
453451
454452 return true;
455453 }
@@ -459,18 +457,16 @@
460458 * @return bool
461459 */
462460 function tryAllocateSubmit( $formData, $entryPoint = 'internal' ) {
463 - global $wgOut;
464 -
465461 $address = $this->userNova->allocateAddress();
466462 if ( ! $address ) {
467 - $wgOut->addWikiMsg( 'openstackmanager-allocateaddressfailed' );
 463+ $this->getOutput()->addWikiMsg( 'openstackmanager-allocateaddressfailed' );
468464 return true;
469465 }
470466 $ip = $address->getPublicIP();
471 - $wgOut->addWikiMsg( 'openstackmanager-allocatedaddress', $ip );
 467+ $this->getOutput()->addWikiMsg( 'openstackmanager-allocatedaddress', $ip );
472468 $out = '<br />';
473469 $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) );
474 - $wgOut->addHTML( $out );
 470+ $this->getOutput()->addHTML( $out );
475471
476472 return true;
477473 }
@@ -481,32 +477,30 @@
482478 * @return bool
483479 */
484480 function tryReleaseSubmit( $formData, $entryPoint = 'internal' ) {
485 - global $wgOut;
486 -
487481 $ip = $formData['ip'];
488482 #TODO: Instead of throwing an error when host exist or the IP
489483 # is associated, remove all host entries and disassociate the IP
490484 # then release the address
491485 $hosts = OpenStackNovaHost::getHostsByIP( $ip );
492486 if ( $hosts ) {
493 - $wgOut->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip );
 487+ $this->getOutput()->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip );
494488 return true;
495489 }
496490 $address = $this->adminNova->getAddress( $ip );
497491 if ( $address->getInstanceId() ) {
498 - $wgOut->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip );
 492+ $this->getOutput()->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip );
499493 return true;
500494 }
501495 $success = $this->userNova->releaseAddress( $ip );
502496 if ( $success ) {
503 - $wgOut->addWikiMsg( 'openstackmanager-releasedaddress', $ip );
 497+ $this->getOutput()->addWikiMsg( 'openstackmanager-releasedaddress', $ip );
504498 } else {
505 - $wgOut->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip );
 499+ $this->getOutput()->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip );
506500 }
507501
508502 $out = '<br />';
509503 $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) );
510 - $wgOut->addHTML( $out );
 504+ $this->getOutput()->addHTML( $out );
511505
512506 return true;
513507 }
@@ -517,20 +511,18 @@
518512 * @return bool
519513 */
520514 function tryAssociateSubmit( $formData, $entryPoint = 'internal' ) {
521 - global $wgOut;
522 -
523515 $instanceid = $formData['instanceid'];
524516 $ip = $formData['ip'];
525517 $address = $this->userNova->associateAddress( $instanceid, $ip );
526518 if ( $address ) {
527 - $wgOut->addWikiMsg( 'openstackmanager-associatedaddress', $ip, $instanceid );
 519+ $this->getOutput()->addWikiMsg( 'openstackmanager-associatedaddress', $ip, $instanceid );
528520 } else {
529 - $wgOut->addWikiMsg( 'openstackmanager-associatedaddressfailed', $ip, $instanceid );
 521+ $this->getOutput()->addWikiMsg( 'openstackmanager-associatedaddressfailed', $ip, $instanceid );
530522 }
531523
532524 $out = '<br />';
533525 $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) );
534 - $wgOut->addHTML( $out );
 526+ $this->getOutput()->addHTML( $out );
535527
536528 return true;
537529 }
@@ -541,19 +533,17 @@
542534 * @return bool
543535 */
544536 function tryDisassociateSubmit( $formData, $entryPoint = 'internal' ) {
545 - global $wgOut;
546 -
547537 $ip = $formData['ip'];
548538 $address = $this->userNova->disassociateAddress( $ip );
549539 if ( $address ) {
550 - $wgOut->addWikiMsg( 'openstackmanager-disassociatedaddress', $ip );
 540+ $this->getOutput()->addWikiMsg( 'openstackmanager-disassociatedaddress', $ip );
551541 } else {
552 - $wgOut->addWikiMsg( 'openstackmanager-disassociatedaddressfailed', $ip );
 542+ $this->getOutput()->addWikiMsg( 'openstackmanager-disassociatedaddressfailed', $ip );
553543 }
554544
555545 $out = '<br />';
556546 $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) );
557 - $wgOut->addHTML( $out );
 547+ $this->getOutput()->addHTML( $out );
558548
559549 return true;
560550 }
@@ -564,17 +554,15 @@
565555 * @return bool
566556 */
567557 function tryAddHostSubmit( $formData, $entryPoint = 'internal' ) {
568 - global $wgOut;
569 -
570558 $ip = $formData['ip'];
571559 $project = $formData['project'];
572560 $address = $this->adminNova->getAddress( $ip );
573561 if ( ! $address ) {
574 - $wgOut->addWikiMsg( 'openstackmanager-invalidaddress', $ip );
 562+ $this->getOutput()->addWikiMsg( 'openstackmanager-invalidaddress', $ip );
575563 return true;
576564 }
577565 if ( $address->getProject() != $project ) {
578 - $wgOut->addWikiMsg( 'openstackmanager-invalidaddressforproject', $ip );
 566+ $this->getOutput()->addWikiMsg( 'openstackmanager-invalidaddressforproject', $ip );
579567 return true;
580568 }
581569 $hostname = $formData['hostname'];
@@ -587,51 +575,49 @@
588576 # We need to add an arecord, if the arecord doesn't already exist
589577 $success = $hostbyname->addARecord( $ip );
590578 if ( $success ) {
591 - $wgOut->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip );
 579+ $this->getOutput()->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip );
592580 } else {
593 - $wgOut->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname );
 581+ $this->getOutput()->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname );
594582 }
595583 } elseif ( $hostbyip ) {
596584 # We need to add an associateddomain, if the associateddomain doesn't already exist
597585 $success = $hostbyip->addAssociatedDomain( $hostname . '.' . $domain->getFullyQualifiedDomainName() );
598586 if ( $success ) {
599 - $wgOut->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip );
 587+ $this->getOutput()->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip );
600588 } else {
601 - $wgOut->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname );
 589+ $this->getOutput()->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname );
602590 }
603591 } else {
604592 # This is a new host entry
605593 $host = OpenStackNovaHost::addPublicHost( $hostname, $ip, $domain );
606594 if ( $host ) {
607 - $wgOut->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip );
 595+ $this->getOutput()->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip );
608596 } else {
609 - $wgOut->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname );
 597+ $this->getOutput()->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname );
610598 }
611599 }
612 -
 600+$this->getOutput();
613601 $out = '<br />';
614602 $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) );
615 - $wgOut->addHTML( $out );
 603+ $this->getOutput()->addHTML( $out );
616604 return true;
617605 }
618606
619607 /**
620 - * @param $formData
 608+ * @param $formData
621609 * @param string $entryPoint
622610 * @return bool
623611 */
624612 function tryRemoveHostSubmit( $formData, $entryPoint = 'internal' ) {
625 - global $wgOut;
626 -
627613 $ip = $formData['ip'];
628614 $project = $formData['project'];
629615 $address = $this->adminNova->getAddress( $ip );
630616 if ( ! $address ) {
631 - $wgOut->addWikiMsg( 'openstackmanager-invalidaddress', $ip );
 617+ $this->getOutput()->addWikiMsg( 'openstackmanager-invalidaddress', $ip );
632618 return true;
633619 }
634620 if ( $address->getProject() != $project ) {
635 - $wgOut->addWikiMsg( 'openstackmanager-invalidaddressforproject', $ip );
 621+ $this->getOutput()->addWikiMsg( 'openstackmanager-invalidaddressforproject', $ip );
636622 return true;
637623 }
638624 $hostname = $formData['hostname'];
@@ -645,25 +631,25 @@
646632 # We need to keep the host, but remove the fqdn
647633 $success = $host->deleteAssociatedDomain( $fqdn );
648634 if ( $success ) {
649 - $wgOut->addWikiMsg( 'openstackmanager-removedhost', $hostname, $ip );
 635+ $this->getOutput()->addWikiMsg( 'openstackmanager-removedhost', $hostname, $ip );
650636 } else {
651 - $wgOut->addWikiMsg( 'openstackmanager-removehostfailed', $ip, $hostname );
 637+ $this->getOutput()->addWikiMsg( 'openstackmanager-removehostfailed', $ip, $hostname );
652638 }
653639 } else {
654640 # We need to remove the host entry
655641 $success = OpenStackNovaHost::deleteHost( $hostname, $domain );
656642 if ( $success ) {
657 - $wgOut->addWikiMsg( 'openstackmanager-removedhost', $hostname, $ip );
 643+ $this->getOutput()->addWikiMsg( 'openstackmanager-removedhost', $hostname, $ip );
658644 } else {
659 - $wgOut->addWikiMsg( 'openstackmanager-removehostfailed', $ip, $hostname );
 645+ $this->getOutput()->addWikiMsg( 'openstackmanager-removehostfailed', $ip, $hostname );
660646 }
661647 }
662648 } else {
663 - $wgOut->addWikiMsg( 'openstackmanager-nonexistenthost' );
 649+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistenthost' );
664650 }
665651 $out = '<br />';
666652 $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) );
667 - $wgOut->addHTML( $out );
 653+ $this->getOutput()->addHTML( $out );
668654 return true;
669655 }
670656 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaProject.php
@@ -40,14 +40,14 @@
4141 * @return bool
4242 */
4343 function createProject() {
44 - global $wgOut, $wgUser;
 44+ global $wgUser;
4545
4646 $this->setHeaders();
4747 if ( !$this->userCanExecute( $wgUser ) ) {
4848 $this->displayRestrictionError();
4949 return false;
5050 }
51 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createproject' ) );
 51+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createproject' ) );
5252
5353 $projectInfo = array();
5454 $projectInfo['projectname'] = array(
@@ -96,11 +96,11 @@
9797 * @return bool
9898 */
9999 function addMember() {
100 - global $wgRequest, $wgOut;
 100+ global $wgRequest;
101101 global $wgUser;
102102
103103 $this->setHeaders();
104 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addmember' ) );
 104+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addmember' ) );
105105
106106 $project = $wgRequest->getText( 'projectname' );
107107 if ( !$this->userCanExecute( $wgUser ) && !$this->userLDAP->inProject( $project ) ) {
@@ -139,11 +139,11 @@
140140 * @return bool
141141 */
142142 function deleteMember() {
143 - global $wgRequest, $wgOut;
 143+ global $wgRequest;
144144 global $wgUser;
145145
146146 $this->setHeaders();
147 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removemember' ) );
 147+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removemember' ) );
148148
149149 $projectname = $wgRequest->getText( 'projectname' );
150150 if ( !$this->userCanExecute( $wgUser ) && !$this->userLDAP->inProject( $projectname ) ) {
@@ -188,7 +188,7 @@
189189 * @return bool
190190 */
191191 function deleteProject() {
192 - global $wgOut, $wgRequest;
 192+ global $wgRequest;
193193 global $wgUser;
194194
195195 $this->setHeaders();
@@ -196,11 +196,11 @@
197197 $this->displayRestrictionError();
198198 return false;
199199 }
200 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deleteproject' ) );
 200+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deleteproject' ) );
201201
202202 $project = $wgRequest->getText( 'projectname' );
203203 if ( ! $wgRequest->wasPosted() ) {
204 - $wgOut->addWikiMsg( 'openstackmanager-removeprojectconfirm', $project );
 204+ $this->getOutput()->addWikiMsg( 'openstackmanager-removeprojectconfirm', $project );
205205 }
206206 $projectInfo = array();
207207 $projectInfo['projectname'] = array(
@@ -226,11 +226,9 @@
227227 * @return void
228228 */
229229 function listProjects() {
230 - global $wgOut;
231 -
232230 $this->setHeaders();
233 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-projectlist' ) );
234 - $wgOut->addModuleStyles( 'ext.openstack' );
 231+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-projectlist' ) );
 232+ $this->getOutput()->addModuleStyles( 'ext.openstack' );
235233
236234 $out = '';
237235
@@ -299,7 +297,7 @@
300298 $out .= Html::rawElement( 'table', array( 'class' => 'wikitable sortable collapsible' ), $projectsOut );
301299 }
302300
303 - $wgOut->addHTML( $out );
 301+ $this->getOutput()->addHTML( $out );
304302 }
305303
306304 /**
@@ -308,12 +306,11 @@
309307 * @return bool
310308 */
311309 function tryCreateSubmit( $formData, $entryPoint = 'internal' ) {
312 - global $wgOut;
313310 global $wgOpenStackManagerDefaultSecurityGroupRules;
314311
315312 $success = OpenStackNovaProject::createProject( $formData['projectname'] );
316313 if ( ! $success ) {
317 - $wgOut->addWikiMsg( 'openstackmanager-createprojectfailed' );
 314+ $this->getOutput()->addWikiMsg( 'openstackmanager-createprojectfailed' );
318315 return true;
319316 }
320317 $project = OpenStackNovaProject::getProjectByName( $formData['projectname'] );
@@ -373,11 +370,11 @@
374371 # Reset connection to default
375372 $this->adminNova->configureConnection();
376373 $project->editArticle();
377 - $wgOut->addWikiMsg( 'openstackmanager-createdproject' );
 374+ $this->getOutput()->addWikiMsg( 'openstackmanager-createdproject' );
378375
379376 $out = '<br />';
380377 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backprojectlist' ) );
381 - $wgOut->addHTML( $out );
 378+ $this->getOutput()->addHTML( $out );
382379
383380 return true;
384381 }
@@ -388,20 +385,18 @@
389386 * @return bool
390387 */
391388 function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) {
392 - global $wgOut;
393 -
394389 $success = OpenStackNovaProject::deleteProject( $formData['projectname'] );
395390 if ( $success ) {
396391 $project = OpenStackNovaProject::getProjectByName( $formData['projectname'] );
397392 $project->deleteArticle();
398 - $wgOut->addWikiMsg( 'openstackmanager-deletedproject' );
 393+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedproject' );
399394 } else {
400 - $wgOut->addWikiMsg( 'openstackmanager-deleteprojectfailed' );
 395+ $this->getOutput()->addWikiMsg( 'openstackmanager-deleteprojectfailed' );
401396 }
402397
403398 $out = '<br />';
404399 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backprojectlist' ) );
405 - $wgOut->addHTML( $out );
 400+ $this->getOutput()->addHTML( $out );
406401
407402 return true;
408403 }
@@ -412,23 +407,21 @@
413408 * @return bool
414409 */
415410 function tryAddMemberSubmit( $formData, $entryPoint = 'internal' ) {
416 - global $wgOut;
417 -
418411 $project = new OpenStackNovaProject( $formData['projectname'] );
419412 $members = explode( ',', $formData['member'] );
420413 foreach ( $members as $member ) {
421414 $success = $project->addMember( $member );
422415 if ( $success ) {
423416 $project->editArticle();
424 - $wgOut->addWikiMsg( 'openstackmanager-addedto', $formData['member'], $formData['projectname'] );
 417+ $this->getOutput()->addWikiMsg( 'openstackmanager-addedto', $formData['member'], $formData['projectname'] );
425418 } else {
426 - $wgOut->addWikiMsg( 'openstackmanager-failedtoadd', $formData['member'], $formData['projectname'] );
 419+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoadd', $formData['member'], $formData['projectname'] );
427420 }
428421 }
429422
430423 $out = '<br />';
431424 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backprojectlist' ) );
432 - $wgOut->addHTML( $out );
 425+ $this->getOutput()->addHTML( $out );
433426
434427 return true;
435428 }
@@ -439,26 +432,24 @@
440433 * @return bool
441434 */
442435 function tryDeleteMemberSubmit( $formData, $entryPoint = 'internal' ) {
443 - global $wgOut;
444 -
445436 $project = OpenStackNovaProject::getProjectByName( $formData['projectname'] );
446437 if ( ! $project ) {
447 - $wgOut->addWikiMsg( 'openstackmanager-nonexistentproject' );
 438+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistentproject' );
448439 return true;
449440 }
450441 foreach ( $formData['members'] as $member ) {
451442 $success = $project->deleteMember( $member );
452443 if ( $success ) {
453444 $project->editArticle();
454 - $wgOut->addWikiMsg( 'openstackmanager-removedfrom', $member, $formData['projectname'] );
 445+ $this->getOutput()->addWikiMsg( 'openstackmanager-removedfrom', $member, $formData['projectname'] );
455446 } else {
456 - $wgOut->addWikiMsg( 'openstackmanager-failedtoremove', $member, $formData['projectname'] );
 447+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoremove', $member, $formData['projectname'] );
457448 }
458449 }
459450 $out = '<br />';
460451
461452 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backprojectlist' ) );
462 - $wgOut->addHTML( $out );
 453+ $this->getOutput()->addHTML( $out );
463454
464455 return true;
465456 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php
@@ -53,10 +53,8 @@
5454 * @return bool
5555 */
5656 function createDomain() {
57 - global $wgOut;
58 -
5957 $this->setHeaders();
60 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createdomain' ) );
 58+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createdomain' ) );
6159
6260 $domainInfo = array();
6361 $domainInfo['domainname'] = array(
@@ -100,14 +98,14 @@
10199 * @return bool
102100 */
103101 function deleteDomain() {
104 - global $wgOut, $wgRequest;
 102+ global $wgRequest;
105103
106104 $this->setHeaders();
107 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletedomain' ) );
 105+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletedomain' ) );
108106
109107 $domainname = $wgRequest->getText( 'domainname' );
110108 if ( ! $wgRequest->wasPosted() ) {
111 - $wgOut->addWikiMsg( 'openstackmanager-deletedomain-confirm', $domainname );
 109+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedomain-confirm', $domainname );
112110 }
113111 $domainInfo = array();
114112 $domainInfo['domainname'] = array(
@@ -133,10 +131,8 @@
134132 * @return void
135133 */
136134 function listDomains() {
137 - global $wgOut;
138 -
139135 $this->setHeaders();
140 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-domainlist' ) );
 136+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-domainlist' ) );
141137
142138 $out = '';
143139
@@ -163,7 +159,7 @@
164160 $out .= Html::rawElement( 'table', array( 'class' => 'wikitable sortable collapsible' ), $domainsOut );
165161 }
166162
167 - $wgOut->addHTML( $out );
 163+ $this->getOutput()->addHTML( $out );
168164 }
169165
170166 /**
@@ -172,18 +168,16 @@
173169 * @return bool
174170 */
175171 function tryCreateSubmit( $formData, $entryPoint = 'internal' ) {
176 - global $wgOut;
177 -
178172 $success = OpenStackNovaDomain::createDomain( $formData['domainname'], $formData['fqdn'], $formData['location'] );
179173 if ( ! $success ) {
180 - $wgOut->addWikiMsg( 'openstackmanager-createdomainfailed' );
 174+ $this->getOutput()->addWikiMsg( 'openstackmanager-createdomainfailed' );
181175 return true;
182176 }
183 - $wgOut->addWikiMsg( 'openstackmanager-createddomain' );
 177+ $this->getOutput()->addWikiMsg( 'openstackmanager-createddomain' );
184178
185179 $out = '<br />';
186180 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backdomainlist' ) );
187 - $wgOut->addHTML( $out );
 181+ $this->getOutput()->addHTML( $out );
188182
189183 return true;
190184 }
@@ -194,18 +188,16 @@
195189 * @return bool
196190 */
197191 function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) {
198 - global $wgOut;
199 -
200192 $success = OpenStackNovaDomain::deleteDomain( $formData['domainname'] );
201193 if ( $success ) {
202 - $wgOut->addWikiMsg( 'openstackmanager-deleteddomain' );
 194+ $this->getOutput()->addWikiMsg( 'openstackmanager-deleteddomain' );
203195 } else {
204 - $wgOut->addWikiMsg( 'openstackmanager-failedeleteddomain' );
 196+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedeleteddomain' );
205197 }
206198
207199 $out = '<br />';
208200 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backdomainlist' ) );
209 - $wgOut->addHTML( $out );
 201+ $this->getOutput()->addHTML( $out );
210202
211203 return true;
212204 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaVolume.php
@@ -69,10 +69,10 @@
7070 * @return bool
7171 */
7272 function createVolume() {
73 - global $wgRequest, $wgOut;
 73+ global $wgRequest;
7474
7575 $this->setHeaders();
76 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createvolume' ) );
 76+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createvolume' ) );
7777
7878 $project = $wgRequest->getText( 'project' );
7979 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
@@ -143,10 +143,10 @@
144144 * @return bool
145145 */
146146 function deleteVolume() {
147 - global $wgOut, $wgRequest;
 147+ global $wgRequest;
148148
149149 $this->setHeaders();
150 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletevolume' ) );
 150+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletevolume' ) );
151151
152152 $project = $wgRequest->getText( 'project' );
153153 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
@@ -155,7 +155,7 @@
156156 }
157157 $volumeid = $wgRequest->getText( 'volumeid' );
158158 if ( ! $wgRequest->wasPosted() ) {
159 - $wgOut->addWikiMsg( 'openstackmanager-deletevolumequestion', $volumeid );
 159+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletevolumequestion', $volumeid );
160160 }
161161 $volumeInfo = array();
162162 $volumeInfo['volumeid'] = array(
@@ -186,10 +186,10 @@
187187 * @return bool
188188 */
189189 function attachVolume() {
190 - global $wgRequest, $wgOut;
 190+ global $wgRequest;
191191
192192 $this->setHeaders();
193 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-attachvolume' ) );
 193+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-attachvolume' ) );
194194
195195 $project = $wgRequest->getText( 'project' );
196196 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
@@ -261,10 +261,10 @@
262262 * @return bool
263263 */
264264 function detachVolume() {
265 - global $wgRequest, $wgOut;
 265+ global $wgRequest;
266266
267267 $this->setHeaders();
268 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-detachvolume' ) );
 268+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-detachvolume' ) );
269269
270270 $project = $wgRequest->getText( 'project' );
271271 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
@@ -313,10 +313,8 @@
314314 * @return void
315315 */
316316 function listVolumes() {
317 - global $wgOut;
318 -
319317 $this->setHeaders();
320 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-volumelist' ) );
 318+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-volumelist' ) );
321319
322320 $userProjects = $this->userLDAP->getProjects();
323321
@@ -398,7 +396,7 @@
399397 }
400398 }
401399
402 - $wgOut->addHTML( $out );
 400+ $this->getOutput()->addHTML( $out );
403401 }
404402
405403 /**
@@ -407,19 +405,17 @@
408406 * @return bool
409407 */
410408 function tryCreateSubmit( $formData, $entryPoint = 'internal' ) {
411 - global $wgOut;
412 -
413409 $volume = $this->userNova->createVolume( $formData['availabilityZone'], $formData['volumeSize'], $formData['volumename'], $formData['volumedescription'] );
414410 if ( $volume ) {
415 - $wgOut->addWikiMsg( 'openstackmanager-createdvolume', $volume->getVolumeID() );
 411+ $this->getOutput()->addWikiMsg( 'openstackmanager-createdvolume', $volume->getVolumeID() );
416412 } else {
417 - $wgOut->addWikiMsg( 'openstackmanager-createevolumefailed' );
 413+ $this->getOutput()->addWikiMsg( 'openstackmanager-createevolumefailed' );
418414 }
419415
420416 $out = '<br />';
421417 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backvolumelist' ) );
422418
423 - $wgOut->addHTML( $out );
 419+ $this->getOutput()->addHTML( $out );
424420 return true;
425421 }
426422
@@ -429,25 +425,23 @@
430426 * @return bool
431427 */
432428 function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) {
433 - global $wgOut;
434 -
435429 $volume = $this->adminNova->getVolume( $formData['volumeid'] );
436430 if ( ! $volume ) {
437 - $wgOut->addWikiMsg( 'openstackmanager-nonexistantvolume' );
 431+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantvolume' );
438432 return true;
439433 }
440434 $volumeid = $volume->getVolumeId();
441435 $success = $this->userNova->deleteVolume( $volumeid );
442436 if ( $success ) {
443 - $wgOut->addWikiMsg( 'openstackmanager-deletedvolume', $volumeid );
 437+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedvolume', $volumeid );
444438 } else {
445 - $wgOut->addWikiMsg( 'openstackmanager-deletevolumefailed' );
 439+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletevolumefailed' );
446440 }
447441
448442 $out = '<br />';
449443 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backvolumelist' ) );
450444
451 - $wgOut->addHTML( $out );
 445+ $this->getOutput()->addHTML( $out );
452446 return true;
453447 }
454448
@@ -457,19 +451,17 @@
458452 * @return bool
459453 */
460454 function tryAttachSubmit( $formData, $entryPoint = 'internal' ) {
461 - global $wgOut;
462 -
463455 $success = $this->userNova->attachVolume( $formData['volumeid'], $formData['instanceid'], $formData['device'] );
464456 if ( $success ) {
465 - $wgOut->addWikiMsg( 'openstackmanager-attachedvolume' );
 457+ $this->getOutput()->addWikiMsg( 'openstackmanager-attachedvolume' );
466458 } else {
467 - $wgOut->addWikiMsg( 'openstackmanager-attachvolumefailed' );
 459+ $this->getOutput()->addWikiMsg( 'openstackmanager-attachvolumefailed' );
468460 }
469461
470462 $out = '<br />';
471463 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backvolumelist' ) );
472464
473 - $wgOut->addHTML( $out );
 465+ $this->getOutput()->addHTML( $out );
474466 return true;
475467 }
476468
@@ -479,8 +471,6 @@
480472 * @return bool
481473 */
482474 function tryDetachSubmit( $formData, $entryPoint = 'internal' ) {
483 - global $wgOut;
484 -
485475 if ( isset( $formData['force'] ) && $formData['force'] ) {
486476 $force = true;
487477 } else {
@@ -488,15 +478,15 @@
489479 }
490480 $success = $this->userNova->detachVolume( $formData['volumeid'], $force );
491481 if ( $success ) {
492 - $wgOut->addWikiMsg( 'openstackmanager-detachedvolume' );
 482+ $this->getOutput()->addWikiMsg( 'openstackmanager-detachedvolume' );
493483 } else {
494 - $wgOut->addWikiMsg( 'openstackmanager-detachvolumefailed' );
 484+ $this->getOutput()->addWikiMsg( 'openstackmanager-detachvolumefailed' );
495485 }
496486
497487 $out = '<br />';
498488 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backvolumelist' ) );
499489
500 - $wgOut->addHTML( $out );
 490+ $this->getOutput()->addHTML( $out );
501491 return true;
502492 }
503493
Index: trunk/extensions/OpenStackManager/special/SpecialNovaKey.php
@@ -39,7 +39,7 @@
4040 * @return bool
4141 */
4242 function importKey() {
43 - global $wgRequest, $wgOut;
 43+ global $wgRequest;
4444 global $wgOpenStackManagerNovaKeypairStorage;
4545
4646 $project = '';
@@ -54,7 +54,7 @@
5555 }
5656
5757 $this->setHeaders();
58 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-importkey' ) );
 58+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-importkey' ) );
5959
6060 $keyInfo = array();
6161
@@ -100,11 +100,11 @@
101101 * @return bool
102102 */
103103 function deleteKey() {
104 - global $wgOut, $wgRequest;
 104+ global $wgRequest;
105105 global $wgOpenStackManagerNovaKeypairStorage;
106106
107107 $this->setHeaders();
108 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletekey' ) );
 108+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletekey' ) );
109109
110110 $keyInfo = array();
111111 $hash = '';
@@ -131,8 +131,8 @@
132132 $hash = $wgRequest->getVal( 'hash' );
133133 $keypairs = $this->userLDAP->getKeypairs();
134134 if ( ! $wgRequest->wasPosted() ) {
135 - $wgOut->addHTML( Html::element( 'pre', array(), $keypairs[$hash] ) );
136 - $wgOut->addWikiMsg( 'openstackmanager-deletekeyconfirm' );
 135+ $this->getOutput()->addHTML( Html::element( 'pre', array(), $keypairs[$hash] ) );
 136+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletekeyconfirm' );
137137 }
138138 $keyInfo['hash'] = array(
139139 'type' => 'hidden',
@@ -162,12 +162,11 @@
163163 * @return void
164164 */
165165 function listKeys() {
166 - global $wgOut;
167166 global $wgOpenStackManagerNovaKeypairStorage;
168167
169168 $this->setHeaders();
170 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-keylist' ) );
171 - $wgOut->addModuleStyles( 'ext.openstack' );
 169+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-keylist' ) );
 170+ $this->getOutput()->addModuleStyles( 'ext.openstack' );
172171
173172 $out = '';
174173
@@ -208,10 +207,10 @@
209208 }
210209 $out .= Html::rawElement( 'table', array( 'id' => 'novakeylist', 'class' => 'wikitable' ), $keysOut );
211210 } else {
212 - $wgOut->addWikiMsg( 'openstackmanager-invalidkeypair' );
 211+ $this->getOutput()->addWikiMsg( 'openstackmanager-invalidkeypair' );
213212 }
214213
215 - $wgOut->addHTML( $out );
 214+ $this->getOutput()->addHTML( $out );
216215 }
217216
218217 /**
@@ -220,30 +219,29 @@
221220 * @return bool
222221 */
223222 function tryImportSubmit( $formData, $entryPoint = 'internal' ) {
224 - global $wgOut;
225223 global $wgOpenStackManagerNovaKeypairStorage;
226224
227225 if ( $wgOpenStackManagerNovaKeypairStorage == 'ldap' ) {
228226 $success = $this->userLDAP->importKeypair( $formData['key'] );
229227 if ( ! $success ) {
230 - $wgOut->addWikiMsg( 'openstackmanager-keypairimportfailed' );
 228+ $this->getOutput()->addWikiMsg( 'openstackmanager-keypairimportfailed' );
231229 return true;
232230 }
233 - $wgOut->addWikiMsg( 'openstackmanager-keypairimported' );
 231+ $this->getOutput()->addWikiMsg( 'openstackmanager-keypairimported' );
234232 } elseif ( $wgOpenStackManagerNovaKeypairStorage == 'nova' ) {
235233 # wgOpenStackManagerNovaKeypairStorage == 'nova'
236234 # OpenStack's EC2 API doesn't yet support importing keys, use
237235 # of this option isn't currently recommended
238236 $keypair = $this->userNova->importKeypair( $formData['keyname'], $formData['key'] );
239237
240 - $wgOut->addWikiMsg( 'openstackmanager-keypairimportedfingerprint', $keypair->getKeyName(), $keypair->getKeyFingerprint() );
 238+ $this->getOutput()->addWikiMsg( 'openstackmanager-keypairimportedfingerprint', $keypair->getKeyName(), $keypair->getKeyFingerprint() );
241239 } else {
242 - $wgOut->addWikiMsg( 'openstackmanager-invalidkeypair' );
 240+ $this->getOutput()->addWikiMsg( 'openstackmanager-invalidkeypair' );
243241 }
244242 $out = '<br />';
245243
246244 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backkeylist' ) );
247 - $wgOut->addHTML( $out );
 245+ $this->getOutput()->addHTML( $out );
248246 return true;
249247 }
250248
@@ -253,18 +251,16 @@
254252 * @return bool
255253 */
256254 function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) {
257 - global $wgOut;
258 -
259255 $success = $this->userLDAP->deleteKeypair( $formData['key'] );
260256 if ( $success ) {
261 - $wgOut->addWikiMsg( 'openstackmanager-deletedkey' );
 257+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedkey' );
262258 } else {
263 - $wgOut->addWikiMsg( 'openstackmanager-deletedkeyfailed' );
 259+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedkeyfailed' );
264260 }
265261 $out = '<br />';
266262
267263 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backkeylist' ) );
268 - $wgOut->addHTML( $out );
 264+ $this->getOutput()->addHTML( $out );
269265 return true;
270266 }
271267 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaPuppetGroup.php
@@ -40,14 +40,14 @@
4141 * @return bool
4242 */
4343 function createPuppetGroup() {
44 - global $wgOut, $wgUser;
 44+ global $wgUser;
4545
4646 $this->setHeaders();
4747 if ( !$this->userCanExecute( $wgUser ) ) {
4848 $this->displayRestrictionError();
4949 return false;
5050 }
51 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createpuppetgroup' ) );
 51+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createpuppetgroup' ) );
5252
5353 $puppetGroupInfo = array();
5454 $puppetGroupInfo['puppetgroupname'] = array(
@@ -83,7 +83,7 @@
8484 * @return bool
8585 */
8686 function addPuppetClass() {
87 - global $wgRequest, $wgOut;
 87+ global $wgRequest;
8888 global $wgUser;
8989
9090 $this->setHeaders();
@@ -91,7 +91,7 @@
9292 $this->displayRestrictionError();
9393 return false;
9494 }
95 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addpuppetclass' ) );
 95+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addpuppetclass' ) );
9696
9797 $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
9898 $puppetGroupInfo = array();
@@ -130,7 +130,7 @@
131131 * @return bool
132132 */
133133 function deletePuppetClass() {
134 - global $wgRequest, $wgOut;
 134+ global $wgRequest;
135135 global $wgUser;
136136
137137 $this->setHeaders();
@@ -138,9 +138,9 @@
139139 $this->displayRestrictionError();
140140 return false;
141141 }
142 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removepuppetclass' ) );
 142+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removepuppetclass' ) );
143143 if ( ! $wgRequest->wasPosted() ) {
144 - $wgOut->addWikiMsg( 'openstackmanager-removepuppetclassconfirm' );
 144+ $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetclassconfirm' );
145145 }
146146 $puppetClassId = $wgRequest->getInt( 'puppetclassid' );
147147 $puppetGroupInfo = array();
@@ -168,7 +168,7 @@
169169 * @return bool
170170 */
171171 function addPuppetVar() {
172 - global $wgRequest, $wgOut;
 172+ global $wgRequest;
173173 global $wgUser;
174174
175175 $this->setHeaders();
@@ -176,7 +176,7 @@
177177 $this->displayRestrictionError();
178178 return false;
179179 }
180 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addpuppetvar' ) );
 180+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addpuppetvar' ) );
181181
182182 $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
183183 $puppetGroupInfo = array();
@@ -215,7 +215,7 @@
216216 * @return bool
217217 */
218218 function deletePuppetVar() {
219 - global $wgRequest, $wgOut;
 219+ global $wgRequest;
220220 global $wgUser;
221221
222222 $this->setHeaders();
@@ -223,11 +223,11 @@
224224 $this->displayRestrictionError();
225225 return false;
226226 }
227 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removepuppetvar' ) );
 227+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removepuppetvar' ) );
228228
229229 $puppetVarId = $wgRequest->getText( 'puppetvarid' );
230230 if ( ! $wgRequest->wasPosted() ) {
231 - $wgOut->addWikiMsg( 'openstackmanager-removepuppetvarconfirm' );
 231+ $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetvarconfirm' );
232232 }
233233 $puppetGroupInfo = array();
234234 $puppetGroupInfo['puppetvarid'] = array(
@@ -254,7 +254,7 @@
255255 * @return bool
256256 */
257257 function deletePuppetGroup() {
258 - global $wgOut, $wgRequest;
 258+ global $wgRequest;
259259 global $wgUser;
260260
261261 $this->setHeaders();
@@ -262,11 +262,11 @@
263263 $this->displayRestrictionError();
264264 return false;
265265 }
266 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletepuppetgroup' ) );
 266+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletepuppetgroup' ) );
267267
268268 $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
269269 if ( ! $wgRequest->wasPosted() ) {
270 - $wgOut->addWikiMsg( 'openstackmanager-removepuppetgroupconfirm' );
 270+ $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetgroupconfirm' );
271271 }
272272 $puppetGroupInfo = array();
273273 $puppetGroupInfo['puppetgroupid'] = array(
@@ -292,7 +292,7 @@
293293 * @return bool
294294 */
295295 function modifyPuppetClass() {
296 - global $wgRequest, $wgOut;
 296+ global $wgRequest;
297297 global $wgUser;
298298
299299 $this->setHeaders();
@@ -300,7 +300,7 @@
301301 $this->displayRestrictionError();
302302 return false;
303303 }
304 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-modifypuppetclass' ) );
 304+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetclass' ) );
305305
306306 $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
307307 $puppetClassId = $wgRequest->getInt( 'puppetclassid' );
@@ -349,7 +349,7 @@
350350 * @return bool
351351 */
352352 function modifyPuppetVar() {
353 - global $wgRequest, $wgOut;
 353+ global $wgRequest;
354354 global $wgUser;
355355
356356 $this->setHeaders();
@@ -357,7 +357,7 @@
358358 $this->displayRestrictionError();
359359 return false;
360360 }
361 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-modifypuppetvar' ) );
 361+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetvar' ) );
362362
363363 $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
364364 $puppetVarId = $wgRequest->getInt( 'puppetvarid' );
@@ -406,7 +406,7 @@
407407 * @return bool
408408 */
409409 function modifyPuppetGroup() {
410 - global $wgRequest, $wgOut;
 410+ global $wgRequest;
411411 global $wgUser;
412412
413413 $this->setHeaders();
@@ -414,7 +414,7 @@
415415 $this->displayRestrictionError();
416416 return false;
417417 }
418 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-modifypuppetgroup' ) );
 418+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetgroup' ) );
419419
420420 $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
421421 $puppetGroupPosition = $wgRequest->getInt( 'puppetgroupposition' );
@@ -449,11 +449,9 @@
450450 * @return void
451451 */
452452 function listPuppetGroups() {
453 - global $wgOut;
454 -
455453 $this->setHeaders();
456 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-puppetgrouplist' ) );
457 - $wgOut->addModuleStyles( 'ext.openstack' );
 454+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-puppetgrouplist' ) );
 455+ $this->getOutput()->addModuleStyles( 'ext.openstack' );
458456
459457 $out = '';
460458
@@ -496,7 +494,7 @@
497495 }
498496 }
499497
500 - $wgOut->addHTML( $out );
 498+ $this->getOutput()->addHTML( $out );
501499 }
502500
503501 /**
@@ -505,18 +503,16 @@
506504 * @return bool
507505 */
508506 function tryCreateSubmit( $formData, $entryPoint = 'internal' ) {
509 - global $wgOut;
510 -
511507 $success = OpenStackNovaPuppetGroup::addGroup( $formData['puppetgroupname'], $formData['puppetgroupposition'] );
512508 if ( $success ) {
513 - $wgOut->addWikiMsg( 'openstackmanager-createdpuppetgroup' );
 509+ $this->getOutput()->addWikiMsg( 'openstackmanager-createdpuppetgroup' );
514510 } else {
515 - $wgOut->addWikiMsg( 'openstackmanager-createpuppetgroupfailed' );
 511+ $this->getOutput()->addWikiMsg( 'openstackmanager-createpuppetgroupfailed' );
516512 }
517513
518514 $out = '<br />';
519515 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) );
520 - $wgOut->addHTML( $out );
 516+ $this->getOutput()->addHTML( $out );
521517
522518 return true;
523519 }
@@ -527,18 +523,16 @@
528524 * @return bool
529525 */
530526 function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) {
531 - global $wgOut;
532 -
533527 $success = OpenStackNovaPuppetGroup::deleteGroup( $formData['puppetgroupid'] );
534528 if ( $success ) {
535 - $wgOut->addWikiMsg( 'openstackmanager-deletedpuppetgroup' );
 529+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedpuppetgroup' );
536530 } else {
537 - $wgOut->addWikiMsg( 'openstackmanager-deletepuppetgroupfailed' );
 531+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletepuppetgroupfailed' );
538532 }
539533
540534 $out = '<br />';
541535 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) );
542 - $wgOut->addHTML( $out );
 536+ $this->getOutput()->addHTML( $out );
543537
544538 return true;
545539 }
@@ -549,18 +543,16 @@
550544 * @return bool
551545 */
552546 function tryAddClassSubmit( $formData, $entryPoint = 'internal' ) {
553 - global $wgOut;
554 -
555547 $success = OpenStackNovaPuppetGroup::addClass( $formData['puppetclassname'], $formData['puppetclassposition'], $formData['puppetgroupid'] );
556548 if ( $success ) {
557 - $wgOut->addWikiMsg( 'openstackmanager-addedpuppetclass' );
 549+ $this->getOutput()->addWikiMsg( 'openstackmanager-addedpuppetclass' );
558550 } else {
559 - $wgOut->addWikiMsg( 'openstackmanager-failedtoaddpuppetclass' );
 551+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoaddpuppetclass' );
560552 }
561553
562554 $out = '<br />';
563555 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) );
564 - $wgOut->addHTML( $out );
 556+ $this->getOutput()->addHTML( $out );
565557
566558 return true;
567559 }
@@ -571,18 +563,16 @@
572564 * @return bool
573565 */
574566 function tryDeleteClassSubmit( $formData, $entryPoint = 'internal' ) {
575 - global $wgOut;
576 -
577567 $success = OpenStackNovaPuppetGroup::deleteClass( $formData['puppetclassid'] );
578568 if ( $success ) {
579 - $wgOut->addWikiMsg( 'openstackmanager-deletedpuppetclass' );
 569+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedpuppetclass' );
580570 } else {
581 - $wgOut->addWikiMsg( 'openstackmanager-failedtodeletepuppetclass' );
 571+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedtodeletepuppetclass' );
582572 }
583573 $out = '<br />';
584574
585575 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) );
586 - $wgOut->addHTML( $out );
 576+ $this->getOutput()->addHTML( $out );
587577
588578 return true;
589579 }
@@ -593,18 +583,16 @@
594584 * @return bool
595585 */
596586 function tryAddVarSubmit( $formData, $entryPoint = 'internal' ) {
597 - global $wgOut;
598 -
599587 $success = OpenStackNovaPuppetGroup::addVar( $formData['puppetvarname'], $formData['puppetvarposition'], $formData['puppetgroupid'] );
600588 if ( $success ) {
601 - $wgOut->addWikiMsg( 'openstackmanager-addedpuppetvar' );
 589+ $this->getOutput()->addWikiMsg( 'openstackmanager-addedpuppetvar' );
602590 } else {
603 - $wgOut->addWikiMsg( 'openstackmanager-failedtoaddpuppetvar' );
 591+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoaddpuppetvar' );
604592 }
605593
606594 $out = '<br />';
607595 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) );
608 - $wgOut->addHTML( $out );
 596+ $this->getOutput()->addHTML( $out );
609597
610598 return true;
611599 }
@@ -615,18 +603,16 @@
616604 * @return bool
617605 */
618606 function tryDeleteVarSubmit( $formData, $entryPoint = 'internal' ) {
619 - global $wgOut;
620 -
621607 $success = OpenStackNovaPuppetGroup::deleteVar( $formData['puppetvarid'] );
622608 if ( $success ) {
623 - $wgOut->addWikiMsg( 'openstackmanager-deletedpuppetvar' );
 609+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedpuppetvar' );
624610 } else {
625 - $wgOut->addWikiMsg( 'openstackmanager-failedtodeletepuppetvar' );
 611+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedtodeletepuppetvar' );
626612 }
627613 $out = '<br />';
628614
629615 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) );
630 - $wgOut->addHTML( $out );
 616+ $this->getOutput()->addHTML( $out );
631617
632618 return true;
633619 }
@@ -637,18 +623,16 @@
638624 * @return bool
639625 */
640626 function tryModifyClassSubmit( $formData, $entryPoint = 'internal' ) {
641 - global $wgOut;
642 -
643627 $success = OpenStackNovaPuppetGroup::updateClass( $formData['puppetclassid'], $formData['puppetgroupid'], $formData['puppetclassposition'] );
644628 if ( $success ) {
645 - $wgOut->addWikiMsg( 'openstackmanager-modifiedpuppetclass' );
 629+ $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedpuppetclass' );
646630 } else {
647 - $wgOut->addWikiMsg( 'openstackmanager-failedtomodifypuppetclass' );
 631+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedtomodifypuppetclass' );
648632 }
649633 $out = '<br />';
650634
651635 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) );
652 - $wgOut->addHTML( $out );
 636+ $this->getOutput()->addHTML( $out );
653637
654638 return true;
655639 }
@@ -659,18 +643,16 @@
660644 * @return bool
661645 */
662646 function tryModifyVarSubmit( $formData, $entryPoint = 'internal' ) {
663 - global $wgOut;
664 -
665647 $success = OpenStackNovaPuppetGroup::updateVar( $formData['puppetvarid'], $formData['puppetgroupid'], $formData['puppetvarposition'] );
666648 if ( $success ) {
667 - $wgOut->addWikiMsg( 'openstackmanager-modifiedpuppetvar' );
 649+ $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedpuppetvar' );
668650 } else {
669 - $wgOut->addWikiMsg( 'openstackmanager-failedtomodifypuppetvar' );
 651+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedtomodifypuppetvar' );
670652 }
671653 $out = '<br />';
672654
673655 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) );
674 - $wgOut->addHTML( $out );
 656+ $this->getOutput()->addHTML( $out );
675657
676658 return true;
677659 }
@@ -681,18 +663,16 @@
682664 * @return bool
683665 */
684666 function tryModifyGroupSubmit( $formData, $entryPoint = 'internal' ) {
685 - global $wgOut;
686 -
687667 $success = OpenStackNovaPuppetGroup::updateGroupPosition( $formData['puppetgroupid'], $formData['puppetgroupposition'] );
688668 if ( $success ) {
689 - $wgOut->addWikiMsg( 'openstackmanager-modifiedpuppetgroup' );
 669+ $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedpuppetgroup' );
690670 } else {
691 - $wgOut->addWikiMsg( 'openstackmanager-failedtomodifypuppetgroup' );
 671+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedtomodifypuppetgroup' );
692672 }
693673 $out = '<br />';
694674
695675 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) );
696 - $wgOut->addHTML( $out );
 676+ $this->getOutput()->addHTML( $out );
697677
698678 return true;
699679 }
Index: trunk/extensions/OpenStackManager/special/SpecialNova.php
@@ -6,33 +6,27 @@
77 * @return void
88 */
99 function notLoggedIn() {
10 - global $wgOut;
11 -
1210 $this->setHeaders();
13 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-notloggedin' ) );
14 - $wgOut->addWikiMsg( 'openstackmanager-mustbeloggedin' );
 11+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-notloggedin' ) );
 12+ $this->getOutput()->addWikiMsg( 'openstackmanager-mustbeloggedin' );
1513 }
1614
1715 /**
1816 * @return void
1917 */
2018 function noCredentials() {
21 - global $wgOut;
22 -
2319 $this->setHeaders();
24 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-nonovacred' ) );
25 - $wgOut->addWikiMsg( 'openstackmanager-nonovacred-admincreate' );
 20+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-nonovacred' ) );
 21+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonovacred-admincreate' );
2622 }
2723
2824 /**
2925 * @return void
3026 */
3127 function notInProject() {
32 - global $wgOut;
33 -
3428 $this->setHeaders();
35 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-noaccount' ) );
36 - $wgOut->addWikiMsg( 'openstackmanager-noaccount2' );
 29+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-noaccount' ) );
 30+ $this->getOutput()->addWikiMsg( 'openstackmanager-noaccount2' );
3731 }
3832
3933 /**
@@ -40,18 +34,16 @@
4135 * @return void
4236 */
4337 function notInRole( $role ) {
44 - global $wgOut;
45 -
4638 $this->setHeaders();
4739 if ( $role == 'sysadmin' ) {
48 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-needsysadminrole' ) );
49 - $wgOut->addWikiMsg( 'openstackmanager-needsysadminrole2' );
 40+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-needsysadminrole' ) );
 41+ $this->getOutput()->addWikiMsg( 'openstackmanager-needsysadminrole2' );
5042 } elseif ( $role == 'netadmin' ) {
51 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-neednetadminrole' ) );
52 - $wgOut->addWikiMsg( 'openstackmanager-neednetadminrole2' );
 43+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-neednetadminrole' ) );
 44+ $this->getOutput()->addWikiMsg( 'openstackmanager-neednetadminrole2' );
5345 } elseif ( $role == 'cloudadmin' ) {
54 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-needcloudadminrole' ) );
55 - $wgOut->addWikiMsg( 'openstackmanager-needcloudadminrole2' );
 46+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-needcloudadminrole' ) );
 47+ $this->getOutput()->addWikiMsg( 'openstackmanager-needcloudadminrole2' );
5648 }
5749 }
5850
@@ -62,7 +54,7 @@
6355 * @return bool|string
6456 */
6557 function validateText( $resourcename, $alldata ) {
66 - if ( ! preg_match( "/^[a-z][a-z0-9\-]*$/", $resourcename ) ) {
 58+ if ( ! preg_match( "/^[a-z][a-z0-9-]*$/", $resourcename ) ) {
6759 return Xml::element( 'span', array( 'class' => 'error' ), wfMsg( 'openstackmanager-badresourcename' ) );
6860 } else {
6961 return true;
Index: trunk/extensions/OpenStackManager/special/SpecialNovaRole.php
@@ -36,11 +36,10 @@
3737 * @return bool
3838 */
3939 function addMember() {
40 - global $wgRequest, $wgOut;
41 - global $wgUser;
 40+ global $wgRequest, $wgUser;
4241
4342 $this->setHeaders();
44 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addmember' ) );
 43+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addmember' ) );
4544
4645 $roleInfo = array();
4746 $rolename = $wgRequest->getText( 'rolename' );
@@ -61,7 +60,7 @@
6261 }
6362 }
6463 if ( ! $member_keys ) {
65 - $wgOut->addWikiMsg( 'openstackmanager-nomemberstoadd' );
 64+ $this->getOutput()->addWikiMsg( 'openstackmanager-nomemberstoadd' );
6665 return true;
6766 }
6867 $roleInfo['members'] = array(
@@ -118,11 +117,11 @@
119118 * @return bool
120119 */
121120 function deleteMember() {
122 - global $wgRequest, $wgOut;
 121+ global $wgRequest;
123122 global $wgUser;
124123
125124 $this->setHeaders();
126 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removerolemember' ) );
 125+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removerolemember' ) );
127126
128127 $rolename = $wgRequest->getText( 'rolename' );
129128 $projectname = $wgRequest->getText( 'projectname' );
@@ -154,7 +153,7 @@
155154 }
156155 }
157156 if ( ! $member_keys ) {
158 - $wgOut->addWikiMsg( 'openstackmanager-nomemberstoremove' );
 157+ $this->getOutput()->addWikiMsg( 'openstackmanager-nomemberstoremove' );
159158 return true;
160159 }
161160 $roleInfo = array();
@@ -199,10 +198,8 @@
200199 * @return void
201200 */
202201 function listGlobalRoles() {
203 - global $wgOut;
204 -
205202 $this->setHeaders();
206 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-rolelist' ) );
 203+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-rolelist' ) );
207204
208205 $out = '';
209206
@@ -237,7 +234,7 @@
238235 $out .= Html::rawElement( 'table', array( 'class' => 'wikitable sortable collapsible' ), $rolesOut );
239236 }
240237
241 - $wgOut->addHTML( $out );
 238+ $this->getOutput()->addHTML( $out );
242239 }
243240
244241 /**
@@ -246,13 +243,11 @@
247244 * @return bool
248245 */
249246 function tryAddMemberSubmit( $formData, $entryPoint = 'internal' ) {
250 - global $wgOut;
251 -
252247 $projectname = $formData['projectname'];
253248 if ( $projectname ) {
254249 $project = OpenStackNovaProject::getProjectByName( $projectname );
255250 if ( ! $project ) {
256 - $wgOut->addWikiMsg( 'openstackmanager-nonexistentproject' );
 251+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistentproject' );
257252 return true;
258253 }
259254 $role = OpenStackNovaRole::getProjectRoleByName( $formData['rolename'], $project );
@@ -262,22 +257,22 @@
263258 $members = array( $formData['members'] );
264259 }
265260 if ( ! $role ) {
266 - $wgOut->addWikiMsg( 'openstackmanager-nonexistentrole' );
 261+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistentrole' );
267262 return true;
268263 }
269264 foreach ( $members as $member ) {
270265 $success = $role->addMember( $member );
271266 if ( $success ) {
272 - $wgOut->addWikiMsg( 'openstackmanager-addedto', $member, $formData['rolename'] );
 267+ $this->getOutput()->addWikiMsg( 'openstackmanager-addedto', $member, $formData['rolename'] );
273268 } else {
274 - $wgOut->addWikiMsg( 'openstackmanager-failedtoadd', $member, $formData['rolename'] );
 269+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoadd', $member, $formData['rolename'] );
275270 }
276271 }
277272
278273 $out = '<br />';
279274 $returnto = Title::newFromText( $formData['returnto'] );
280275 $out .= Linker::( $returnto, wfMsgHtml( 'openstackmanager-backprojectlist' ) );
281 - $wgOut->addHTML( $out );
 276+ $this->getOutput()->addHTML( $out );
282277
283278 return true;
284279 }
@@ -288,13 +283,11 @@
289284 * @return bool
290285 */
291286 function tryDeleteMemberSubmit( $formData, $entryPoint = 'internal' ) {
292 - global $wgOut;
293 -
294287 $projectname = $formData['projectname'];
295288 if ( $projectname ) {
296289 $project = OpenStackNovaProject::getProjectByName( $projectname );
297290 if ( ! $project ) {
298 - $wgOut->addWikiMsg( 'openstackmanager-nonexistentproject' );
 291+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistentproject' );
299292 return true;
300293 }
301294 $role = OpenStackNovaRole::getProjectRoleByName( $formData['rolename'], $project );
@@ -302,22 +295,22 @@
303296 $role = OpenStackNovaRole::getGlobalRoleByName( $formData['rolename'] );
304297 }
305298 if ( ! $role ) {
306 - $wgOut->addWikiMsg( 'openstackmanager-nonexistentrole' );
 299+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistentrole' );
307300 return true;
308301 }
309302 foreach ( $formData['members'] as $member ) {
310303 $success = $role->deleteMember( $member );
311304 if ( $success ) {
312 - $wgOut->addWikiMsg( 'openstackmanager-removedfrom', $member, $formData['rolename'] );
 305+ $this->getOutput()->addWikiMsg( 'openstackmanager-removedfrom', $member, $formData['rolename'] );
313306 } else {
314 - $wgOut->addWikiMsg( 'openstackmanager-failedtoremove', $member, $formData['rolename'] );
 307+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoremove', $member, $formData['rolename'] );
315308 }
316309 }
317310
318311 $out = '<br />';
319312 $returnto = Title::newFromText( $formData['returnto'] );
320313 $out .= Linker::( $returnto, wfMsgHtml( 'openstackmanager-backprojectlist' ) );
321 - $wgOut->addHTML( $out );
 314+ $this->getOutput()->addHTML( $out );
322315
323316 return true;
324317 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSudoer.php
@@ -37,10 +37,8 @@
3838 * @return bool
3939 */
4040 function createSudoer() {
41 - global $wgOut;
42 -
4341 $this->setHeaders();
44 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createsudoer' ) );
 42+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createsudoer' ) );
4543
4644 $sudoerInfo = array();
4745 $sudoerInfo['sudoername'] = array(
@@ -101,14 +99,14 @@
102100 * @return bool
103101 */
104102 function deleteSudoer() {
105 - global $wgOut, $wgRequest;
 103+ global $wgRequest;
106104
107105 $this->setHeaders();
108 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletesudoer' ) );
 106+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletesudoer' ) );
109107
110108 $sudoername = $wgRequest->getText( 'sudoername' );
111109 if ( ! $wgRequest->wasPosted() ) {
112 - $wgOut->addWikiMsg( 'openstackmanager-deletesudoer-confirm', $sudoername );
 110+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletesudoer-confirm', $sudoername );
113111 }
114112 $sudoerInfo = array();
115113 $sudoerInfo['sudoername'] = array(
@@ -134,10 +132,10 @@
135133 * @return bool
136134 */
137135 function modifySudoer() {
138 - global $wgRequest, $wgOut;
 136+ global $wgRequest;
139137
140138 $this->setHeaders();
141 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-modifysudoer' ) );
 139+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifysudoer' ) );
142140
143141 $sudoername = $wgRequest->getText( 'sudoername' );
144142 $sudoer = OpenStackNovaSudoer::getSudoerByName( $sudoername );
@@ -209,10 +207,8 @@
210208 * @return void
211209 */
212210 function listSudoers() {
213 - global $wgOut;
214 -
215211 $this->setHeaders();
216 - $wgOut->setPagetitle( wfMsg( 'openstackmanager-sudoerlist' ) );
 212+ $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-sudoerlist' ) );
217213
218214 $out = '';
219215
@@ -271,7 +267,7 @@
272268 $out .= Html::rawElement( 'table', array( 'class' => 'wikitable sortable collapsible' ), $sudoersOut );
273269 }
274270
275 - $wgOut->addHTML( $out );
 271+ $this->getOutput()->addHTML( $out );
276272 }
277273
278274 /**
@@ -280,8 +276,6 @@
281277 * @return bool
282278 */
283279 function tryCreateSubmit( $formData, $entryPoint = 'internal' ) {
284 - global $wgOut;
285 -
286280 if ( $formData['users'] ) {
287281 $users = explode( ',', $formData['users'] );
288282 } else {
@@ -304,14 +298,14 @@
305299 }
306300 $success = OpenStackNovaSudoer::createSudoer( $formData['sudoername'], $users, $hosts, $commands, $options );
307301 if ( ! $success ) {
308 - $wgOut->addWikiMsg( 'openstackmanager-createsudoerfailed' );
 302+ $this->getOutput()->addWikiMsg( 'openstackmanager-createsudoerfailed' );
309303 return true;
310304 }
311 - $wgOut->addWikiMsg( 'openstackmanager-createdsudoer' );
 305+ $this->getOutput()->addWikiMsg( 'openstackmanager-createdsudoer' );
312306
313307 $out = '<br />';
314308 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsudoerlist' ) );
315 - $wgOut->addHTML( $out );
 309+ $this->getOutput()->addHTML( $out );
316310
317311 return true;
318312 }
@@ -322,18 +316,17 @@
323317 * @return bool
324318 */
325319 function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) {
326 - global $wgOut;
327320
328321 $success = OpenStackNovaSudoer::deleteSudoer( $formData['sudoername'] );
329322 if ( $success ) {
330 - $wgOut->addWikiMsg( 'openstackmanager-deletedsudoer' );
 323+ $this->getOutput()->addWikiMsg( 'openstackmanager-deletedsudoer' );
331324 } else {
332 - $wgOut->addWikiMsg( 'openstackmanager-failedeletedsudoer' );
 325+ $this->getOutput()->addWikiMsg( 'openstackmanager-failedeletedsudoer' );
333326 }
334327
335328 $out = '<br />';
336329 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsudoerlist' ) );
337 - $wgOut->addHTML( $out );
 330+ $this->getOutput()->addHTML( $out );
338331
339332 return true;
340333 }
@@ -344,8 +337,6 @@
345338 * @return bool
346339 */
347340 function tryModifySubmit( $formData, $entryPoint = 'internal' ) {
348 - global $wgOut;
349 -
350341 $sudoer = OpenStackNovaSudoer::getSudoerByName( $formData['sudoername'] );
351342 if ( $sudoer ) {
352343 if ( $formData['users'] ) {
@@ -370,17 +361,17 @@
371362 }
372363 $success = $sudoer->modifySudoer( $users, $hosts, $commands, $options );
373364 if ( ! $success ) {
374 - $wgOut->addWikiMsg( 'openstackmanager-modifysudoerfailed' );
 365+ $this->getOutput()->addWikiMsg( 'openstackmanager-modifysudoerfailed' );
375366 return true;
376367 }
377 - $wgOut->addWikiMsg( 'openstackmanager-modifiedsudoer' );
 368+ $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedsudoer' );
378369 } else {
379 - $wgOut->addWikiMsg( 'openstackmanager-nonexistantsudoer' );
 370+ $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantsudoer' );
380371 }
381372
382373 $out = '<br />';
383374 $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsudoerlist' ) );
384 - $wgOut->addHTML( $out );
 375+ $this->getOutput()->addHTML( $out );
385376
386377 return true;
387378 }

Comments

#Comment by Nikerabbit (talk | contribs)   11:29, 25 December 2011

At places you could refactor $this->getOutput() into a local variable.

Status & tagging log