Index: trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php |
— | — | @@ -75,12 +75,12 @@ |
76 | 76 | * @return bool |
77 | 77 | */ |
78 | 78 | function createInstance() { |
79 | | - global $wgRequest, $wgOut; |
| 79 | + global $wgRequest; |
80 | 80 | global $wgOpenStackManagerPuppetOptions; |
81 | 81 | global $wgOpenStackManagerInstanceDefaultImage; |
82 | 82 | |
83 | 83 | $this->setHeaders(); |
84 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createinstance' ) ); |
| 84 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createinstance' ) ); |
85 | 85 | |
86 | 86 | $project = $wgRequest->getText( 'project' ); |
87 | 87 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
— | — | @@ -246,11 +246,11 @@ |
247 | 247 | * @return bool |
248 | 248 | */ |
249 | 249 | function configureInstance() { |
250 | | - global $wgRequest, $wgOut; |
| 250 | + global $wgRequest; |
251 | 251 | global $wgOpenStackManagerPuppetOptions; |
252 | 252 | |
253 | 253 | $this->setHeaders(); |
254 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-configureinstance' ) ); |
| 254 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-configureinstance' ) ); |
255 | 255 | |
256 | 256 | $project = $wgRequest->getText( 'project' ); |
257 | 257 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
— | — | @@ -273,7 +273,7 @@ |
274 | 274 | if ( $wgOpenStackManagerPuppetOptions['enabled'] ) { |
275 | 275 | $host = OpenStackNovaHost::getHostByInstanceId( $instanceid ); |
276 | 276 | if ( ! $host ) { |
277 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistenthost' ); |
| 277 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistenthost' ); |
278 | 278 | return false; |
279 | 279 | } |
280 | 280 | $puppetinfo = $host->getPuppetConfiguration(); |
— | — | @@ -349,10 +349,10 @@ |
350 | 350 | * @return bool |
351 | 351 | */ |
352 | 352 | function deleteInstance() { |
353 | | - global $wgOut, $wgRequest; |
| 353 | + global $wgRequest; |
354 | 354 | |
355 | 355 | $this->setHeaders(); |
356 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deleteinstance' ) ); |
| 356 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deleteinstance' ) ); |
357 | 357 | |
358 | 358 | $project = $wgRequest->getText( 'project' ); |
359 | 359 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
— | — | @@ -361,7 +361,7 @@ |
362 | 362 | } |
363 | 363 | $instanceid = $wgRequest->getText( 'instanceid' ); |
364 | 364 | if ( ! $wgRequest->wasPosted() ) { |
365 | | - $wgOut->addWikiMsg( 'openstackmanager-deleteinstancequestion', $instanceid ); |
| 365 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deleteinstancequestion', $instanceid ); |
366 | 366 | } |
367 | 367 | $instanceInfo = array(); |
368 | 368 | $instanceInfo['instanceid'] = array( |
— | — | @@ -392,10 +392,10 @@ |
393 | 393 | * @return bool |
394 | 394 | */ |
395 | 395 | function rebootInstance() { |
396 | | - global $wgOut, $wgRequest; |
| 396 | + global $wgRequest; |
397 | 397 | |
398 | 398 | $this->setHeaders(); |
399 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-rebootinstance' ) ); |
| 399 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-rebootinstance' ) ); |
400 | 400 | |
401 | 401 | $project = $wgRequest->getText( 'project' ); |
402 | 402 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
— | — | @@ -404,7 +404,7 @@ |
405 | 405 | } |
406 | 406 | $instanceid = $wgRequest->getText( 'instanceid' ); |
407 | 407 | if ( ! $wgRequest->wasPosted() ) { |
408 | | - $wgOut->addWikiMsg( 'openstackmanager-rebootinstancequestion', $instanceid ); |
| 408 | + $this->getOutput()->addWikiMsg( 'openstackmanager-rebootinstancequestion', $instanceid ); |
409 | 409 | } |
410 | 410 | $instanceInfo = array(); |
411 | 411 | $instanceInfo['instanceid'] = array( |
— | — | @@ -434,10 +434,10 @@ |
435 | 435 | * @return bool |
436 | 436 | */ |
437 | 437 | function getConsoleOutput() { |
438 | | - global $wgOut, $wgRequest; |
| 438 | + global $wgRequest; |
439 | 439 | |
440 | 440 | $this->setHeaders(); |
441 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-consoleoutput' ) ); |
| 441 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-consoleoutput' ) ); |
442 | 442 | |
443 | 443 | $project = $wgRequest->getText( 'project' ); |
444 | 444 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
— | — | @@ -448,17 +448,15 @@ |
449 | 449 | $consoleOutput = $this->userNova->getConsoleOutput( $instanceid ); |
450 | 450 | $out = Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) ); |
451 | 451 | $out .= Html::element( 'pre', array(), $consoleOutput ); |
452 | | - $wgOut->addHTML( $out ); |
| 452 | + $this->getOutput()->addHTML( $out ); |
453 | 453 | } |
454 | 454 | |
455 | 455 | /** |
456 | 456 | * @return void |
457 | 457 | */ |
458 | 458 | function listInstances() { |
459 | | - global $wgOut; |
460 | | - |
461 | 459 | $this->setHeaders(); |
462 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-instancelist' ) ); |
| 460 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-instancelist' ) ); |
463 | 461 | |
464 | 462 | $userProjects = $this->userLDAP->getProjects(); |
465 | 463 | |
— | — | @@ -552,7 +550,7 @@ |
553 | 551 | } |
554 | 552 | } |
555 | 553 | |
556 | | - $wgOut->addHTML( $out ); |
| 554 | + $this->getOutput()->addHTML( $out ); |
557 | 555 | } |
558 | 556 | |
559 | 557 | /** |
— | — | @@ -561,11 +559,9 @@ |
562 | 560 | * @return bool |
563 | 561 | */ |
564 | 562 | function tryCreateSubmit( $formData, $entryPoint = 'internal' ) { |
565 | | - global $wgOut; |
566 | | - |
567 | 563 | $domain = OpenStackNovaDomain::getDomainByName( $formData['domain'] ); |
568 | 564 | if ( !$domain ) { |
569 | | - $wgOut->addWikiMsg( 'openstackmanager-invaliddomain' ); |
| 565 | + $this->getOutput()->addWikiMsg( 'openstackmanager-invaliddomain' ); |
570 | 566 | return true; |
571 | 567 | } |
572 | 568 | $instance = $this->userNova->createInstance( $formData['instancename'], $formData['imageType'], '', $formData['instanceType'], $formData['availabilityZone'], $formData['groups'] ); |
— | — | @@ -573,23 +569,23 @@ |
574 | 570 | $host = OpenStackNovaHost::addHost( $instance, $domain, $this->getPuppetInfo( $formData ) ); |
575 | 571 | |
576 | 572 | if ( $host ) { |
577 | | - $title = Title::newFromText( $wgOut->getPageTitle() ); |
| 573 | + $title = Title::newFromText( $this->getOutput()->getPageTitle() ); |
578 | 574 | $job = new OpenStackNovaHostJob( $title, array( 'instanceid' => $instance->getInstanceId() ) ); |
579 | 575 | $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() ); |
581 | 577 | } else { |
582 | 578 | $this->userNova->terminateInstance( $instance->getInstanceId() ); |
583 | | - $wgOut->addWikiMsg( 'openstackmanager-createfailedldap' ); |
| 579 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createfailedldap' ); |
584 | 580 | } |
585 | 581 | # TODO: also add puppet |
586 | 582 | } else { |
587 | | - $wgOut->addWikiMsg( 'openstackmanager-createinstancefailed' ); |
| 583 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createinstancefailed' ); |
588 | 584 | } |
589 | 585 | |
590 | 586 | $out = '<br />'; |
591 | 587 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) ); |
592 | 588 | |
593 | | - $wgOut->addHTML( $out ); |
| 589 | + $this->getOutput()->addHTML( $out ); |
594 | 590 | return true; |
595 | 591 | } |
596 | 592 | |
— | — | @@ -599,11 +595,9 @@ |
600 | 596 | * @return bool |
601 | 597 | */ |
602 | 598 | function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) { |
603 | | - global $wgOut; |
604 | | - |
605 | 599 | $instance = $this->adminNova->getInstance( $formData['instanceid'] ); |
606 | 600 | if ( ! $instance ) { |
607 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistanthost' ); |
| 601 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistanthost' ); |
608 | 602 | return true; |
609 | 603 | } |
610 | 604 | $instancename = $instance->getInstanceName(); |
— | — | @@ -613,18 +607,18 @@ |
614 | 608 | $instance->deleteArticle(); |
615 | 609 | $success = OpenStackNovaHost::deleteHostByInstanceId( $instanceid ); |
616 | 610 | if ( $success ) { |
617 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedinstance', $instanceid ); |
| 611 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedinstance', $instanceid ); |
618 | 612 | } else { |
619 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedinstance-faileddns', $instancename, $instanceid ); |
| 613 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedinstance-faileddns', $instancename, $instanceid ); |
620 | 614 | } |
621 | 615 | } else { |
622 | | - $wgOut->addWikiMsg( 'openstackmanager-deleteinstancefailed' ); |
| 616 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deleteinstancefailed' ); |
623 | 617 | } |
624 | 618 | |
625 | 619 | $out = '<br />'; |
626 | 620 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) ); |
627 | 621 | |
628 | | - $wgOut->addHTML( $out ); |
| 622 | + $this->getOutput()->addHTML( $out ); |
629 | 623 | return true; |
630 | 624 | } |
631 | 625 | |
— | — | @@ -634,20 +628,18 @@ |
635 | 629 | * @return bool |
636 | 630 | */ |
637 | 631 | function tryRebootSubmit( $formData, $entryPoint = 'internal' ) { |
638 | | - global $wgOut; |
639 | | - |
640 | 632 | $instanceid = $formData['instanceid']; |
641 | 633 | $success = $this->userNova->rebootInstance( $instanceid ); |
642 | 634 | if ( $success ) { |
643 | | - $wgOut->addWikiMsg( 'openstackmanager-rebootedinstance', $instanceid ); |
| 635 | + $this->getOutput()->addWikiMsg( 'openstackmanager-rebootedinstance', $instanceid ); |
644 | 636 | } else { |
645 | | - $wgOut->addWikiMsg( 'openstackmanager-rebootinstancefailed' ); |
| 637 | + $this->getOutput()->addWikiMsg( 'openstackmanager-rebootinstancefailed' ); |
646 | 638 | } |
647 | 639 | |
648 | 640 | $out = '<br />'; |
649 | 641 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) ); |
650 | 642 | |
651 | | - $wgOut->addHTML( $out ); |
| 643 | + $this->getOutput()->addHTML( $out ); |
652 | 644 | return true; |
653 | 645 | } |
654 | 646 | |
— | — | @@ -657,26 +649,24 @@ |
658 | 650 | * @return bool |
659 | 651 | */ |
660 | 652 | function tryConfigureSubmit( $formData, $entryPoint = 'internal' ) { |
661 | | - global $wgOut; |
662 | | - |
663 | 653 | $instance = $this->adminNova->getInstance( $formData['instanceid'] ); |
664 | 654 | $host = $instance->getHost(); |
665 | 655 | if ( $host ) { |
666 | 656 | $success = $host->modifyPuppetConfiguration( $this->getPuppetInfo( $formData ) ); |
667 | 657 | if ( $success ) { |
668 | 658 | $instance->editArticle(); |
669 | | - $wgOut->addWikiMsg( 'openstackmanager-modifiedinstance' ); |
| 659 | + $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedinstance' ); |
670 | 660 | } else { |
671 | | - $wgOut->addWikiMsg( 'openstackmanager-modifyinstancefailed' ); |
| 661 | + $this->getOutput()->addWikiMsg( 'openstackmanager-modifyinstancefailed' ); |
672 | 662 | } |
673 | 663 | } else { |
674 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistanthost' ); |
| 664 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistanthost' ); |
675 | 665 | } |
676 | 666 | |
677 | 667 | $out = '<br />'; |
678 | 668 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) ); |
679 | 669 | |
680 | | - $wgOut->addHTML( $out ); |
| 670 | + $this->getOutput()->addHTML( $out ); |
681 | 671 | return true; |
682 | 672 | } |
683 | 673 | |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php |
— | — | @@ -54,10 +54,10 @@ |
55 | 55 | * @return bool |
56 | 56 | */ |
57 | 57 | function createSecurityGroup() { |
58 | | - global $wgRequest, $wgOut; |
| 58 | + global $wgRequest; |
59 | 59 | |
60 | 60 | $this->setHeaders(); |
61 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createsecuritygroup' ) ); |
| 61 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createsecuritygroup' ) ); |
62 | 62 | |
63 | 63 | $project = $wgRequest->getText( 'project' ); |
64 | 64 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
— | — | @@ -103,10 +103,10 @@ |
104 | 104 | * @return bool |
105 | 105 | */ |
106 | 106 | function configureSecurityGroup() { |
107 | | - global $wgRequest, $wgOut; |
| 107 | + global $wgRequest; |
108 | 108 | |
109 | 109 | $this->setHeaders(); |
110 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-configuresecuritygroup' ) ); |
| 110 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-configuresecuritygroup' ) ); |
111 | 111 | |
112 | 112 | $securitygroupname = $wgRequest->getText( 'groupname' ); |
113 | 113 | $project = $wgRequest->getText( 'project' ); |
— | — | @@ -154,10 +154,10 @@ |
155 | 155 | * @return bool |
156 | 156 | */ |
157 | 157 | function deleteSecurityGroup() { |
158 | | - global $wgOut, $wgRequest; |
| 158 | + global $wgRequest; |
159 | 159 | |
160 | 160 | $this->setHeaders(); |
161 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletesecuritygroup' ) ); |
| 161 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletesecuritygroup' ) ); |
162 | 162 | |
163 | 163 | $project = $wgRequest->getText( 'project' ); |
164 | 164 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
— | — | @@ -166,7 +166,7 @@ |
167 | 167 | } |
168 | 168 | $securitygroupname = $wgRequest->getText( 'groupname' ); |
169 | 169 | if ( ! $wgRequest->wasPosted() ) { |
170 | | - $wgOut->addWikiMsg( 'openstackmanager-deletesecuritygroup-confirm', $securitygroupname ); |
| 170 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletesecuritygroup-confirm', $securitygroupname ); |
171 | 171 | } |
172 | 172 | $securityGroupInfo = array(); |
173 | 173 | $securityGroupInfo['groupname'] = array( |
— | — | @@ -197,10 +197,8 @@ |
198 | 198 | * @return bool |
199 | 199 | */ |
200 | 200 | function listSecurityGroups() { |
201 | | - global $wgOut; |
202 | | - |
203 | 201 | $this->setHeaders(); |
204 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-securitygrouplist' ) ); |
| 202 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-securitygrouplist' ) ); |
205 | 203 | |
206 | 204 | $userProjects = $this->userLDAP->getProjects(); |
207 | 205 | |
— | — | @@ -319,7 +317,7 @@ |
320 | 318 | } |
321 | 319 | } |
322 | 320 | |
323 | | - $wgOut->addHTML( $out ); |
| 321 | + $this->getOutput()->addHTML( $out ); |
324 | 322 | return true; |
325 | 323 | } |
326 | 324 | |
— | — | @@ -327,10 +325,10 @@ |
328 | 326 | * @return bool |
329 | 327 | */ |
330 | 328 | function addRule() { |
331 | | - global $wgOut, $wgRequest; |
| 329 | + global $wgRequest; |
332 | 330 | |
333 | 331 | $this->setHeaders(); |
334 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addrule' ) ); |
| 332 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addrule' ) ); |
335 | 333 | |
336 | 334 | $project = $wgRequest->getText( 'project' ); |
337 | 335 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
— | — | @@ -419,10 +417,10 @@ |
420 | 418 | * @return bool |
421 | 419 | */ |
422 | 420 | function removeRule() { |
423 | | - global $wgOut, $wgRequest; |
| 421 | + global $wgRequest; |
424 | 422 | |
425 | 423 | $this->setHeaders(); |
426 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removerule' ) ); |
| 424 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removerule' ) ); |
427 | 425 | |
428 | 426 | $project = $wgRequest->getText( 'project' ); |
429 | 427 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
— | — | @@ -431,7 +429,7 @@ |
432 | 430 | } |
433 | 431 | $securitygroupname = $wgRequest->getText( 'groupname' ); |
434 | 432 | if ( ! $wgRequest->wasPosted() ) { |
435 | | - $wgOut->addWikiMsg( 'openstackmanager-removerule-confirm', $securitygroupname ); |
| 433 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removerule-confirm', $securitygroupname ); |
436 | 434 | } |
437 | 435 | $securityGroupInfo = array(); |
438 | 436 | $securityGroupInfo['groupname'] = array( |
— | — | @@ -493,8 +491,6 @@ |
494 | 492 | * @return bool |
495 | 493 | */ |
496 | 494 | function tryCreateSubmit( $formData, $entryPoint = 'internal' ) { |
497 | | - global $wgOut; |
498 | | - |
499 | 495 | $project = $formData['project']; |
500 | 496 | $groupname = $formData['groupname']; |
501 | 497 | $description = $formData['description']; |
— | — | @@ -502,15 +498,15 @@ |
503 | 499 | $this->userNova = new OpenStackNovaController( $userCredentials, $project ); |
504 | 500 | $securitygroup = $this->userNova->createSecurityGroup( $groupname, $description ); |
505 | 501 | if ( $securitygroup ) { |
506 | | - $wgOut->addWikiMsg( 'openstackmanager-createdsecuritygroup' ); |
| 502 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createdsecuritygroup' ); |
507 | 503 | } else { |
508 | | - $wgOut->addWikiMsg( 'openstackmanager-createsecuritygroupfailed' ); |
| 504 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createsecuritygroupfailed' ); |
509 | 505 | } |
510 | 506 | |
511 | 507 | $out = '<br />'; |
512 | 508 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsecuritygrouplist' ) ); |
513 | 509 | |
514 | | - $wgOut->addHTML( $out ); |
| 510 | + $this->getOutput()->addHTML( $out ); |
515 | 511 | return true; |
516 | 512 | } |
517 | 513 | |
— | — | @@ -520,29 +516,27 @@ |
521 | 517 | * @return bool |
522 | 518 | */ |
523 | 519 | function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) { |
524 | | - global $wgOut; |
525 | | - |
526 | 520 | $project = $formData['project']; |
527 | 521 | $userCredentials = $this->userLDAP->getCredentials(); |
528 | 522 | $this->userNova = new OpenStackNovaController( $userCredentials, $project ); |
529 | 523 | $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'], $project ); |
530 | 524 | if ( !$securitygroup ) { |
531 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' ); |
| 525 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' ); |
532 | 526 | return true; |
533 | 527 | } |
534 | 528 | $groupname = $securitygroup->getGroupName(); |
535 | 529 | $success = $this->userNova->deleteSecurityGroup( $groupname ); |
536 | 530 | if ( $success ) { |
537 | 531 | # TODO: Ensure group isn't being used |
538 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedsecuritygroup' ); |
| 532 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedsecuritygroup' ); |
539 | 533 | } else { |
540 | | - $wgOut->addWikiMsg( 'openstackmanager-deletesecuritygroupfailed' ); |
| 534 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletesecuritygroupfailed' ); |
541 | 535 | } |
542 | 536 | |
543 | 537 | $out = '<br />'; |
544 | 538 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsecuritygrouplist' ) ); |
545 | 539 | |
546 | | - $wgOut->addHTML( $out ); |
| 540 | + $this->getOutput()->addHTML( $out ); |
547 | 541 | return true; |
548 | 542 | } |
549 | 543 | |
— | — | @@ -552,8 +546,6 @@ |
553 | 547 | * @return bool |
554 | 548 | */ |
555 | 549 | function tryConfigureSubmit( $formData, $entryPoint = 'internal' ) { |
556 | | - global $wgOut; |
557 | | - |
558 | 550 | $project = $formData['project']; |
559 | 551 | $groupname = $formData['groupname']; |
560 | 552 | $description = $formData['description']; |
— | — | @@ -562,18 +554,18 @@ |
563 | 555 | # This isn't a supported function in the API for now. Leave this action out for now |
564 | 556 | $success = $this->userNova->modifySecurityGroup( $groupname, array( 'description' => $description ) ); |
565 | 557 | if ( $success ) { |
566 | | - $wgOut->addWikiMsg( 'openstackmanager-modifiedgroup' ); |
| 558 | + $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedgroup' ); |
567 | 559 | } else { |
568 | | - $wgOut->addWikiMsg( 'openstackmanager-modifygroupfailed' ); |
| 560 | + $this->getOutput()->addWikiMsg( 'openstackmanager-modifygroupfailed' ); |
569 | 561 | } |
570 | 562 | } else { |
571 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistantgroup' ); |
| 563 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantgroup' ); |
572 | 564 | } |
573 | 565 | |
574 | 566 | $out = '<br />'; |
575 | 567 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsecuritygrouplist' ) ); |
576 | 568 | |
577 | | - $wgOut->addHTML( $out ); |
| 569 | + $this->getOutput()->addHTML( $out ); |
578 | 570 | return true; |
579 | 571 | } |
580 | 572 | |
— | — | @@ -583,8 +575,6 @@ |
584 | 576 | * @return bool |
585 | 577 | */ |
586 | 578 | function tryAddRuleSubmit( $formData, $entryPoint = 'internal' ) { |
587 | | - global $wgOut; |
588 | | - |
589 | 579 | $project = $formData['project']; |
590 | 580 | $fromport = $formData['fromport']; |
591 | 581 | $toport = $formData['toport']; |
— | — | @@ -603,22 +593,22 @@ |
604 | 594 | $this->userNova = new OpenStackNovaController( $userCredentials, $project ); |
605 | 595 | $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'], $project ); |
606 | 596 | if ( ! $securitygroup ) { |
607 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' ); |
| 597 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' ); |
608 | 598 | return false; |
609 | 599 | } |
610 | 600 | $groupname = $securitygroup->getGroupName(); |
611 | 601 | $success = $this->userNova->addSecurityGroupRule( $groupname, $fromport, $toport, $protocol, $ranges, $groups ); |
612 | 602 | if ( $success ) { |
613 | 603 | # TODO: Ensure group isn't being used |
614 | | - $wgOut->addWikiMsg( 'openstackmanager-addedrule' ); |
| 604 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addedrule' ); |
615 | 605 | } else { |
616 | | - $wgOut->addWikiMsg( 'openstackmanager-addrulefailed' ); |
| 606 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addrulefailed' ); |
617 | 607 | } |
618 | 608 | |
619 | 609 | $out = '<br />'; |
620 | 610 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsecuritygrouplist' ) ); |
621 | 611 | |
622 | | - $wgOut->addHTML( $out ); |
| 612 | + $this->getOutput()->addHTML( $out ); |
623 | 613 | return true; |
624 | 614 | } |
625 | 615 | |
— | — | @@ -628,8 +618,6 @@ |
629 | 619 | * @return bool |
630 | 620 | */ |
631 | 621 | function tryRemoveRuleSubmit( $formData, $entryPoint = 'internal' ) { |
632 | | - global $wgOut; |
633 | | - |
634 | 622 | $project = $formData['project']; |
635 | 623 | $fromport = $formData['fromport']; |
636 | 624 | $toport = $formData['toport']; |
— | — | @@ -651,22 +639,22 @@ |
652 | 640 | $this->userNova = new OpenStackNovaController( $userCredentials, $project ); |
653 | 641 | $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'], $project ); |
654 | 642 | if ( ! $securitygroup ) { |
655 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' ); |
| 643 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' ); |
656 | 644 | return false; |
657 | 645 | } |
658 | 646 | $groupname = $securitygroup->getGroupName(); |
659 | 647 | $success = $this->userNova->removeSecurityGroupRule( $groupname, $fromport, $toport, $protocol, $ranges, $groups ); |
660 | 648 | if ( $success ) { |
661 | 649 | # TODO: Ensure group isn't being used |
662 | | - $wgOut->addWikiMsg( 'openstackmanager-removedrule' ); |
| 650 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removedrule' ); |
663 | 651 | } else { |
664 | | - $wgOut->addWikiMsg( 'openstackmanager-removerulefailed' ); |
| 652 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removerulefailed' ); |
665 | 653 | } |
666 | 654 | |
667 | 655 | $out = '<br />'; |
668 | 656 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsecuritygrouplist' ) ); |
669 | 657 | |
670 | | - $wgOut->addHTML( $out ); |
| 658 | + $this->getOutput()->addHTML( $out ); |
671 | 659 | return true; |
672 | 660 | } |
673 | 661 | } |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php |
— | — | @@ -51,10 +51,10 @@ |
52 | 52 | * @return bool |
53 | 53 | */ |
54 | 54 | function allocateAddress() { |
55 | | - global $wgRequest, $wgOut; |
| 55 | + global $wgRequest; |
56 | 56 | |
57 | 57 | $this->setHeaders(); |
58 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-allocateaddress' ) ); |
| 58 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-allocateaddress' ) ); |
59 | 59 | |
60 | 60 | $project = $wgRequest->getText( 'project' ); |
61 | 61 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | $userCredentials = $this->userLDAP->getCredentials(); |
66 | 66 | $this->userNova = new OpenStackNovaController( $userCredentials, $project ); |
67 | 67 | if ( ! $wgRequest->wasPosted() ) { |
68 | | - $wgOut->addWikiMsg( 'openstackmanager-allocateaddress-confirm', $project ); |
| 68 | + $this->getOutput()->addWikiMsg( 'openstackmanager-allocateaddress-confirm', $project ); |
69 | 69 | } |
70 | 70 | $addressInfo = array(); |
71 | 71 | $addressInfo['project'] = array( |
— | — | @@ -91,10 +91,10 @@ |
92 | 92 | * @return bool |
93 | 93 | */ |
94 | 94 | function releaseAddress() { |
95 | | - global $wgOut, $wgRequest; |
| 95 | + global $wgRequest; |
96 | 96 | |
97 | 97 | $this->setHeaders(); |
98 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-releaseaddress' ) ); |
| 98 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-releaseaddress' ) ); |
99 | 99 | |
100 | 100 | $project = $wgRequest->getText( 'project' ); |
101 | 101 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
— | — | @@ -105,7 +105,7 @@ |
106 | 106 | $this->userNova = new OpenStackNovaController( $userCredentials, $project ); |
107 | 107 | $ip = $wgRequest->getText( 'ip' ); |
108 | 108 | if ( ! $wgRequest->wasPosted() ) { |
109 | | - $wgOut->addWikiMsg( 'openstackmanager-releaseaddress-confirm', $ip ); |
| 109 | + $this->getOutput()->addWikiMsg( 'openstackmanager-releaseaddress-confirm', $ip ); |
110 | 110 | } |
111 | 111 | $addressInfo = array(); |
112 | 112 | $addressInfo['project'] = array( |
— | — | @@ -137,10 +137,10 @@ |
138 | 138 | * @return bool |
139 | 139 | */ |
140 | 140 | function associateAddress() { |
141 | | - global $wgOut, $wgRequest; |
| 141 | + global $wgRequest; |
142 | 142 | |
143 | 143 | $this->setHeaders(); |
144 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-associateaddress' ) ); |
| 144 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-associateaddress' ) ); |
145 | 145 | |
146 | 146 | $ip = $wgRequest->getText( 'ip' ); |
147 | 147 | $project = $wgRequest->getText( 'project' ); |
— | — | @@ -194,10 +194,10 @@ |
195 | 195 | * @return bool |
196 | 196 | */ |
197 | 197 | function disassociateAddress() { |
198 | | - global $wgOut, $wgRequest; |
| 198 | + global $wgRequest; |
199 | 199 | |
200 | 200 | $this->setHeaders(); |
201 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-disassociateaddress' ) ); |
| 201 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-disassociateaddress' ) ); |
202 | 202 | |
203 | 203 | $project = $wgRequest->getText( 'project' ); |
204 | 204 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
— | — | @@ -208,7 +208,7 @@ |
209 | 209 | $this->userNova = new OpenStackNovaController( $userCredentials, $project ); |
210 | 210 | $ip = $wgRequest->getText( 'ip' ); |
211 | 211 | if ( ! $wgRequest->wasPosted() ) { |
212 | | - $wgOut->addWikiMsg( 'openstackmanager-disassociateaddress-confirm', $ip ); |
| 212 | + $this->getOutput()->addWikiMsg( 'openstackmanager-disassociateaddress-confirm', $ip ); |
213 | 213 | } |
214 | 214 | $addressInfo = array(); |
215 | 215 | $addressInfo['project'] = array( |
— | — | @@ -240,10 +240,10 @@ |
241 | 241 | * @return bool |
242 | 242 | */ |
243 | 243 | function addHost() { |
244 | | - global $wgOut, $wgRequest; |
| 244 | + global $wgRequest; |
245 | 245 | |
246 | 246 | $this->setHeaders(); |
247 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addhost' ) ); |
| 247 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addhost' ) ); |
248 | 248 | |
249 | 249 | $project = $wgRequest->getText( 'project' ); |
250 | 250 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
— | — | @@ -299,10 +299,10 @@ |
300 | 300 | * @return bool |
301 | 301 | */ |
302 | 302 | function removeHost() { |
303 | | - global $wgOut, $wgRequest; |
| 303 | + global $wgRequest; |
304 | 304 | |
305 | 305 | $this->setHeaders(); |
306 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removehost' ) ); |
| 306 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removehost' ) ); |
307 | 307 | |
308 | 308 | $project = $wgRequest->getText( 'project' ); |
309 | 309 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
— | — | @@ -315,7 +315,7 @@ |
316 | 316 | $domain = $wgRequest->getText( 'domain' ); |
317 | 317 | $hostname = $wgRequest->getText( 'hostname' ); |
318 | 318 | if ( ! $wgRequest->wasPosted() ) { |
319 | | - $wgOut->addWikiMsg( 'openstackmanager-removehost-confirm', $hostname, $ip ); |
| 319 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removehost-confirm', $hostname, $ip ); |
320 | 320 | } |
321 | 321 | $addressInfo = array(); |
322 | 322 | $addressInfo['project'] = array( |
— | — | @@ -357,10 +357,8 @@ |
358 | 358 | * @return bool |
359 | 359 | */ |
360 | 360 | function listAddresses() { |
361 | | - global $wgOut; |
362 | | - |
363 | 361 | $this->setHeaders(); |
364 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addresslist' ) ); |
| 362 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addresslist' ) ); |
365 | 363 | |
366 | 364 | $userProjects = $this->userLDAP->getProjects(); |
367 | 365 | $out = ''; |
— | — | @@ -448,7 +446,7 @@ |
449 | 447 | array( 'id' => 'novainstancelist', 'class' => 'wikitable sortable collapsible' ), $projectOut ); |
450 | 448 | } |
451 | 449 | } |
452 | | - $wgOut->addHTML( $out ); |
| 450 | + $this->getOutput()->addHTML( $out ); |
453 | 451 | |
454 | 452 | return true; |
455 | 453 | } |
— | — | @@ -459,18 +457,16 @@ |
460 | 458 | * @return bool |
461 | 459 | */ |
462 | 460 | function tryAllocateSubmit( $formData, $entryPoint = 'internal' ) { |
463 | | - global $wgOut; |
464 | | - |
465 | 461 | $address = $this->userNova->allocateAddress(); |
466 | 462 | if ( ! $address ) { |
467 | | - $wgOut->addWikiMsg( 'openstackmanager-allocateaddressfailed' ); |
| 463 | + $this->getOutput()->addWikiMsg( 'openstackmanager-allocateaddressfailed' ); |
468 | 464 | return true; |
469 | 465 | } |
470 | 466 | $ip = $address->getPublicIP(); |
471 | | - $wgOut->addWikiMsg( 'openstackmanager-allocatedaddress', $ip ); |
| 467 | + $this->getOutput()->addWikiMsg( 'openstackmanager-allocatedaddress', $ip ); |
472 | 468 | $out = '<br />'; |
473 | 469 | $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) ); |
474 | | - $wgOut->addHTML( $out ); |
| 470 | + $this->getOutput()->addHTML( $out ); |
475 | 471 | |
476 | 472 | return true; |
477 | 473 | } |
— | — | @@ -481,32 +477,30 @@ |
482 | 478 | * @return bool |
483 | 479 | */ |
484 | 480 | function tryReleaseSubmit( $formData, $entryPoint = 'internal' ) { |
485 | | - global $wgOut; |
486 | | - |
487 | 481 | $ip = $formData['ip']; |
488 | 482 | #TODO: Instead of throwing an error when host exist or the IP |
489 | 483 | # is associated, remove all host entries and disassociate the IP |
490 | 484 | # then release the address |
491 | 485 | $hosts = OpenStackNovaHost::getHostsByIP( $ip ); |
492 | 486 | if ( $hosts ) { |
493 | | - $wgOut->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip ); |
| 487 | + $this->getOutput()->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip ); |
494 | 488 | return true; |
495 | 489 | } |
496 | 490 | $address = $this->adminNova->getAddress( $ip ); |
497 | 491 | if ( $address->getInstanceId() ) { |
498 | | - $wgOut->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip ); |
| 492 | + $this->getOutput()->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip ); |
499 | 493 | return true; |
500 | 494 | } |
501 | 495 | $success = $this->userNova->releaseAddress( $ip ); |
502 | 496 | if ( $success ) { |
503 | | - $wgOut->addWikiMsg( 'openstackmanager-releasedaddress', $ip ); |
| 497 | + $this->getOutput()->addWikiMsg( 'openstackmanager-releasedaddress', $ip ); |
504 | 498 | } else { |
505 | | - $wgOut->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip ); |
| 499 | + $this->getOutput()->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip ); |
506 | 500 | } |
507 | 501 | |
508 | 502 | $out = '<br />'; |
509 | 503 | $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) ); |
510 | | - $wgOut->addHTML( $out ); |
| 504 | + $this->getOutput()->addHTML( $out ); |
511 | 505 | |
512 | 506 | return true; |
513 | 507 | } |
— | — | @@ -517,20 +511,18 @@ |
518 | 512 | * @return bool |
519 | 513 | */ |
520 | 514 | function tryAssociateSubmit( $formData, $entryPoint = 'internal' ) { |
521 | | - global $wgOut; |
522 | | - |
523 | 515 | $instanceid = $formData['instanceid']; |
524 | 516 | $ip = $formData['ip']; |
525 | 517 | $address = $this->userNova->associateAddress( $instanceid, $ip ); |
526 | 518 | if ( $address ) { |
527 | | - $wgOut->addWikiMsg( 'openstackmanager-associatedaddress', $ip, $instanceid ); |
| 519 | + $this->getOutput()->addWikiMsg( 'openstackmanager-associatedaddress', $ip, $instanceid ); |
528 | 520 | } else { |
529 | | - $wgOut->addWikiMsg( 'openstackmanager-associatedaddressfailed', $ip, $instanceid ); |
| 521 | + $this->getOutput()->addWikiMsg( 'openstackmanager-associatedaddressfailed', $ip, $instanceid ); |
530 | 522 | } |
531 | 523 | |
532 | 524 | $out = '<br />'; |
533 | 525 | $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) ); |
534 | | - $wgOut->addHTML( $out ); |
| 526 | + $this->getOutput()->addHTML( $out ); |
535 | 527 | |
536 | 528 | return true; |
537 | 529 | } |
— | — | @@ -541,19 +533,17 @@ |
542 | 534 | * @return bool |
543 | 535 | */ |
544 | 536 | function tryDisassociateSubmit( $formData, $entryPoint = 'internal' ) { |
545 | | - global $wgOut; |
546 | | - |
547 | 537 | $ip = $formData['ip']; |
548 | 538 | $address = $this->userNova->disassociateAddress( $ip ); |
549 | 539 | if ( $address ) { |
550 | | - $wgOut->addWikiMsg( 'openstackmanager-disassociatedaddress', $ip ); |
| 540 | + $this->getOutput()->addWikiMsg( 'openstackmanager-disassociatedaddress', $ip ); |
551 | 541 | } else { |
552 | | - $wgOut->addWikiMsg( 'openstackmanager-disassociatedaddressfailed', $ip ); |
| 542 | + $this->getOutput()->addWikiMsg( 'openstackmanager-disassociatedaddressfailed', $ip ); |
553 | 543 | } |
554 | 544 | |
555 | 545 | $out = '<br />'; |
556 | 546 | $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) ); |
557 | | - $wgOut->addHTML( $out ); |
| 547 | + $this->getOutput()->addHTML( $out ); |
558 | 548 | |
559 | 549 | return true; |
560 | 550 | } |
— | — | @@ -564,17 +554,15 @@ |
565 | 555 | * @return bool |
566 | 556 | */ |
567 | 557 | function tryAddHostSubmit( $formData, $entryPoint = 'internal' ) { |
568 | | - global $wgOut; |
569 | | - |
570 | 558 | $ip = $formData['ip']; |
571 | 559 | $project = $formData['project']; |
572 | 560 | $address = $this->adminNova->getAddress( $ip ); |
573 | 561 | if ( ! $address ) { |
574 | | - $wgOut->addWikiMsg( 'openstackmanager-invalidaddress', $ip ); |
| 562 | + $this->getOutput()->addWikiMsg( 'openstackmanager-invalidaddress', $ip ); |
575 | 563 | return true; |
576 | 564 | } |
577 | 565 | if ( $address->getProject() != $project ) { |
578 | | - $wgOut->addWikiMsg( 'openstackmanager-invalidaddressforproject', $ip ); |
| 566 | + $this->getOutput()->addWikiMsg( 'openstackmanager-invalidaddressforproject', $ip ); |
579 | 567 | return true; |
580 | 568 | } |
581 | 569 | $hostname = $formData['hostname']; |
— | — | @@ -587,51 +575,49 @@ |
588 | 576 | # We need to add an arecord, if the arecord doesn't already exist |
589 | 577 | $success = $hostbyname->addARecord( $ip ); |
590 | 578 | if ( $success ) { |
591 | | - $wgOut->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip ); |
| 579 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip ); |
592 | 580 | } else { |
593 | | - $wgOut->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname ); |
| 581 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname ); |
594 | 582 | } |
595 | 583 | } elseif ( $hostbyip ) { |
596 | 584 | # We need to add an associateddomain, if the associateddomain doesn't already exist |
597 | 585 | $success = $hostbyip->addAssociatedDomain( $hostname . '.' . $domain->getFullyQualifiedDomainName() ); |
598 | 586 | if ( $success ) { |
599 | | - $wgOut->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip ); |
| 587 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip ); |
600 | 588 | } else { |
601 | | - $wgOut->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname ); |
| 589 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname ); |
602 | 590 | } |
603 | 591 | } else { |
604 | 592 | # This is a new host entry |
605 | 593 | $host = OpenStackNovaHost::addPublicHost( $hostname, $ip, $domain ); |
606 | 594 | if ( $host ) { |
607 | | - $wgOut->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip ); |
| 595 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addedhost', $hostname, $ip ); |
608 | 596 | } else { |
609 | | - $wgOut->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname ); |
| 597 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addhostfailed', $ip, $hostname ); |
610 | 598 | } |
611 | 599 | } |
612 | | - |
| 600 | +$this->getOutput(); |
613 | 601 | $out = '<br />'; |
614 | 602 | $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) ); |
615 | | - $wgOut->addHTML( $out ); |
| 603 | + $this->getOutput()->addHTML( $out ); |
616 | 604 | return true; |
617 | 605 | } |
618 | 606 | |
619 | 607 | /** |
620 | | - * @param $formData |
| 608 | + * @param $formData |
621 | 609 | * @param string $entryPoint |
622 | 610 | * @return bool |
623 | 611 | */ |
624 | 612 | function tryRemoveHostSubmit( $formData, $entryPoint = 'internal' ) { |
625 | | - global $wgOut; |
626 | | - |
627 | 613 | $ip = $formData['ip']; |
628 | 614 | $project = $formData['project']; |
629 | 615 | $address = $this->adminNova->getAddress( $ip ); |
630 | 616 | if ( ! $address ) { |
631 | | - $wgOut->addWikiMsg( 'openstackmanager-invalidaddress', $ip ); |
| 617 | + $this->getOutput()->addWikiMsg( 'openstackmanager-invalidaddress', $ip ); |
632 | 618 | return true; |
633 | 619 | } |
634 | 620 | if ( $address->getProject() != $project ) { |
635 | | - $wgOut->addWikiMsg( 'openstackmanager-invalidaddressforproject', $ip ); |
| 621 | + $this->getOutput()->addWikiMsg( 'openstackmanager-invalidaddressforproject', $ip ); |
636 | 622 | return true; |
637 | 623 | } |
638 | 624 | $hostname = $formData['hostname']; |
— | — | @@ -645,25 +631,25 @@ |
646 | 632 | # We need to keep the host, but remove the fqdn |
647 | 633 | $success = $host->deleteAssociatedDomain( $fqdn ); |
648 | 634 | if ( $success ) { |
649 | | - $wgOut->addWikiMsg( 'openstackmanager-removedhost', $hostname, $ip ); |
| 635 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removedhost', $hostname, $ip ); |
650 | 636 | } else { |
651 | | - $wgOut->addWikiMsg( 'openstackmanager-removehostfailed', $ip, $hostname ); |
| 637 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removehostfailed', $ip, $hostname ); |
652 | 638 | } |
653 | 639 | } else { |
654 | 640 | # We need to remove the host entry |
655 | 641 | $success = OpenStackNovaHost::deleteHost( $hostname, $domain ); |
656 | 642 | if ( $success ) { |
657 | | - $wgOut->addWikiMsg( 'openstackmanager-removedhost', $hostname, $ip ); |
| 643 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removedhost', $hostname, $ip ); |
658 | 644 | } else { |
659 | | - $wgOut->addWikiMsg( 'openstackmanager-removehostfailed', $ip, $hostname ); |
| 645 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removehostfailed', $ip, $hostname ); |
660 | 646 | } |
661 | 647 | } |
662 | 648 | } else { |
663 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistenthost' ); |
| 649 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistenthost' ); |
664 | 650 | } |
665 | 651 | $out = '<br />'; |
666 | 652 | $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) ); |
667 | | - $wgOut->addHTML( $out ); |
| 653 | + $this->getOutput()->addHTML( $out ); |
668 | 654 | return true; |
669 | 655 | } |
670 | 656 | } |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaProject.php |
— | — | @@ -40,14 +40,14 @@ |
41 | 41 | * @return bool |
42 | 42 | */ |
43 | 43 | function createProject() { |
44 | | - global $wgOut, $wgUser; |
| 44 | + global $wgUser; |
45 | 45 | |
46 | 46 | $this->setHeaders(); |
47 | 47 | if ( !$this->userCanExecute( $wgUser ) ) { |
48 | 48 | $this->displayRestrictionError(); |
49 | 49 | return false; |
50 | 50 | } |
51 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createproject' ) ); |
| 51 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createproject' ) ); |
52 | 52 | |
53 | 53 | $projectInfo = array(); |
54 | 54 | $projectInfo['projectname'] = array( |
— | — | @@ -96,11 +96,11 @@ |
97 | 97 | * @return bool |
98 | 98 | */ |
99 | 99 | function addMember() { |
100 | | - global $wgRequest, $wgOut; |
| 100 | + global $wgRequest; |
101 | 101 | global $wgUser; |
102 | 102 | |
103 | 103 | $this->setHeaders(); |
104 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addmember' ) ); |
| 104 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addmember' ) ); |
105 | 105 | |
106 | 106 | $project = $wgRequest->getText( 'projectname' ); |
107 | 107 | if ( !$this->userCanExecute( $wgUser ) && !$this->userLDAP->inProject( $project ) ) { |
— | — | @@ -139,11 +139,11 @@ |
140 | 140 | * @return bool |
141 | 141 | */ |
142 | 142 | function deleteMember() { |
143 | | - global $wgRequest, $wgOut; |
| 143 | + global $wgRequest; |
144 | 144 | global $wgUser; |
145 | 145 | |
146 | 146 | $this->setHeaders(); |
147 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removemember' ) ); |
| 147 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removemember' ) ); |
148 | 148 | |
149 | 149 | $projectname = $wgRequest->getText( 'projectname' ); |
150 | 150 | if ( !$this->userCanExecute( $wgUser ) && !$this->userLDAP->inProject( $projectname ) ) { |
— | — | @@ -188,7 +188,7 @@ |
189 | 189 | * @return bool |
190 | 190 | */ |
191 | 191 | function deleteProject() { |
192 | | - global $wgOut, $wgRequest; |
| 192 | + global $wgRequest; |
193 | 193 | global $wgUser; |
194 | 194 | |
195 | 195 | $this->setHeaders(); |
— | — | @@ -196,11 +196,11 @@ |
197 | 197 | $this->displayRestrictionError(); |
198 | 198 | return false; |
199 | 199 | } |
200 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deleteproject' ) ); |
| 200 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deleteproject' ) ); |
201 | 201 | |
202 | 202 | $project = $wgRequest->getText( 'projectname' ); |
203 | 203 | if ( ! $wgRequest->wasPosted() ) { |
204 | | - $wgOut->addWikiMsg( 'openstackmanager-removeprojectconfirm', $project ); |
| 204 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removeprojectconfirm', $project ); |
205 | 205 | } |
206 | 206 | $projectInfo = array(); |
207 | 207 | $projectInfo['projectname'] = array( |
— | — | @@ -226,11 +226,9 @@ |
227 | 227 | * @return void |
228 | 228 | */ |
229 | 229 | function listProjects() { |
230 | | - global $wgOut; |
231 | | - |
232 | 230 | $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' ); |
235 | 233 | |
236 | 234 | $out = ''; |
237 | 235 | |
— | — | @@ -299,7 +297,7 @@ |
300 | 298 | $out .= Html::rawElement( 'table', array( 'class' => 'wikitable sortable collapsible' ), $projectsOut ); |
301 | 299 | } |
302 | 300 | |
303 | | - $wgOut->addHTML( $out ); |
| 301 | + $this->getOutput()->addHTML( $out ); |
304 | 302 | } |
305 | 303 | |
306 | 304 | /** |
— | — | @@ -308,12 +306,11 @@ |
309 | 307 | * @return bool |
310 | 308 | */ |
311 | 309 | function tryCreateSubmit( $formData, $entryPoint = 'internal' ) { |
312 | | - global $wgOut; |
313 | 310 | global $wgOpenStackManagerDefaultSecurityGroupRules; |
314 | 311 | |
315 | 312 | $success = OpenStackNovaProject::createProject( $formData['projectname'] ); |
316 | 313 | if ( ! $success ) { |
317 | | - $wgOut->addWikiMsg( 'openstackmanager-createprojectfailed' ); |
| 314 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createprojectfailed' ); |
318 | 315 | return true; |
319 | 316 | } |
320 | 317 | $project = OpenStackNovaProject::getProjectByName( $formData['projectname'] ); |
— | — | @@ -373,11 +370,11 @@ |
374 | 371 | # Reset connection to default |
375 | 372 | $this->adminNova->configureConnection(); |
376 | 373 | $project->editArticle(); |
377 | | - $wgOut->addWikiMsg( 'openstackmanager-createdproject' ); |
| 374 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createdproject' ); |
378 | 375 | |
379 | 376 | $out = '<br />'; |
380 | 377 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backprojectlist' ) ); |
381 | | - $wgOut->addHTML( $out ); |
| 378 | + $this->getOutput()->addHTML( $out ); |
382 | 379 | |
383 | 380 | return true; |
384 | 381 | } |
— | — | @@ -388,20 +385,18 @@ |
389 | 386 | * @return bool |
390 | 387 | */ |
391 | 388 | function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) { |
392 | | - global $wgOut; |
393 | | - |
394 | 389 | $success = OpenStackNovaProject::deleteProject( $formData['projectname'] ); |
395 | 390 | if ( $success ) { |
396 | 391 | $project = OpenStackNovaProject::getProjectByName( $formData['projectname'] ); |
397 | 392 | $project->deleteArticle(); |
398 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedproject' ); |
| 393 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedproject' ); |
399 | 394 | } else { |
400 | | - $wgOut->addWikiMsg( 'openstackmanager-deleteprojectfailed' ); |
| 395 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deleteprojectfailed' ); |
401 | 396 | } |
402 | 397 | |
403 | 398 | $out = '<br />'; |
404 | 399 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backprojectlist' ) ); |
405 | | - $wgOut->addHTML( $out ); |
| 400 | + $this->getOutput()->addHTML( $out ); |
406 | 401 | |
407 | 402 | return true; |
408 | 403 | } |
— | — | @@ -412,23 +407,21 @@ |
413 | 408 | * @return bool |
414 | 409 | */ |
415 | 410 | function tryAddMemberSubmit( $formData, $entryPoint = 'internal' ) { |
416 | | - global $wgOut; |
417 | | - |
418 | 411 | $project = new OpenStackNovaProject( $formData['projectname'] ); |
419 | 412 | $members = explode( ',', $formData['member'] ); |
420 | 413 | foreach ( $members as $member ) { |
421 | 414 | $success = $project->addMember( $member ); |
422 | 415 | if ( $success ) { |
423 | 416 | $project->editArticle(); |
424 | | - $wgOut->addWikiMsg( 'openstackmanager-addedto', $formData['member'], $formData['projectname'] ); |
| 417 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addedto', $formData['member'], $formData['projectname'] ); |
425 | 418 | } else { |
426 | | - $wgOut->addWikiMsg( 'openstackmanager-failedtoadd', $formData['member'], $formData['projectname'] ); |
| 419 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoadd', $formData['member'], $formData['projectname'] ); |
427 | 420 | } |
428 | 421 | } |
429 | 422 | |
430 | 423 | $out = '<br />'; |
431 | 424 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backprojectlist' ) ); |
432 | | - $wgOut->addHTML( $out ); |
| 425 | + $this->getOutput()->addHTML( $out ); |
433 | 426 | |
434 | 427 | return true; |
435 | 428 | } |
— | — | @@ -439,26 +432,24 @@ |
440 | 433 | * @return bool |
441 | 434 | */ |
442 | 435 | function tryDeleteMemberSubmit( $formData, $entryPoint = 'internal' ) { |
443 | | - global $wgOut; |
444 | | - |
445 | 436 | $project = OpenStackNovaProject::getProjectByName( $formData['projectname'] ); |
446 | 437 | if ( ! $project ) { |
447 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistentproject' ); |
| 438 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistentproject' ); |
448 | 439 | return true; |
449 | 440 | } |
450 | 441 | foreach ( $formData['members'] as $member ) { |
451 | 442 | $success = $project->deleteMember( $member ); |
452 | 443 | if ( $success ) { |
453 | 444 | $project->editArticle(); |
454 | | - $wgOut->addWikiMsg( 'openstackmanager-removedfrom', $member, $formData['projectname'] ); |
| 445 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removedfrom', $member, $formData['projectname'] ); |
455 | 446 | } else { |
456 | | - $wgOut->addWikiMsg( 'openstackmanager-failedtoremove', $member, $formData['projectname'] ); |
| 447 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoremove', $member, $formData['projectname'] ); |
457 | 448 | } |
458 | 449 | } |
459 | 450 | $out = '<br />'; |
460 | 451 | |
461 | 452 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backprojectlist' ) ); |
462 | | - $wgOut->addHTML( $out ); |
| 453 | + $this->getOutput()->addHTML( $out ); |
463 | 454 | |
464 | 455 | return true; |
465 | 456 | } |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php |
— | — | @@ -53,10 +53,8 @@ |
54 | 54 | * @return bool |
55 | 55 | */ |
56 | 56 | function createDomain() { |
57 | | - global $wgOut; |
58 | | - |
59 | 57 | $this->setHeaders(); |
60 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createdomain' ) ); |
| 58 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createdomain' ) ); |
61 | 59 | |
62 | 60 | $domainInfo = array(); |
63 | 61 | $domainInfo['domainname'] = array( |
— | — | @@ -100,14 +98,14 @@ |
101 | 99 | * @return bool |
102 | 100 | */ |
103 | 101 | function deleteDomain() { |
104 | | - global $wgOut, $wgRequest; |
| 102 | + global $wgRequest; |
105 | 103 | |
106 | 104 | $this->setHeaders(); |
107 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletedomain' ) ); |
| 105 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletedomain' ) ); |
108 | 106 | |
109 | 107 | $domainname = $wgRequest->getText( 'domainname' ); |
110 | 108 | if ( ! $wgRequest->wasPosted() ) { |
111 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedomain-confirm', $domainname ); |
| 109 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedomain-confirm', $domainname ); |
112 | 110 | } |
113 | 111 | $domainInfo = array(); |
114 | 112 | $domainInfo['domainname'] = array( |
— | — | @@ -133,10 +131,8 @@ |
134 | 132 | * @return void |
135 | 133 | */ |
136 | 134 | function listDomains() { |
137 | | - global $wgOut; |
138 | | - |
139 | 135 | $this->setHeaders(); |
140 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-domainlist' ) ); |
| 136 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-domainlist' ) ); |
141 | 137 | |
142 | 138 | $out = ''; |
143 | 139 | |
— | — | @@ -163,7 +159,7 @@ |
164 | 160 | $out .= Html::rawElement( 'table', array( 'class' => 'wikitable sortable collapsible' ), $domainsOut ); |
165 | 161 | } |
166 | 162 | |
167 | | - $wgOut->addHTML( $out ); |
| 163 | + $this->getOutput()->addHTML( $out ); |
168 | 164 | } |
169 | 165 | |
170 | 166 | /** |
— | — | @@ -172,18 +168,16 @@ |
173 | 169 | * @return bool |
174 | 170 | */ |
175 | 171 | function tryCreateSubmit( $formData, $entryPoint = 'internal' ) { |
176 | | - global $wgOut; |
177 | | - |
178 | 172 | $success = OpenStackNovaDomain::createDomain( $formData['domainname'], $formData['fqdn'], $formData['location'] ); |
179 | 173 | if ( ! $success ) { |
180 | | - $wgOut->addWikiMsg( 'openstackmanager-createdomainfailed' ); |
| 174 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createdomainfailed' ); |
181 | 175 | return true; |
182 | 176 | } |
183 | | - $wgOut->addWikiMsg( 'openstackmanager-createddomain' ); |
| 177 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createddomain' ); |
184 | 178 | |
185 | 179 | $out = '<br />'; |
186 | 180 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backdomainlist' ) ); |
187 | | - $wgOut->addHTML( $out ); |
| 181 | + $this->getOutput()->addHTML( $out ); |
188 | 182 | |
189 | 183 | return true; |
190 | 184 | } |
— | — | @@ -194,18 +188,16 @@ |
195 | 189 | * @return bool |
196 | 190 | */ |
197 | 191 | function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) { |
198 | | - global $wgOut; |
199 | | - |
200 | 192 | $success = OpenStackNovaDomain::deleteDomain( $formData['domainname'] ); |
201 | 193 | if ( $success ) { |
202 | | - $wgOut->addWikiMsg( 'openstackmanager-deleteddomain' ); |
| 194 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deleteddomain' ); |
203 | 195 | } else { |
204 | | - $wgOut->addWikiMsg( 'openstackmanager-failedeleteddomain' ); |
| 196 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedeleteddomain' ); |
205 | 197 | } |
206 | 198 | |
207 | 199 | $out = '<br />'; |
208 | 200 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backdomainlist' ) ); |
209 | | - $wgOut->addHTML( $out ); |
| 201 | + $this->getOutput()->addHTML( $out ); |
210 | 202 | |
211 | 203 | return true; |
212 | 204 | } |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaVolume.php |
— | — | @@ -69,10 +69,10 @@ |
70 | 70 | * @return bool |
71 | 71 | */ |
72 | 72 | function createVolume() { |
73 | | - global $wgRequest, $wgOut; |
| 73 | + global $wgRequest; |
74 | 74 | |
75 | 75 | $this->setHeaders(); |
76 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createvolume' ) ); |
| 76 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createvolume' ) ); |
77 | 77 | |
78 | 78 | $project = $wgRequest->getText( 'project' ); |
79 | 79 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
— | — | @@ -143,10 +143,10 @@ |
144 | 144 | * @return bool |
145 | 145 | */ |
146 | 146 | function deleteVolume() { |
147 | | - global $wgOut, $wgRequest; |
| 147 | + global $wgRequest; |
148 | 148 | |
149 | 149 | $this->setHeaders(); |
150 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletevolume' ) ); |
| 150 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletevolume' ) ); |
151 | 151 | |
152 | 152 | $project = $wgRequest->getText( 'project' ); |
153 | 153 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | } |
157 | 157 | $volumeid = $wgRequest->getText( 'volumeid' ); |
158 | 158 | if ( ! $wgRequest->wasPosted() ) { |
159 | | - $wgOut->addWikiMsg( 'openstackmanager-deletevolumequestion', $volumeid ); |
| 159 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletevolumequestion', $volumeid ); |
160 | 160 | } |
161 | 161 | $volumeInfo = array(); |
162 | 162 | $volumeInfo['volumeid'] = array( |
— | — | @@ -186,10 +186,10 @@ |
187 | 187 | * @return bool |
188 | 188 | */ |
189 | 189 | function attachVolume() { |
190 | | - global $wgRequest, $wgOut; |
| 190 | + global $wgRequest; |
191 | 191 | |
192 | 192 | $this->setHeaders(); |
193 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-attachvolume' ) ); |
| 193 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-attachvolume' ) ); |
194 | 194 | |
195 | 195 | $project = $wgRequest->getText( 'project' ); |
196 | 196 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
— | — | @@ -261,10 +261,10 @@ |
262 | 262 | * @return bool |
263 | 263 | */ |
264 | 264 | function detachVolume() { |
265 | | - global $wgRequest, $wgOut; |
| 265 | + global $wgRequest; |
266 | 266 | |
267 | 267 | $this->setHeaders(); |
268 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-detachvolume' ) ); |
| 268 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-detachvolume' ) ); |
269 | 269 | |
270 | 270 | $project = $wgRequest->getText( 'project' ); |
271 | 271 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
— | — | @@ -313,10 +313,8 @@ |
314 | 314 | * @return void |
315 | 315 | */ |
316 | 316 | function listVolumes() { |
317 | | - global $wgOut; |
318 | | - |
319 | 317 | $this->setHeaders(); |
320 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-volumelist' ) ); |
| 318 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-volumelist' ) ); |
321 | 319 | |
322 | 320 | $userProjects = $this->userLDAP->getProjects(); |
323 | 321 | |
— | — | @@ -398,7 +396,7 @@ |
399 | 397 | } |
400 | 398 | } |
401 | 399 | |
402 | | - $wgOut->addHTML( $out ); |
| 400 | + $this->getOutput()->addHTML( $out ); |
403 | 401 | } |
404 | 402 | |
405 | 403 | /** |
— | — | @@ -407,19 +405,17 @@ |
408 | 406 | * @return bool |
409 | 407 | */ |
410 | 408 | function tryCreateSubmit( $formData, $entryPoint = 'internal' ) { |
411 | | - global $wgOut; |
412 | | - |
413 | 409 | $volume = $this->userNova->createVolume( $formData['availabilityZone'], $formData['volumeSize'], $formData['volumename'], $formData['volumedescription'] ); |
414 | 410 | if ( $volume ) { |
415 | | - $wgOut->addWikiMsg( 'openstackmanager-createdvolume', $volume->getVolumeID() ); |
| 411 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createdvolume', $volume->getVolumeID() ); |
416 | 412 | } else { |
417 | | - $wgOut->addWikiMsg( 'openstackmanager-createevolumefailed' ); |
| 413 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createevolumefailed' ); |
418 | 414 | } |
419 | 415 | |
420 | 416 | $out = '<br />'; |
421 | 417 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backvolumelist' ) ); |
422 | 418 | |
423 | | - $wgOut->addHTML( $out ); |
| 419 | + $this->getOutput()->addHTML( $out ); |
424 | 420 | return true; |
425 | 421 | } |
426 | 422 | |
— | — | @@ -429,25 +425,23 @@ |
430 | 426 | * @return bool |
431 | 427 | */ |
432 | 428 | function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) { |
433 | | - global $wgOut; |
434 | | - |
435 | 429 | $volume = $this->adminNova->getVolume( $formData['volumeid'] ); |
436 | 430 | if ( ! $volume ) { |
437 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistantvolume' ); |
| 431 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantvolume' ); |
438 | 432 | return true; |
439 | 433 | } |
440 | 434 | $volumeid = $volume->getVolumeId(); |
441 | 435 | $success = $this->userNova->deleteVolume( $volumeid ); |
442 | 436 | if ( $success ) { |
443 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedvolume', $volumeid ); |
| 437 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedvolume', $volumeid ); |
444 | 438 | } else { |
445 | | - $wgOut->addWikiMsg( 'openstackmanager-deletevolumefailed' ); |
| 439 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletevolumefailed' ); |
446 | 440 | } |
447 | 441 | |
448 | 442 | $out = '<br />'; |
449 | 443 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backvolumelist' ) ); |
450 | 444 | |
451 | | - $wgOut->addHTML( $out ); |
| 445 | + $this->getOutput()->addHTML( $out ); |
452 | 446 | return true; |
453 | 447 | } |
454 | 448 | |
— | — | @@ -457,19 +451,17 @@ |
458 | 452 | * @return bool |
459 | 453 | */ |
460 | 454 | function tryAttachSubmit( $formData, $entryPoint = 'internal' ) { |
461 | | - global $wgOut; |
462 | | - |
463 | 455 | $success = $this->userNova->attachVolume( $formData['volumeid'], $formData['instanceid'], $formData['device'] ); |
464 | 456 | if ( $success ) { |
465 | | - $wgOut->addWikiMsg( 'openstackmanager-attachedvolume' ); |
| 457 | + $this->getOutput()->addWikiMsg( 'openstackmanager-attachedvolume' ); |
466 | 458 | } else { |
467 | | - $wgOut->addWikiMsg( 'openstackmanager-attachvolumefailed' ); |
| 459 | + $this->getOutput()->addWikiMsg( 'openstackmanager-attachvolumefailed' ); |
468 | 460 | } |
469 | 461 | |
470 | 462 | $out = '<br />'; |
471 | 463 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backvolumelist' ) ); |
472 | 464 | |
473 | | - $wgOut->addHTML( $out ); |
| 465 | + $this->getOutput()->addHTML( $out ); |
474 | 466 | return true; |
475 | 467 | } |
476 | 468 | |
— | — | @@ -479,8 +471,6 @@ |
480 | 472 | * @return bool |
481 | 473 | */ |
482 | 474 | function tryDetachSubmit( $formData, $entryPoint = 'internal' ) { |
483 | | - global $wgOut; |
484 | | - |
485 | 475 | if ( isset( $formData['force'] ) && $formData['force'] ) { |
486 | 476 | $force = true; |
487 | 477 | } else { |
— | — | @@ -488,15 +478,15 @@ |
489 | 479 | } |
490 | 480 | $success = $this->userNova->detachVolume( $formData['volumeid'], $force ); |
491 | 481 | if ( $success ) { |
492 | | - $wgOut->addWikiMsg( 'openstackmanager-detachedvolume' ); |
| 482 | + $this->getOutput()->addWikiMsg( 'openstackmanager-detachedvolume' ); |
493 | 483 | } else { |
494 | | - $wgOut->addWikiMsg( 'openstackmanager-detachvolumefailed' ); |
| 484 | + $this->getOutput()->addWikiMsg( 'openstackmanager-detachvolumefailed' ); |
495 | 485 | } |
496 | 486 | |
497 | 487 | $out = '<br />'; |
498 | 488 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backvolumelist' ) ); |
499 | 489 | |
500 | | - $wgOut->addHTML( $out ); |
| 490 | + $this->getOutput()->addHTML( $out ); |
501 | 491 | return true; |
502 | 492 | } |
503 | 493 | |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaKey.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | * @return bool |
41 | 41 | */ |
42 | 42 | function importKey() { |
43 | | - global $wgRequest, $wgOut; |
| 43 | + global $wgRequest; |
44 | 44 | global $wgOpenStackManagerNovaKeypairStorage; |
45 | 45 | |
46 | 46 | $project = ''; |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | } |
56 | 56 | |
57 | 57 | $this->setHeaders(); |
58 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-importkey' ) ); |
| 58 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-importkey' ) ); |
59 | 59 | |
60 | 60 | $keyInfo = array(); |
61 | 61 | |
— | — | @@ -100,11 +100,11 @@ |
101 | 101 | * @return bool |
102 | 102 | */ |
103 | 103 | function deleteKey() { |
104 | | - global $wgOut, $wgRequest; |
| 104 | + global $wgRequest; |
105 | 105 | global $wgOpenStackManagerNovaKeypairStorage; |
106 | 106 | |
107 | 107 | $this->setHeaders(); |
108 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletekey' ) ); |
| 108 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletekey' ) ); |
109 | 109 | |
110 | 110 | $keyInfo = array(); |
111 | 111 | $hash = ''; |
— | — | @@ -131,8 +131,8 @@ |
132 | 132 | $hash = $wgRequest->getVal( 'hash' ); |
133 | 133 | $keypairs = $this->userLDAP->getKeypairs(); |
134 | 134 | 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' ); |
137 | 137 | } |
138 | 138 | $keyInfo['hash'] = array( |
139 | 139 | 'type' => 'hidden', |
— | — | @@ -162,12 +162,11 @@ |
163 | 163 | * @return void |
164 | 164 | */ |
165 | 165 | function listKeys() { |
166 | | - global $wgOut; |
167 | 166 | global $wgOpenStackManagerNovaKeypairStorage; |
168 | 167 | |
169 | 168 | $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' ); |
172 | 171 | |
173 | 172 | $out = ''; |
174 | 173 | |
— | — | @@ -208,10 +207,10 @@ |
209 | 208 | } |
210 | 209 | $out .= Html::rawElement( 'table', array( 'id' => 'novakeylist', 'class' => 'wikitable' ), $keysOut ); |
211 | 210 | } else { |
212 | | - $wgOut->addWikiMsg( 'openstackmanager-invalidkeypair' ); |
| 211 | + $this->getOutput()->addWikiMsg( 'openstackmanager-invalidkeypair' ); |
213 | 212 | } |
214 | 213 | |
215 | | - $wgOut->addHTML( $out ); |
| 214 | + $this->getOutput()->addHTML( $out ); |
216 | 215 | } |
217 | 216 | |
218 | 217 | /** |
— | — | @@ -220,30 +219,29 @@ |
221 | 220 | * @return bool |
222 | 221 | */ |
223 | 222 | function tryImportSubmit( $formData, $entryPoint = 'internal' ) { |
224 | | - global $wgOut; |
225 | 223 | global $wgOpenStackManagerNovaKeypairStorage; |
226 | 224 | |
227 | 225 | if ( $wgOpenStackManagerNovaKeypairStorage == 'ldap' ) { |
228 | 226 | $success = $this->userLDAP->importKeypair( $formData['key'] ); |
229 | 227 | if ( ! $success ) { |
230 | | - $wgOut->addWikiMsg( 'openstackmanager-keypairimportfailed' ); |
| 228 | + $this->getOutput()->addWikiMsg( 'openstackmanager-keypairimportfailed' ); |
231 | 229 | return true; |
232 | 230 | } |
233 | | - $wgOut->addWikiMsg( 'openstackmanager-keypairimported' ); |
| 231 | + $this->getOutput()->addWikiMsg( 'openstackmanager-keypairimported' ); |
234 | 232 | } elseif ( $wgOpenStackManagerNovaKeypairStorage == 'nova' ) { |
235 | 233 | # wgOpenStackManagerNovaKeypairStorage == 'nova' |
236 | 234 | # OpenStack's EC2 API doesn't yet support importing keys, use |
237 | 235 | # of this option isn't currently recommended |
238 | 236 | $keypair = $this->userNova->importKeypair( $formData['keyname'], $formData['key'] ); |
239 | 237 | |
240 | | - $wgOut->addWikiMsg( 'openstackmanager-keypairimportedfingerprint', $keypair->getKeyName(), $keypair->getKeyFingerprint() ); |
| 238 | + $this->getOutput()->addWikiMsg( 'openstackmanager-keypairimportedfingerprint', $keypair->getKeyName(), $keypair->getKeyFingerprint() ); |
241 | 239 | } else { |
242 | | - $wgOut->addWikiMsg( 'openstackmanager-invalidkeypair' ); |
| 240 | + $this->getOutput()->addWikiMsg( 'openstackmanager-invalidkeypair' ); |
243 | 241 | } |
244 | 242 | $out = '<br />'; |
245 | 243 | |
246 | 244 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backkeylist' ) ); |
247 | | - $wgOut->addHTML( $out ); |
| 245 | + $this->getOutput()->addHTML( $out ); |
248 | 246 | return true; |
249 | 247 | } |
250 | 248 | |
— | — | @@ -253,18 +251,16 @@ |
254 | 252 | * @return bool |
255 | 253 | */ |
256 | 254 | function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) { |
257 | | - global $wgOut; |
258 | | - |
259 | 255 | $success = $this->userLDAP->deleteKeypair( $formData['key'] ); |
260 | 256 | if ( $success ) { |
261 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedkey' ); |
| 257 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedkey' ); |
262 | 258 | } else { |
263 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedkeyfailed' ); |
| 259 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedkeyfailed' ); |
264 | 260 | } |
265 | 261 | $out = '<br />'; |
266 | 262 | |
267 | 263 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backkeylist' ) ); |
268 | | - $wgOut->addHTML( $out ); |
| 264 | + $this->getOutput()->addHTML( $out ); |
269 | 265 | return true; |
270 | 266 | } |
271 | 267 | } |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaPuppetGroup.php |
— | — | @@ -40,14 +40,14 @@ |
41 | 41 | * @return bool |
42 | 42 | */ |
43 | 43 | function createPuppetGroup() { |
44 | | - global $wgOut, $wgUser; |
| 44 | + global $wgUser; |
45 | 45 | |
46 | 46 | $this->setHeaders(); |
47 | 47 | if ( !$this->userCanExecute( $wgUser ) ) { |
48 | 48 | $this->displayRestrictionError(); |
49 | 49 | return false; |
50 | 50 | } |
51 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createpuppetgroup' ) ); |
| 51 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createpuppetgroup' ) ); |
52 | 52 | |
53 | 53 | $puppetGroupInfo = array(); |
54 | 54 | $puppetGroupInfo['puppetgroupname'] = array( |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | * @return bool |
85 | 85 | */ |
86 | 86 | function addPuppetClass() { |
87 | | - global $wgRequest, $wgOut; |
| 87 | + global $wgRequest; |
88 | 88 | global $wgUser; |
89 | 89 | |
90 | 90 | $this->setHeaders(); |
— | — | @@ -91,7 +91,7 @@ |
92 | 92 | $this->displayRestrictionError(); |
93 | 93 | return false; |
94 | 94 | } |
95 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addpuppetclass' ) ); |
| 95 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addpuppetclass' ) ); |
96 | 96 | |
97 | 97 | $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' ); |
98 | 98 | $puppetGroupInfo = array(); |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | * @return bool |
132 | 132 | */ |
133 | 133 | function deletePuppetClass() { |
134 | | - global $wgRequest, $wgOut; |
| 134 | + global $wgRequest; |
135 | 135 | global $wgUser; |
136 | 136 | |
137 | 137 | $this->setHeaders(); |
— | — | @@ -138,9 +138,9 @@ |
139 | 139 | $this->displayRestrictionError(); |
140 | 140 | return false; |
141 | 141 | } |
142 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removepuppetclass' ) ); |
| 142 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removepuppetclass' ) ); |
143 | 143 | if ( ! $wgRequest->wasPosted() ) { |
144 | | - $wgOut->addWikiMsg( 'openstackmanager-removepuppetclassconfirm' ); |
| 144 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetclassconfirm' ); |
145 | 145 | } |
146 | 146 | $puppetClassId = $wgRequest->getInt( 'puppetclassid' ); |
147 | 147 | $puppetGroupInfo = array(); |
— | — | @@ -168,7 +168,7 @@ |
169 | 169 | * @return bool |
170 | 170 | */ |
171 | 171 | function addPuppetVar() { |
172 | | - global $wgRequest, $wgOut; |
| 172 | + global $wgRequest; |
173 | 173 | global $wgUser; |
174 | 174 | |
175 | 175 | $this->setHeaders(); |
— | — | @@ -176,7 +176,7 @@ |
177 | 177 | $this->displayRestrictionError(); |
178 | 178 | return false; |
179 | 179 | } |
180 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addpuppetvar' ) ); |
| 180 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addpuppetvar' ) ); |
181 | 181 | |
182 | 182 | $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' ); |
183 | 183 | $puppetGroupInfo = array(); |
— | — | @@ -215,7 +215,7 @@ |
216 | 216 | * @return bool |
217 | 217 | */ |
218 | 218 | function deletePuppetVar() { |
219 | | - global $wgRequest, $wgOut; |
| 219 | + global $wgRequest; |
220 | 220 | global $wgUser; |
221 | 221 | |
222 | 222 | $this->setHeaders(); |
— | — | @@ -223,11 +223,11 @@ |
224 | 224 | $this->displayRestrictionError(); |
225 | 225 | return false; |
226 | 226 | } |
227 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removepuppetvar' ) ); |
| 227 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removepuppetvar' ) ); |
228 | 228 | |
229 | 229 | $puppetVarId = $wgRequest->getText( 'puppetvarid' ); |
230 | 230 | if ( ! $wgRequest->wasPosted() ) { |
231 | | - $wgOut->addWikiMsg( 'openstackmanager-removepuppetvarconfirm' ); |
| 231 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetvarconfirm' ); |
232 | 232 | } |
233 | 233 | $puppetGroupInfo = array(); |
234 | 234 | $puppetGroupInfo['puppetvarid'] = array( |
— | — | @@ -254,7 +254,7 @@ |
255 | 255 | * @return bool |
256 | 256 | */ |
257 | 257 | function deletePuppetGroup() { |
258 | | - global $wgOut, $wgRequest; |
| 258 | + global $wgRequest; |
259 | 259 | global $wgUser; |
260 | 260 | |
261 | 261 | $this->setHeaders(); |
— | — | @@ -262,11 +262,11 @@ |
263 | 263 | $this->displayRestrictionError(); |
264 | 264 | return false; |
265 | 265 | } |
266 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletepuppetgroup' ) ); |
| 266 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletepuppetgroup' ) ); |
267 | 267 | |
268 | 268 | $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' ); |
269 | 269 | if ( ! $wgRequest->wasPosted() ) { |
270 | | - $wgOut->addWikiMsg( 'openstackmanager-removepuppetgroupconfirm' ); |
| 270 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetgroupconfirm' ); |
271 | 271 | } |
272 | 272 | $puppetGroupInfo = array(); |
273 | 273 | $puppetGroupInfo['puppetgroupid'] = array( |
— | — | @@ -292,7 +292,7 @@ |
293 | 293 | * @return bool |
294 | 294 | */ |
295 | 295 | function modifyPuppetClass() { |
296 | | - global $wgRequest, $wgOut; |
| 296 | + global $wgRequest; |
297 | 297 | global $wgUser; |
298 | 298 | |
299 | 299 | $this->setHeaders(); |
— | — | @@ -300,7 +300,7 @@ |
301 | 301 | $this->displayRestrictionError(); |
302 | 302 | return false; |
303 | 303 | } |
304 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-modifypuppetclass' ) ); |
| 304 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetclass' ) ); |
305 | 305 | |
306 | 306 | $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' ); |
307 | 307 | $puppetClassId = $wgRequest->getInt( 'puppetclassid' ); |
— | — | @@ -349,7 +349,7 @@ |
350 | 350 | * @return bool |
351 | 351 | */ |
352 | 352 | function modifyPuppetVar() { |
353 | | - global $wgRequest, $wgOut; |
| 353 | + global $wgRequest; |
354 | 354 | global $wgUser; |
355 | 355 | |
356 | 356 | $this->setHeaders(); |
— | — | @@ -357,7 +357,7 @@ |
358 | 358 | $this->displayRestrictionError(); |
359 | 359 | return false; |
360 | 360 | } |
361 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-modifypuppetvar' ) ); |
| 361 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetvar' ) ); |
362 | 362 | |
363 | 363 | $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' ); |
364 | 364 | $puppetVarId = $wgRequest->getInt( 'puppetvarid' ); |
— | — | @@ -406,7 +406,7 @@ |
407 | 407 | * @return bool |
408 | 408 | */ |
409 | 409 | function modifyPuppetGroup() { |
410 | | - global $wgRequest, $wgOut; |
| 410 | + global $wgRequest; |
411 | 411 | global $wgUser; |
412 | 412 | |
413 | 413 | $this->setHeaders(); |
— | — | @@ -414,7 +414,7 @@ |
415 | 415 | $this->displayRestrictionError(); |
416 | 416 | return false; |
417 | 417 | } |
418 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-modifypuppetgroup' ) ); |
| 418 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetgroup' ) ); |
419 | 419 | |
420 | 420 | $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' ); |
421 | 421 | $puppetGroupPosition = $wgRequest->getInt( 'puppetgroupposition' ); |
— | — | @@ -449,11 +449,9 @@ |
450 | 450 | * @return void |
451 | 451 | */ |
452 | 452 | function listPuppetGroups() { |
453 | | - global $wgOut; |
454 | | - |
455 | 453 | $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' ); |
458 | 456 | |
459 | 457 | $out = ''; |
460 | 458 | |
— | — | @@ -496,7 +494,7 @@ |
497 | 495 | } |
498 | 496 | } |
499 | 497 | |
500 | | - $wgOut->addHTML( $out ); |
| 498 | + $this->getOutput()->addHTML( $out ); |
501 | 499 | } |
502 | 500 | |
503 | 501 | /** |
— | — | @@ -505,18 +503,16 @@ |
506 | 504 | * @return bool |
507 | 505 | */ |
508 | 506 | function tryCreateSubmit( $formData, $entryPoint = 'internal' ) { |
509 | | - global $wgOut; |
510 | | - |
511 | 507 | $success = OpenStackNovaPuppetGroup::addGroup( $formData['puppetgroupname'], $formData['puppetgroupposition'] ); |
512 | 508 | if ( $success ) { |
513 | | - $wgOut->addWikiMsg( 'openstackmanager-createdpuppetgroup' ); |
| 509 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createdpuppetgroup' ); |
514 | 510 | } else { |
515 | | - $wgOut->addWikiMsg( 'openstackmanager-createpuppetgroupfailed' ); |
| 511 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createpuppetgroupfailed' ); |
516 | 512 | } |
517 | 513 | |
518 | 514 | $out = '<br />'; |
519 | 515 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) ); |
520 | | - $wgOut->addHTML( $out ); |
| 516 | + $this->getOutput()->addHTML( $out ); |
521 | 517 | |
522 | 518 | return true; |
523 | 519 | } |
— | — | @@ -527,18 +523,16 @@ |
528 | 524 | * @return bool |
529 | 525 | */ |
530 | 526 | function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) { |
531 | | - global $wgOut; |
532 | | - |
533 | 527 | $success = OpenStackNovaPuppetGroup::deleteGroup( $formData['puppetgroupid'] ); |
534 | 528 | if ( $success ) { |
535 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedpuppetgroup' ); |
| 529 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedpuppetgroup' ); |
536 | 530 | } else { |
537 | | - $wgOut->addWikiMsg( 'openstackmanager-deletepuppetgroupfailed' ); |
| 531 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletepuppetgroupfailed' ); |
538 | 532 | } |
539 | 533 | |
540 | 534 | $out = '<br />'; |
541 | 535 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) ); |
542 | | - $wgOut->addHTML( $out ); |
| 536 | + $this->getOutput()->addHTML( $out ); |
543 | 537 | |
544 | 538 | return true; |
545 | 539 | } |
— | — | @@ -549,18 +543,16 @@ |
550 | 544 | * @return bool |
551 | 545 | */ |
552 | 546 | function tryAddClassSubmit( $formData, $entryPoint = 'internal' ) { |
553 | | - global $wgOut; |
554 | | - |
555 | 547 | $success = OpenStackNovaPuppetGroup::addClass( $formData['puppetclassname'], $formData['puppetclassposition'], $formData['puppetgroupid'] ); |
556 | 548 | if ( $success ) { |
557 | | - $wgOut->addWikiMsg( 'openstackmanager-addedpuppetclass' ); |
| 549 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addedpuppetclass' ); |
558 | 550 | } else { |
559 | | - $wgOut->addWikiMsg( 'openstackmanager-failedtoaddpuppetclass' ); |
| 551 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoaddpuppetclass' ); |
560 | 552 | } |
561 | 553 | |
562 | 554 | $out = '<br />'; |
563 | 555 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) ); |
564 | | - $wgOut->addHTML( $out ); |
| 556 | + $this->getOutput()->addHTML( $out ); |
565 | 557 | |
566 | 558 | return true; |
567 | 559 | } |
— | — | @@ -571,18 +563,16 @@ |
572 | 564 | * @return bool |
573 | 565 | */ |
574 | 566 | function tryDeleteClassSubmit( $formData, $entryPoint = 'internal' ) { |
575 | | - global $wgOut; |
576 | | - |
577 | 567 | $success = OpenStackNovaPuppetGroup::deleteClass( $formData['puppetclassid'] ); |
578 | 568 | if ( $success ) { |
579 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedpuppetclass' ); |
| 569 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedpuppetclass' ); |
580 | 570 | } else { |
581 | | - $wgOut->addWikiMsg( 'openstackmanager-failedtodeletepuppetclass' ); |
| 571 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedtodeletepuppetclass' ); |
582 | 572 | } |
583 | 573 | $out = '<br />'; |
584 | 574 | |
585 | 575 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) ); |
586 | | - $wgOut->addHTML( $out ); |
| 576 | + $this->getOutput()->addHTML( $out ); |
587 | 577 | |
588 | 578 | return true; |
589 | 579 | } |
— | — | @@ -593,18 +583,16 @@ |
594 | 584 | * @return bool |
595 | 585 | */ |
596 | 586 | function tryAddVarSubmit( $formData, $entryPoint = 'internal' ) { |
597 | | - global $wgOut; |
598 | | - |
599 | 587 | $success = OpenStackNovaPuppetGroup::addVar( $formData['puppetvarname'], $formData['puppetvarposition'], $formData['puppetgroupid'] ); |
600 | 588 | if ( $success ) { |
601 | | - $wgOut->addWikiMsg( 'openstackmanager-addedpuppetvar' ); |
| 589 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addedpuppetvar' ); |
602 | 590 | } else { |
603 | | - $wgOut->addWikiMsg( 'openstackmanager-failedtoaddpuppetvar' ); |
| 591 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoaddpuppetvar' ); |
604 | 592 | } |
605 | 593 | |
606 | 594 | $out = '<br />'; |
607 | 595 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) ); |
608 | | - $wgOut->addHTML( $out ); |
| 596 | + $this->getOutput()->addHTML( $out ); |
609 | 597 | |
610 | 598 | return true; |
611 | 599 | } |
— | — | @@ -615,18 +603,16 @@ |
616 | 604 | * @return bool |
617 | 605 | */ |
618 | 606 | function tryDeleteVarSubmit( $formData, $entryPoint = 'internal' ) { |
619 | | - global $wgOut; |
620 | | - |
621 | 607 | $success = OpenStackNovaPuppetGroup::deleteVar( $formData['puppetvarid'] ); |
622 | 608 | if ( $success ) { |
623 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedpuppetvar' ); |
| 609 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedpuppetvar' ); |
624 | 610 | } else { |
625 | | - $wgOut->addWikiMsg( 'openstackmanager-failedtodeletepuppetvar' ); |
| 611 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedtodeletepuppetvar' ); |
626 | 612 | } |
627 | 613 | $out = '<br />'; |
628 | 614 | |
629 | 615 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) ); |
630 | | - $wgOut->addHTML( $out ); |
| 616 | + $this->getOutput()->addHTML( $out ); |
631 | 617 | |
632 | 618 | return true; |
633 | 619 | } |
— | — | @@ -637,18 +623,16 @@ |
638 | 624 | * @return bool |
639 | 625 | */ |
640 | 626 | function tryModifyClassSubmit( $formData, $entryPoint = 'internal' ) { |
641 | | - global $wgOut; |
642 | | - |
643 | 627 | $success = OpenStackNovaPuppetGroup::updateClass( $formData['puppetclassid'], $formData['puppetgroupid'], $formData['puppetclassposition'] ); |
644 | 628 | if ( $success ) { |
645 | | - $wgOut->addWikiMsg( 'openstackmanager-modifiedpuppetclass' ); |
| 629 | + $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedpuppetclass' ); |
646 | 630 | } else { |
647 | | - $wgOut->addWikiMsg( 'openstackmanager-failedtomodifypuppetclass' ); |
| 631 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedtomodifypuppetclass' ); |
648 | 632 | } |
649 | 633 | $out = '<br />'; |
650 | 634 | |
651 | 635 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) ); |
652 | | - $wgOut->addHTML( $out ); |
| 636 | + $this->getOutput()->addHTML( $out ); |
653 | 637 | |
654 | 638 | return true; |
655 | 639 | } |
— | — | @@ -659,18 +643,16 @@ |
660 | 644 | * @return bool |
661 | 645 | */ |
662 | 646 | function tryModifyVarSubmit( $formData, $entryPoint = 'internal' ) { |
663 | | - global $wgOut; |
664 | | - |
665 | 647 | $success = OpenStackNovaPuppetGroup::updateVar( $formData['puppetvarid'], $formData['puppetgroupid'], $formData['puppetvarposition'] ); |
666 | 648 | if ( $success ) { |
667 | | - $wgOut->addWikiMsg( 'openstackmanager-modifiedpuppetvar' ); |
| 649 | + $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedpuppetvar' ); |
668 | 650 | } else { |
669 | | - $wgOut->addWikiMsg( 'openstackmanager-failedtomodifypuppetvar' ); |
| 651 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedtomodifypuppetvar' ); |
670 | 652 | } |
671 | 653 | $out = '<br />'; |
672 | 654 | |
673 | 655 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) ); |
674 | | - $wgOut->addHTML( $out ); |
| 656 | + $this->getOutput()->addHTML( $out ); |
675 | 657 | |
676 | 658 | return true; |
677 | 659 | } |
— | — | @@ -681,18 +663,16 @@ |
682 | 664 | * @return bool |
683 | 665 | */ |
684 | 666 | function tryModifyGroupSubmit( $formData, $entryPoint = 'internal' ) { |
685 | | - global $wgOut; |
686 | | - |
687 | 667 | $success = OpenStackNovaPuppetGroup::updateGroupPosition( $formData['puppetgroupid'], $formData['puppetgroupposition'] ); |
688 | 668 | if ( $success ) { |
689 | | - $wgOut->addWikiMsg( 'openstackmanager-modifiedpuppetgroup' ); |
| 669 | + $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedpuppetgroup' ); |
690 | 670 | } else { |
691 | | - $wgOut->addWikiMsg( 'openstackmanager-failedtomodifypuppetgroup' ); |
| 671 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedtomodifypuppetgroup' ); |
692 | 672 | } |
693 | 673 | $out = '<br />'; |
694 | 674 | |
695 | 675 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backpuppetgrouplist' ) ); |
696 | | - $wgOut->addHTML( $out ); |
| 676 | + $this->getOutput()->addHTML( $out ); |
697 | 677 | |
698 | 678 | return true; |
699 | 679 | } |
Index: trunk/extensions/OpenStackManager/special/SpecialNova.php |
— | — | @@ -6,33 +6,27 @@ |
7 | 7 | * @return void |
8 | 8 | */ |
9 | 9 | function notLoggedIn() { |
10 | | - global $wgOut; |
11 | | - |
12 | 10 | $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' ); |
15 | 13 | } |
16 | 14 | |
17 | 15 | /** |
18 | 16 | * @return void |
19 | 17 | */ |
20 | 18 | function noCredentials() { |
21 | | - global $wgOut; |
22 | | - |
23 | 19 | $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' ); |
26 | 22 | } |
27 | 23 | |
28 | 24 | /** |
29 | 25 | * @return void |
30 | 26 | */ |
31 | 27 | function notInProject() { |
32 | | - global $wgOut; |
33 | | - |
34 | 28 | $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' ); |
37 | 31 | } |
38 | 32 | |
39 | 33 | /** |
— | — | @@ -40,18 +34,16 @@ |
41 | 35 | * @return void |
42 | 36 | */ |
43 | 37 | function notInRole( $role ) { |
44 | | - global $wgOut; |
45 | | - |
46 | 38 | $this->setHeaders(); |
47 | 39 | 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' ); |
50 | 42 | } 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' ); |
53 | 45 | } 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' ); |
56 | 48 | } |
57 | 49 | } |
58 | 50 | |
— | — | @@ -62,7 +54,7 @@ |
63 | 55 | * @return bool|string |
64 | 56 | */ |
65 | 57 | function validateText( $resourcename, $alldata ) { |
66 | | - if ( ! preg_match( "/^[a-z][a-z0-9\-]*$/", $resourcename ) ) { |
| 58 | + if ( ! preg_match( "/^[a-z][a-z0-9-]*$/", $resourcename ) ) { |
67 | 59 | return Xml::element( 'span', array( 'class' => 'error' ), wfMsg( 'openstackmanager-badresourcename' ) ); |
68 | 60 | } else { |
69 | 61 | return true; |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaRole.php |
— | — | @@ -36,11 +36,10 @@ |
37 | 37 | * @return bool |
38 | 38 | */ |
39 | 39 | function addMember() { |
40 | | - global $wgRequest, $wgOut; |
41 | | - global $wgUser; |
| 40 | + global $wgRequest, $wgUser; |
42 | 41 | |
43 | 42 | $this->setHeaders(); |
44 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-addmember' ) ); |
| 43 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addmember' ) ); |
45 | 44 | |
46 | 45 | $roleInfo = array(); |
47 | 46 | $rolename = $wgRequest->getText( 'rolename' ); |
— | — | @@ -61,7 +60,7 @@ |
62 | 61 | } |
63 | 62 | } |
64 | 63 | if ( ! $member_keys ) { |
65 | | - $wgOut->addWikiMsg( 'openstackmanager-nomemberstoadd' ); |
| 64 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nomemberstoadd' ); |
66 | 65 | return true; |
67 | 66 | } |
68 | 67 | $roleInfo['members'] = array( |
— | — | @@ -118,11 +117,11 @@ |
119 | 118 | * @return bool |
120 | 119 | */ |
121 | 120 | function deleteMember() { |
122 | | - global $wgRequest, $wgOut; |
| 121 | + global $wgRequest; |
123 | 122 | global $wgUser; |
124 | 123 | |
125 | 124 | $this->setHeaders(); |
126 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-removerolemember' ) ); |
| 125 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removerolemember' ) ); |
127 | 126 | |
128 | 127 | $rolename = $wgRequest->getText( 'rolename' ); |
129 | 128 | $projectname = $wgRequest->getText( 'projectname' ); |
— | — | @@ -154,7 +153,7 @@ |
155 | 154 | } |
156 | 155 | } |
157 | 156 | if ( ! $member_keys ) { |
158 | | - $wgOut->addWikiMsg( 'openstackmanager-nomemberstoremove' ); |
| 157 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nomemberstoremove' ); |
159 | 158 | return true; |
160 | 159 | } |
161 | 160 | $roleInfo = array(); |
— | — | @@ -199,10 +198,8 @@ |
200 | 199 | * @return void |
201 | 200 | */ |
202 | 201 | function listGlobalRoles() { |
203 | | - global $wgOut; |
204 | | - |
205 | 202 | $this->setHeaders(); |
206 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-rolelist' ) ); |
| 203 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-rolelist' ) ); |
207 | 204 | |
208 | 205 | $out = ''; |
209 | 206 | |
— | — | @@ -237,7 +234,7 @@ |
238 | 235 | $out .= Html::rawElement( 'table', array( 'class' => 'wikitable sortable collapsible' ), $rolesOut ); |
239 | 236 | } |
240 | 237 | |
241 | | - $wgOut->addHTML( $out ); |
| 238 | + $this->getOutput()->addHTML( $out ); |
242 | 239 | } |
243 | 240 | |
244 | 241 | /** |
— | — | @@ -246,13 +243,11 @@ |
247 | 244 | * @return bool |
248 | 245 | */ |
249 | 246 | function tryAddMemberSubmit( $formData, $entryPoint = 'internal' ) { |
250 | | - global $wgOut; |
251 | | - |
252 | 247 | $projectname = $formData['projectname']; |
253 | 248 | if ( $projectname ) { |
254 | 249 | $project = OpenStackNovaProject::getProjectByName( $projectname ); |
255 | 250 | if ( ! $project ) { |
256 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistentproject' ); |
| 251 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistentproject' ); |
257 | 252 | return true; |
258 | 253 | } |
259 | 254 | $role = OpenStackNovaRole::getProjectRoleByName( $formData['rolename'], $project ); |
— | — | @@ -262,22 +257,22 @@ |
263 | 258 | $members = array( $formData['members'] ); |
264 | 259 | } |
265 | 260 | if ( ! $role ) { |
266 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistentrole' ); |
| 261 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistentrole' ); |
267 | 262 | return true; |
268 | 263 | } |
269 | 264 | foreach ( $members as $member ) { |
270 | 265 | $success = $role->addMember( $member ); |
271 | 266 | if ( $success ) { |
272 | | - $wgOut->addWikiMsg( 'openstackmanager-addedto', $member, $formData['rolename'] ); |
| 267 | + $this->getOutput()->addWikiMsg( 'openstackmanager-addedto', $member, $formData['rolename'] ); |
273 | 268 | } else { |
274 | | - $wgOut->addWikiMsg( 'openstackmanager-failedtoadd', $member, $formData['rolename'] ); |
| 269 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoadd', $member, $formData['rolename'] ); |
275 | 270 | } |
276 | 271 | } |
277 | 272 | |
278 | 273 | $out = '<br />'; |
279 | 274 | $returnto = Title::newFromText( $formData['returnto'] ); |
280 | 275 | $out .= Linker::( $returnto, wfMsgHtml( 'openstackmanager-backprojectlist' ) ); |
281 | | - $wgOut->addHTML( $out ); |
| 276 | + $this->getOutput()->addHTML( $out ); |
282 | 277 | |
283 | 278 | return true; |
284 | 279 | } |
— | — | @@ -288,13 +283,11 @@ |
289 | 284 | * @return bool |
290 | 285 | */ |
291 | 286 | function tryDeleteMemberSubmit( $formData, $entryPoint = 'internal' ) { |
292 | | - global $wgOut; |
293 | | - |
294 | 287 | $projectname = $formData['projectname']; |
295 | 288 | if ( $projectname ) { |
296 | 289 | $project = OpenStackNovaProject::getProjectByName( $projectname ); |
297 | 290 | if ( ! $project ) { |
298 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistentproject' ); |
| 291 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistentproject' ); |
299 | 292 | return true; |
300 | 293 | } |
301 | 294 | $role = OpenStackNovaRole::getProjectRoleByName( $formData['rolename'], $project ); |
— | — | @@ -302,22 +295,22 @@ |
303 | 296 | $role = OpenStackNovaRole::getGlobalRoleByName( $formData['rolename'] ); |
304 | 297 | } |
305 | 298 | if ( ! $role ) { |
306 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistentrole' ); |
| 299 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistentrole' ); |
307 | 300 | return true; |
308 | 301 | } |
309 | 302 | foreach ( $formData['members'] as $member ) { |
310 | 303 | $success = $role->deleteMember( $member ); |
311 | 304 | if ( $success ) { |
312 | | - $wgOut->addWikiMsg( 'openstackmanager-removedfrom', $member, $formData['rolename'] ); |
| 305 | + $this->getOutput()->addWikiMsg( 'openstackmanager-removedfrom', $member, $formData['rolename'] ); |
313 | 306 | } else { |
314 | | - $wgOut->addWikiMsg( 'openstackmanager-failedtoremove', $member, $formData['rolename'] ); |
| 307 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedtoremove', $member, $formData['rolename'] ); |
315 | 308 | } |
316 | 309 | } |
317 | 310 | |
318 | 311 | $out = '<br />'; |
319 | 312 | $returnto = Title::newFromText( $formData['returnto'] ); |
320 | 313 | $out .= Linker::( $returnto, wfMsgHtml( 'openstackmanager-backprojectlist' ) ); |
321 | | - $wgOut->addHTML( $out ); |
| 314 | + $this->getOutput()->addHTML( $out ); |
322 | 315 | |
323 | 316 | return true; |
324 | 317 | } |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSudoer.php |
— | — | @@ -37,10 +37,8 @@ |
38 | 38 | * @return bool |
39 | 39 | */ |
40 | 40 | function createSudoer() { |
41 | | - global $wgOut; |
42 | | - |
43 | 41 | $this->setHeaders(); |
44 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-createsudoer' ) ); |
| 42 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createsudoer' ) ); |
45 | 43 | |
46 | 44 | $sudoerInfo = array(); |
47 | 45 | $sudoerInfo['sudoername'] = array( |
— | — | @@ -101,14 +99,14 @@ |
102 | 100 | * @return bool |
103 | 101 | */ |
104 | 102 | function deleteSudoer() { |
105 | | - global $wgOut, $wgRequest; |
| 103 | + global $wgRequest; |
106 | 104 | |
107 | 105 | $this->setHeaders(); |
108 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletesudoer' ) ); |
| 106 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletesudoer' ) ); |
109 | 107 | |
110 | 108 | $sudoername = $wgRequest->getText( 'sudoername' ); |
111 | 109 | if ( ! $wgRequest->wasPosted() ) { |
112 | | - $wgOut->addWikiMsg( 'openstackmanager-deletesudoer-confirm', $sudoername ); |
| 110 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletesudoer-confirm', $sudoername ); |
113 | 111 | } |
114 | 112 | $sudoerInfo = array(); |
115 | 113 | $sudoerInfo['sudoername'] = array( |
— | — | @@ -134,10 +132,10 @@ |
135 | 133 | * @return bool |
136 | 134 | */ |
137 | 135 | function modifySudoer() { |
138 | | - global $wgRequest, $wgOut; |
| 136 | + global $wgRequest; |
139 | 137 | |
140 | 138 | $this->setHeaders(); |
141 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-modifysudoer' ) ); |
| 139 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifysudoer' ) ); |
142 | 140 | |
143 | 141 | $sudoername = $wgRequest->getText( 'sudoername' ); |
144 | 142 | $sudoer = OpenStackNovaSudoer::getSudoerByName( $sudoername ); |
— | — | @@ -209,10 +207,8 @@ |
210 | 208 | * @return void |
211 | 209 | */ |
212 | 210 | function listSudoers() { |
213 | | - global $wgOut; |
214 | | - |
215 | 211 | $this->setHeaders(); |
216 | | - $wgOut->setPagetitle( wfMsg( 'openstackmanager-sudoerlist' ) ); |
| 212 | + $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-sudoerlist' ) ); |
217 | 213 | |
218 | 214 | $out = ''; |
219 | 215 | |
— | — | @@ -271,7 +267,7 @@ |
272 | 268 | $out .= Html::rawElement( 'table', array( 'class' => 'wikitable sortable collapsible' ), $sudoersOut ); |
273 | 269 | } |
274 | 270 | |
275 | | - $wgOut->addHTML( $out ); |
| 271 | + $this->getOutput()->addHTML( $out ); |
276 | 272 | } |
277 | 273 | |
278 | 274 | /** |
— | — | @@ -280,8 +276,6 @@ |
281 | 277 | * @return bool |
282 | 278 | */ |
283 | 279 | function tryCreateSubmit( $formData, $entryPoint = 'internal' ) { |
284 | | - global $wgOut; |
285 | | - |
286 | 280 | if ( $formData['users'] ) { |
287 | 281 | $users = explode( ',', $formData['users'] ); |
288 | 282 | } else { |
— | — | @@ -304,14 +298,14 @@ |
305 | 299 | } |
306 | 300 | $success = OpenStackNovaSudoer::createSudoer( $formData['sudoername'], $users, $hosts, $commands, $options ); |
307 | 301 | if ( ! $success ) { |
308 | | - $wgOut->addWikiMsg( 'openstackmanager-createsudoerfailed' ); |
| 302 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createsudoerfailed' ); |
309 | 303 | return true; |
310 | 304 | } |
311 | | - $wgOut->addWikiMsg( 'openstackmanager-createdsudoer' ); |
| 305 | + $this->getOutput()->addWikiMsg( 'openstackmanager-createdsudoer' ); |
312 | 306 | |
313 | 307 | $out = '<br />'; |
314 | 308 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsudoerlist' ) ); |
315 | | - $wgOut->addHTML( $out ); |
| 309 | + $this->getOutput()->addHTML( $out ); |
316 | 310 | |
317 | 311 | return true; |
318 | 312 | } |
— | — | @@ -322,18 +316,17 @@ |
323 | 317 | * @return bool |
324 | 318 | */ |
325 | 319 | function tryDeleteSubmit( $formData, $entryPoint = 'internal' ) { |
326 | | - global $wgOut; |
327 | 320 | |
328 | 321 | $success = OpenStackNovaSudoer::deleteSudoer( $formData['sudoername'] ); |
329 | 322 | if ( $success ) { |
330 | | - $wgOut->addWikiMsg( 'openstackmanager-deletedsudoer' ); |
| 323 | + $this->getOutput()->addWikiMsg( 'openstackmanager-deletedsudoer' ); |
331 | 324 | } else { |
332 | | - $wgOut->addWikiMsg( 'openstackmanager-failedeletedsudoer' ); |
| 325 | + $this->getOutput()->addWikiMsg( 'openstackmanager-failedeletedsudoer' ); |
333 | 326 | } |
334 | 327 | |
335 | 328 | $out = '<br />'; |
336 | 329 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsudoerlist' ) ); |
337 | | - $wgOut->addHTML( $out ); |
| 330 | + $this->getOutput()->addHTML( $out ); |
338 | 331 | |
339 | 332 | return true; |
340 | 333 | } |
— | — | @@ -344,8 +337,6 @@ |
345 | 338 | * @return bool |
346 | 339 | */ |
347 | 340 | function tryModifySubmit( $formData, $entryPoint = 'internal' ) { |
348 | | - global $wgOut; |
349 | | - |
350 | 341 | $sudoer = OpenStackNovaSudoer::getSudoerByName( $formData['sudoername'] ); |
351 | 342 | if ( $sudoer ) { |
352 | 343 | if ( $formData['users'] ) { |
— | — | @@ -370,17 +361,17 @@ |
371 | 362 | } |
372 | 363 | $success = $sudoer->modifySudoer( $users, $hosts, $commands, $options ); |
373 | 364 | if ( ! $success ) { |
374 | | - $wgOut->addWikiMsg( 'openstackmanager-modifysudoerfailed' ); |
| 365 | + $this->getOutput()->addWikiMsg( 'openstackmanager-modifysudoerfailed' ); |
375 | 366 | return true; |
376 | 367 | } |
377 | | - $wgOut->addWikiMsg( 'openstackmanager-modifiedsudoer' ); |
| 368 | + $this->getOutput()->addWikiMsg( 'openstackmanager-modifiedsudoer' ); |
378 | 369 | } else { |
379 | | - $wgOut->addWikiMsg( 'openstackmanager-nonexistantsudoer' ); |
| 370 | + $this->getOutput()->addWikiMsg( 'openstackmanager-nonexistantsudoer' ); |
380 | 371 | } |
381 | 372 | |
382 | 373 | $out = '<br />'; |
383 | 374 | $out .= Linker::( $this->getTitle(), wfMsgHtml( 'openstackmanager-backsudoerlist' ) ); |
384 | | - $wgOut->addHTML( $out ); |
| 375 | + $this->getOutput()->addHTML( $out ); |
385 | 376 | |
386 | 377 | return true; |
387 | 378 | } |