r107246 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107245‎ | r107246 | r107247 >
Date:23:51, 24 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Also bye to $wgRequest for good measure
Modified paths:
  • /trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaKey.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaProject.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaPuppetGroup.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaRole.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaSudoer.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaVolume.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php
@@ -16,7 +16,6 @@
1717 }
1818
1919 function execute( $par ) {
20 - global $wgRequest;
2120 global $wgOpenStackManagerNovaAdminKeys;
2221
2322 if ( !$this->getUser()->isLoggedIn() ) {
@@ -28,13 +27,13 @@
2928 $this->noCredentials();
3029 return;
3130 }
32 - $project = $wgRequest->getVal( 'project' );
 31+ $project = $this->getRequest()->getVal( 'project' );
3332 $userCredentials = $this->userLDAP->getCredentials();
3433 $this->userNova = new OpenStackNovaController( $userCredentials, $project );
3534 $adminCredentials = $wgOpenStackManagerNovaAdminKeys;
3635 $this->adminNova = new OpenStackNovaController( $adminCredentials );
3736
38 - $action = $wgRequest->getVal( 'action' );
 37+ $action = $this->getRequest()->getVal( 'action' );
3938
4039 if ( $action == "create" ) {
4140 if ( ! $this->userLDAP->inProject( $project ) ) {
@@ -75,14 +74,14 @@
7675 * @return bool
7776 */
7877 function createInstance() {
79 - global $wgRequest;
 78+
8079 global $wgOpenStackManagerPuppetOptions;
8180 global $wgOpenStackManagerInstanceDefaultImage;
8281
8382 $this->setHeaders();
8483 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createinstance' ) );
8584
86 - $project = $wgRequest->getText( 'project' );
 85+ $project = $this->getRequest()->getText( 'project' );
8786 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
8887 $this->notInRole( 'sysadmin' );
8988 return false;
@@ -246,18 +245,18 @@
247246 * @return bool
248247 */
249248 function configureInstance() {
250 - global $wgRequest;
 249+
251250 global $wgOpenStackManagerPuppetOptions;
252251
253252 $this->setHeaders();
254253 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-configureinstance' ) );
255254
256 - $project = $wgRequest->getText( 'project' );
 255+ $project = $this->getRequest()->getText( 'project' );
257256 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
258257 $this->notInRole( 'sysadmin' );
259258 return false;
260259 }
261 - $instanceid = $wgRequest->getText( 'instanceid' );
 260+ $instanceid = $this->getRequest()->getText( 'instanceid' );
262261 $instanceInfo = array();
263262 $instanceInfo['instanceid'] = array(
264263 'type' => 'hidden',
@@ -349,18 +348,18 @@
350349 * @return bool
351350 */
352351 function deleteInstance() {
353 - global $wgRequest;
354352
 353+
355354 $this->setHeaders();
356355 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deleteinstance' ) );
357356
358 - $project = $wgRequest->getText( 'project' );
 357+ $project = $this->getRequest()->getText( 'project' );
359358 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
360359 $this->notInRole( 'sysadmin' );
361360 return false;
362361 }
363 - $instanceid = $wgRequest->getText( 'instanceid' );
364 - if ( ! $wgRequest->wasPosted() ) {
 362+ $instanceid = $this->getRequest()->getText( 'instanceid' );
 363+ if ( ! $this->getRequest()->wasPosted() ) {
365364 $this->getOutput()->addWikiMsg( 'openstackmanager-deleteinstancequestion', $instanceid );
366365 }
367366 $instanceInfo = array();
@@ -392,18 +391,18 @@
393392 * @return bool
394393 */
395394 function rebootInstance() {
396 - global $wgRequest;
397395
 396+
398397 $this->setHeaders();
399398 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-rebootinstance' ) );
400399
401 - $project = $wgRequest->getText( 'project' );
 400+ $project = $this->getRequest()->getText( 'project' );
402401 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
403402 $this->notInRole( 'sysadmin' );
404403 return false;
405404 }
406 - $instanceid = $wgRequest->getText( 'instanceid' );
407 - if ( ! $wgRequest->wasPosted() ) {
 405+ $instanceid = $this->getRequest()->getText( 'instanceid' );
 406+ if ( ! $this->getRequest()->wasPosted() ) {
408407 $this->getOutput()->addWikiMsg( 'openstackmanager-rebootinstancequestion', $instanceid );
409408 }
410409 $instanceInfo = array();
@@ -434,17 +433,17 @@
435434 * @return bool
436435 */
437436 function getConsoleOutput() {
438 - global $wgRequest;
439437
 438+
440439 $this->setHeaders();
441440 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-consoleoutput' ) );
442441
443 - $project = $wgRequest->getText( 'project' );
 442+ $project = $this->getRequest()->getText( 'project' );
444443 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
445444 $this->notInRole( 'sysadmin' );
446445 return;
447446 }
448 - $instanceid = $wgRequest->getText( 'instanceid' );
 447+ $instanceid = $this->getRequest()->getText( 'instanceid' );
449448 $consoleOutput = $this->userNova->getConsoleOutput( $instanceid );
450449 $out = Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) );
451450 $out .= Html::element( 'pre', array(), $consoleOutput );
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php
@@ -16,7 +16,6 @@
1717 }
1818
1919 function execute( $par ) {
20 - global $wgRequest;
2120 global $wgOpenStackManagerNovaAdminKeys;
2221
2322 if ( !$this->getUser()->isLoggedIn() ) {
@@ -31,7 +30,7 @@
3231 $adminCredentials = $wgOpenStackManagerNovaAdminKeys;
3332 $this->adminNova = new OpenStackNovaController( $adminCredentials );
3433
35 - $action = $wgRequest->getVal( 'action' );
 34+ $action = $this->getRequest()->getVal( 'action' );
3635
3736 if ( $action == "create" ) {
3837 $this->createSecurityGroup();
@@ -54,12 +53,12 @@
5554 * @return bool
5655 */
5756 function createSecurityGroup() {
58 - global $wgRequest;
5957
 58+
6059 $this->setHeaders();
6160 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createsecuritygroup' ) );
6261
63 - $project = $wgRequest->getText( 'project' );
 62+ $project = $this->getRequest()->getText( 'project' );
6463 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
6564 $this->notInRole( 'netadmin' );
6665 return false;
@@ -103,13 +102,13 @@
104103 * @return bool
105104 */
106105 function configureSecurityGroup() {
107 - global $wgRequest;
108106
 107+
109108 $this->setHeaders();
110109 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-configuresecuritygroup' ) );
111110
112 - $securitygroupname = $wgRequest->getText( 'groupname' );
113 - $project = $wgRequest->getText( 'project' );
 111+ $securitygroupname = $this->getRequest()->getText( 'groupname' );
 112+ $project = $this->getRequest()->getText( 'project' );
114113 $securitygroup = $this->adminNova->getSecurityGroup( $securitygroupname, $project );
115114 $description = $securitygroup->getGroupDescription();
116115 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
@@ -154,18 +153,18 @@
155154 * @return bool
156155 */
157156 function deleteSecurityGroup() {
158 - global $wgRequest;
159157
 158+
160159 $this->setHeaders();
161160 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletesecuritygroup' ) );
162161
163 - $project = $wgRequest->getText( 'project' );
 162+ $project = $this->getRequest()->getText( 'project' );
164163 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
165164 $this->notInRole( 'netadmin' );
166165 return false;
167166 }
168 - $securitygroupname = $wgRequest->getText( 'groupname' );
169 - if ( ! $wgRequest->wasPosted() ) {
 167+ $securitygroupname = $this->getRequest()->getText( 'groupname' );
 168+ if ( ! $this->getRequest()->wasPosted() ) {
170169 $this->getOutput()->addWikiMsg( 'openstackmanager-deletesecuritygroup-confirm', $securitygroupname );
171170 }
172171 $securityGroupInfo = array();
@@ -325,12 +324,12 @@
326325 * @return bool
327326 */
328327 function addRule() {
329 - global $wgRequest;
330328
 329+
331330 $this->setHeaders();
332331 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addrule' ) );
333332
334 - $project = $wgRequest->getText( 'project' );
 333+ $project = $this->getRequest()->getText( 'project' );
335334 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
336335 $this->notInRole( 'netadmin' );
337336 return false;
@@ -344,7 +343,7 @@
345344 $info["$securityGroupProject"]["$securityGroupName"] = $securityGroupName . ':' . $securityGroupProject;
346345 }
347346 $group_keys = $info;
348 - $securitygroupname = $wgRequest->getText( 'groupname' );
 347+ $securitygroupname = $this->getRequest()->getText( 'groupname' );
349348 $securityGroupInfo = array();
350349 $securityGroupInfo['groupname'] = array(
351350 'type' => 'hidden',
@@ -417,18 +416,18 @@
418417 * @return bool
419418 */
420419 function removeRule() {
421 - global $wgRequest;
422420
 421+
423422 $this->setHeaders();
424423 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removerule' ) );
425424
426 - $project = $wgRequest->getText( 'project' );
 425+ $project = $this->getRequest()->getText( 'project' );
427426 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
428427 $this->notInRole( 'netadmin' );
429428 return false;
430429 }
431 - $securitygroupname = $wgRequest->getText( 'groupname' );
432 - if ( ! $wgRequest->wasPosted() ) {
 430+ $securitygroupname = $this->getRequest()->getText( 'groupname' );
 431+ if ( ! $this->getRequest()->wasPosted() ) {
433432 $this->getOutput()->addWikiMsg( 'openstackmanager-removerule-confirm', $securitygroupname );
434433 }
435434 $securityGroupInfo = array();
@@ -444,30 +443,30 @@
445444 );
446445 $securityGroupInfo['fromport'] = array(
447446 'type' => 'hidden',
448 - 'default' => $wgRequest->getText( 'fromport' ),
 447+ 'default' => $this->getRequest()->getText( 'fromport' ),
449448 'name' => 'fromport',
450449 );
451450 $securityGroupInfo['toport'] = array(
452451 'type' => 'hidden',
453 - 'default' => $wgRequest->getText( 'toport' ),
 452+ 'default' => $this->getRequest()->getText( 'toport' ),
454453 'name' => 'toport',
455454 );
456455 $securityGroupInfo['protocol'] = array(
457456 'type' => 'hidden',
458 - 'default' => $wgRequest->getText( 'protocol' ),
 457+ 'default' => $this->getRequest()->getText( 'protocol' ),
459458 'name' => 'protocol',
460459 );
461 - if ( $wgRequest->getText( 'ranges' ) ) {
 460+ if ( $this->getRequest()->getText( 'ranges' ) ) {
462461 $securityGroupInfo['ranges'] = array(
463462 'type' => 'hidden',
464 - 'default' => $wgRequest->getText( 'ranges' ),
 463+ 'default' => $this->getRequest()->getText( 'ranges' ),
465464 'name' => 'ranges',
466465 );
467466 }
468 - if ( $wgRequest->getText( 'groups' ) ) {
 467+ if ( $this->getRequest()->getText( 'groups' ) ) {
469468 $securityGroupInfo['groups'] = array(
470469 'type' => 'hidden',
471 - 'default' => $wgRequest->getText( 'groups' ),
 470+ 'default' => $this->getRequest()->getText( 'groups' ),
472471 'name' => 'groups',
473472 );
474473 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php
@@ -14,7 +14,6 @@
1515 }
1616
1717 function execute( $par ) {
18 - global $wgRequest;
1918 global $wgOpenStackManagerNovaAdminKeys;
2019
2120 if ( !$this->getUser()->isLoggedIn() ) {
@@ -29,7 +28,7 @@
3029 $adminCredentials = $wgOpenStackManagerNovaAdminKeys;
3130 $this->adminNova = new OpenStackNovaController( $adminCredentials );
3231
33 - $action = $wgRequest->getVal( 'action' );
 32+ $action = $this->getRequest()->getVal( 'action' );
3433 if ( $action == "allocate" ) {
3534 $this->allocateAddress();
3635 } elseif ( $action == "release" ) {
@@ -51,19 +50,17 @@
5251 * @return bool
5352 */
5453 function allocateAddress() {
55 - global $wgRequest;
56 -
5754 $this->setHeaders();
5855 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-allocateaddress' ) );
5956
60 - $project = $wgRequest->getText( 'project' );
 57+ $project = $this->getRequest()->getText( 'project' );
6158 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
6259 $this->notInRole( 'netadmin' );
6360 return false;
6461 }
65 - $userCredentials = $this->userLDAP->getCredentials();
66 - $this->userNova = new OpenStackNovaController( $userCredentials, $project );
67 - if ( ! $wgRequest->wasPosted() ) {
 62+ $userCredentials = $this->userLDAP->getCredentials();
 63+ $this->userNova = new OpenStackNovaController( $userCredentials, $project );
 64+ if ( !$this->getRequest()->wasPosted() ) {
6865 $this->getOutput()->addWikiMsg( 'openstackmanager-allocateaddress-confirm', $project );
6966 }
7067 $addressInfo = array();
@@ -91,20 +88,18 @@
9289 * @return bool
9390 */
9491 function releaseAddress() {
95 - global $wgRequest;
96 -
9792 $this->setHeaders();
9893 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-releaseaddress' ) );
9994
100 - $project = $wgRequest->getText( 'project' );
 95+ $project = $this->getRequest()->getText( 'project' );
10196 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
10297 $this->notInRole( 'netadmin' );
10398 return false;
10499 }
105 - $userCredentials = $this->userLDAP->getCredentials();
106 - $this->userNova = new OpenStackNovaController( $userCredentials, $project );
107 - $ip = $wgRequest->getText( 'ip' );
108 - if ( ! $wgRequest->wasPosted() ) {
 100+ $userCredentials = $this->userLDAP->getCredentials();
 101+ $this->userNova = new OpenStackNovaController( $userCredentials, $project );
 102+ $ip = $this->getRequest()->getText( 'ip' );
 103+ if ( ! $this->getRequest()->wasPosted() ) {
109104 $this->getOutput()->addWikiMsg( 'openstackmanager-releaseaddress-confirm', $ip );
110105 }
111106 $addressInfo = array();
@@ -137,19 +132,18 @@
138133 * @return bool
139134 */
140135 function associateAddress() {
141 - global $wgRequest;
142136
143137 $this->setHeaders();
144138 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-associateaddress' ) );
145139
146 - $ip = $wgRequest->getText( 'ip' );
147 - $project = $wgRequest->getText( 'project' );
 140+ $ip = $this->getRequest()->getText( 'ip' );
 141+ $project = $this->getRequest()->getText( 'project' );
148142 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
149143 $this->notInRole( 'netadmin' );
150144 return false;
151145 }
152 - $userCredentials = $this->userLDAP->getCredentials();
153 - $this->userNova = new OpenStackNovaController( $userCredentials, $project );
 146+ $userCredentials = $this->userLDAP->getCredentials();
 147+ $this->userNova = new OpenStackNovaController( $userCredentials, $project );
154148 $instances = $this->userNova->getInstances();
155149 $instance_keys = array();
156150 foreach ( $instances as $instance ) {
@@ -194,20 +188,18 @@
195189 * @return bool
196190 */
197191 function disassociateAddress() {
198 - global $wgRequest;
199 -
200192 $this->setHeaders();
201193 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-disassociateaddress' ) );
202194
203 - $project = $wgRequest->getText( 'project' );
 195+ $project = $this->getRequest()->getText( 'project' );
204196 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
205197 $this->notInRole( 'netadmin' );
206198 return false;
207199 }
208 - $userCredentials = $this->userLDAP->getCredentials();
209 - $this->userNova = new OpenStackNovaController( $userCredentials, $project );
210 - $ip = $wgRequest->getText( 'ip' );
211 - if ( ! $wgRequest->wasPosted() ) {
 200+ $userCredentials = $this->userLDAP->getCredentials();
 201+ $this->userNova = new OpenStackNovaController( $userCredentials, $project );
 202+ $ip = $this->getRequest()->getText( 'ip' );
 203+ if ( ! $this->getRequest()->wasPosted() ) {
212204 $this->getOutput()->addWikiMsg( 'openstackmanager-disassociateaddress-confirm', $ip );
213205 }
214206 $addressInfo = array();
@@ -240,17 +232,15 @@
241233 * @return bool
242234 */
243235 function addHost() {
244 - global $wgRequest;
245 -
246236 $this->setHeaders();
247237 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addhost' ) );
248238
249 - $project = $wgRequest->getText( 'project' );
 239+ $project = $this->getRequest()->getText( 'project' );
250240 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
251241 $this->notInRole( 'netadmin' );
252242 return false;
253243 }
254 - $ip = $wgRequest->getText( 'ip' );
 244+ $ip = $this->getRequest()->getText( 'ip' );
255245 $addressInfo = array();
256246 $addressInfo['project'] = array(
257247 'type' => 'hidden',
@@ -299,22 +289,21 @@
300290 * @return bool
301291 */
302292 function removeHost() {
303 - global $wgRequest;
304293
305294 $this->setHeaders();
306295 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removehost' ) );
307296
308 - $project = $wgRequest->getText( 'project' );
 297+ $project = $this->getRequest()->getText( 'project' );
309298 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
310299 $this->notInRole( 'netadmin' );
311300 return false;
312301 }
313 - $userCredentials = $this->userLDAP->getCredentials();
314 - $this->userNova = new OpenStackNovaController( $userCredentials, $project );
315 - $ip = $wgRequest->getText( 'ip' );
316 - $domain = $wgRequest->getText( 'domain' );
317 - $hostname = $wgRequest->getText( 'hostname' );
318 - if ( ! $wgRequest->wasPosted() ) {
 302+ $userCredentials = $this->userLDAP->getCredentials();
 303+ $this->userNova = new OpenStackNovaController( $userCredentials, $project );
 304+ $ip = $this->getRequest()->getText( 'ip' );
 305+ $domain = $this->getRequest()->getText( 'domain' );
 306+ $hostname = $this->getRequest()->getText( 'hostname' );
 307+ if ( ! $this->getRequest()->wasPosted() ) {
319308 $this->getOutput()->addWikiMsg( 'openstackmanager-removehost-confirm', $hostname, $ip );
320309 }
321310 $addressInfo = array();
Index: trunk/extensions/OpenStackManager/special/SpecialNovaProject.php
@@ -15,14 +15,14 @@
1616 }
1717
1818 function execute( $par ) {
19 - global $wgRequest;
2019
 20+
2121 if ( !$this->getUser()->isLoggedIn() ) {
2222 $this->notLoggedIn();
2323 return;
2424 }
2525 $this->userLDAP = new OpenStackNovaUser();
26 - $action = $wgRequest->getVal( 'action' );
 26+ $action = $this->getRequest()->getVal( 'action' );
2727 if ( $action == "create" ) {
2828 $this->createProject();
2929 } elseif ( $action == "delete" ) {
@@ -94,12 +94,12 @@
9595 * @return bool
9696 */
9797 function addMember() {
98 - global $wgRequest;
9998
 99+
100100 $this->setHeaders();
101101 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addmember' ) );
102102
103 - $project = $wgRequest->getText( 'projectname' );
 103+ $project = $this->getRequest()->getText( 'projectname' );
104104 if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inProject( $project ) ) {
105105 $this->notInProject();
106106 return false;
@@ -136,12 +136,12 @@
137137 * @return bool
138138 */
139139 function deleteMember() {
140 - global $wgRequest;
141140
 141+
142142 $this->setHeaders();
143143 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removemember' ) );
144144
145 - $projectname = $wgRequest->getText( 'projectname' );
 145+ $projectname = $this->getRequest()->getText( 'projectname' );
146146 if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inProject( $projectname ) ) {
147147 $this->notInProject();
148148 return false;
@@ -184,8 +184,6 @@
185185 * @return bool
186186 */
187187 function deleteProject() {
188 - global $wgRequest;
189 -
190188 $this->setHeaders();
191189 if ( !$this->userCanExecute( $this->getUser() ) ) {
192190 $this->displayRestrictionError();
@@ -193,8 +191,8 @@
194192 }
195193 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deleteproject' ) );
196194
197 - $project = $wgRequest->getText( 'projectname' );
198 - if ( ! $wgRequest->wasPosted() ) {
 195+ $project = $this->getRequest()->getText( 'projectname' );
 196+ if ( ! $this->getRequest()->wasPosted() ) {
199197 $this->getOutput()->addWikiMsg( 'openstackmanager-removeprojectconfirm', $project );
200198 }
201199 $projectInfo = array();
Index: trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php
@@ -14,7 +14,6 @@
1515 }
1616
1717 function execute( $par ) {
18 - global $wgRequest;
1918 global $wgOpenStackManagerLDAPRolesIntersect;
2019
2120 if ( !$this->getUser()->isLoggedIn() ) {
@@ -39,7 +38,7 @@
4039 return;
4140 }
4241
43 - $action = $wgRequest->getVal( 'action' );
 42+ $action = $this->getRequest()->getVal( 'action' );
4443 if ( $action == "create" ) {
4544 $this->createDomain();
4645 } elseif ( $action == "delete" ) {
@@ -98,13 +97,11 @@
9998 * @return bool
10099 */
101100 function deleteDomain() {
102 - global $wgRequest;
103 -
104101 $this->setHeaders();
105102 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletedomain' ) );
106103
107 - $domainname = $wgRequest->getText( 'domainname' );
108 - if ( ! $wgRequest->wasPosted() ) {
 104+ $domainname = $this->getRequest()->getText( 'domainname' );
 105+ if ( ! $this->getRequest()->wasPosted() ) {
109106 $this->getOutput()->addWikiMsg( 'openstackmanager-deletedomain-confirm', $domainname );
110107 }
111108 $domainInfo = array();
Index: trunk/extensions/OpenStackManager/special/SpecialNovaVolume.php
@@ -16,7 +16,6 @@
1717 }
1818
1919 function execute( $par ) {
20 - global $wgRequest;
2120 global $wgOpenStackManagerNovaAdminKeys;
2221
2322 if ( !$this->getUser()->isLoggedIn() ) {
@@ -28,13 +27,13 @@
2928 $this->noCredentials();
3029 return;
3130 }
32 - $project = $wgRequest->getVal( 'project' );
 31+ $project = $this->getRequest()->getVal( 'project' );
3332 $userCredentials = $this->userLDAP->getCredentials();
3433 $this->userNova = new OpenStackNovaController( $userCredentials, $project );
3534 $adminCredentials = $wgOpenStackManagerNovaAdminKeys;
3635 $this->adminNova = new OpenStackNovaController( $adminCredentials );
3736
38 - $action = $wgRequest->getVal( 'action' );
 37+ $action = $this->getRequest()->getVal( 'action' );
3938
4039 if ( $action == "create" ) {
4140 if ( ! $this->userLDAP->inProject( $project ) ) {
@@ -69,12 +68,10 @@
7069 * @return bool
7170 */
7271 function createVolume() {
73 - global $wgRequest;
74 -
7572 $this->setHeaders();
7673 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createvolume' ) );
7774
78 - $project = $wgRequest->getText( 'project' );
 75+ $project = $this->getRequest()->getText( 'project' );
7976 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
8077 $this->notInRole( 'sysadmin' );
8178 return false;
@@ -143,18 +140,18 @@
144141 * @return bool
145142 */
146143 function deleteVolume() {
147 - global $wgRequest;
148144
 145+
149146 $this->setHeaders();
150147 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletevolume' ) );
151148
152 - $project = $wgRequest->getText( 'project' );
 149+ $project = $this->getRequest()->getText( 'project' );
153150 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
154151 $this->notInRole( 'sysadmin' );
155152 return false;
156153 }
157 - $volumeid = $wgRequest->getText( 'volumeid' );
158 - if ( ! $wgRequest->wasPosted() ) {
 154+ $volumeid = $this->getRequest()->getText( 'volumeid' );
 155+ if ( ! $this->getRequest()->wasPosted() ) {
159156 $this->getOutput()->addWikiMsg( 'openstackmanager-deletevolumequestion', $volumeid );
160157 }
161158 $volumeInfo = array();
@@ -186,12 +183,12 @@
187184 * @return bool
188185 */
189186 function attachVolume() {
190 - global $wgRequest;
191187
 188+
192189 $this->setHeaders();
193190 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-attachvolume' ) );
194191
195 - $project = $wgRequest->getText( 'project' );
 192+ $project = $this->getRequest()->getText( 'project' );
196193 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
197194 $this->notInRole( 'sysadmin' );
198195 return false;
@@ -209,13 +206,13 @@
210207 $volumeInfo['volumeinfo'] = array(
211208 'type' => 'info',
212209 'label-message' => 'openstackmanager-volumename',
213 - 'default' => $wgRequest->getText( 'volumeid' ),
 210+ 'default' => $this->getRequest()->getText( 'volumeid' ),
214211 'section' => 'volume/info',
215212 'name' => 'volumeinfo',
216213 );
217214 $volumeInfo['volumeid'] = array(
218215 'type' => 'hidden',
219 - 'default' => $wgRequest->getText( 'volumeid' ),
 216+ 'default' => $this->getRequest()->getText( 'volumeid' ),
220217 'name' => 'volumeid',
221218 );
222219 $volumeInfo['volumedescription'] = array(
@@ -261,12 +258,12 @@
262259 * @return bool
263260 */
264261 function detachVolume() {
265 - global $wgRequest;
266262
 263+
267264 $this->setHeaders();
268265 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-detachvolume' ) );
269266
270 - $project = $wgRequest->getText( 'project' );
 267+ $project = $this->getRequest()->getText( 'project' );
271268 if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) {
272269 $this->notInRole( 'sysadmin' );
273270 return false;
@@ -275,7 +272,7 @@
276273 $volumeInfo['volumeinfo'] = array(
277274 'type' => 'info',
278275 'label-message' => 'openstackmanager-volumename',
279 - 'default' => $wgRequest->getText( 'volumeid' ),
 276+ 'default' => $this->getRequest()->getText( 'volumeid' ),
280277 'section' => 'volume/info',
281278 'name' => 'volumeinfo',
282279 );
@@ -288,7 +285,7 @@
289286 );
290287 $volumeInfo['volumeid'] = array(
291288 'type' => 'hidden',
292 - 'default' => $wgRequest->getText( 'volumeid' ),
 289+ 'default' => $this->getRequest()->getText( 'volumeid' ),
293290 'name' => 'volumeid',
294291 );
295292 $volumeInfo['project'] = array(
Index: trunk/extensions/OpenStackManager/special/SpecialNovaKey.php
@@ -13,8 +13,6 @@
1414 }
1515
1616 function execute( $par ) {
17 - global $wgRequest;
18 -
1917 if ( !$this->getUser()->isLoggedIn() ) {
2018 $this->notLoggedIn();
2119 return;
@@ -25,7 +23,7 @@
2624 return;
2725 }
2826
29 - $action = $wgRequest->getVal( 'action' );
 27+ $action = $this->getRequest()->getVal( 'action' );
3028 if ( $action == "import" ) {
3129 $this->importKey();
3230 } elseif ( $action == "delete" ) {
@@ -39,12 +37,12 @@
4038 * @return bool
4139 */
4240 function importKey() {
43 - global $wgRequest;
 41+
4442 global $wgOpenStackManagerNovaKeypairStorage;
4543
4644 $project = '';
4745 if ( $wgOpenStackManagerNovaKeypairStorage == 'nova' ) {
48 - $project = $wgRequest->getVal( 'project' );
 46+ $project = $this->getRequest()->getVal( 'project' );
4947 if ( $project && ! $this->userLDAP->inProject( $project ) ) {
5048 $this->notInProject();
5149 return;
@@ -100,7 +98,7 @@
10199 * @return bool
102100 */
103101 function deleteKey() {
104 - global $wgRequest;
 102+
105103 global $wgOpenStackManagerNovaKeypairStorage;
106104
107105 $this->setHeaders();
@@ -111,8 +109,8 @@
112110 $keypairs = array();
113111
114112 if ( $wgOpenStackManagerNovaKeypairStorage == 'nova' ) {
115 - $keyname = $wgRequest->getVal( 'keyname' );
116 - $project = $wgRequest->getVal( 'project' );
 113+ $keyname = $this->getRequest()->getVal( 'keyname' );
 114+ $project = $this->getRequest()->getVal( 'project' );
117115 if ( $project && ! $this->userLDAP->inProject( $project ) ) {
118116 $this->notInProject();
119117 return true;
@@ -128,9 +126,9 @@
129127 'name' => 'project',
130128 );
131129 } elseif ( $wgOpenStackManagerNovaKeypairStorage == 'ldap' ) {
132 - $hash = $wgRequest->getVal( 'hash' );
 130+ $hash = $this->getRequest()->getVal( 'hash' );
133131 $keypairs = $this->userLDAP->getKeypairs();
134 - if ( ! $wgRequest->wasPosted() ) {
 132+ if ( ! $this->getRequest()->wasPosted() ) {
135133 $this->getOutput()->addHTML( Html::element( 'pre', array(), $keypairs[$hash] ) );
136134 $this->getOutput()->addWikiMsg( 'openstackmanager-deletekeyconfirm' );
137135 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaPuppetGroup.php
@@ -6,13 +6,13 @@
77 }
88
99 function execute( $par ) {
10 - global $wgRequest;
1110
 11+
1212 if ( ! $this->getUser()->isLoggedIn() ) {
1313 $this->notLoggedIn();
1414 return;
1515 }
16 - $action = $wgRequest->getVal( 'action' );
 16+ $action = $this->getRequest()->getVal( 'action' );
1717 if ( $action == "create" ) {
1818 $this->createPuppetGroup();
1919 } elseif ( $action == "delete" ) {
@@ -81,8 +81,8 @@
8282 * @return bool
8383 */
8484 function addPuppetClass() {
85 - global $wgRequest;
8685
 86+
8787 $this->setHeaders();
8888 if ( !$this->userCanExecute( $this->getUser() ) ) {
8989 $this->displayRestrictionError();
@@ -90,7 +90,7 @@
9191 }
9292 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addpuppetclass' ) );
9393
94 - $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
 94+ $puppetGroupId = $this->getRequest()->getInt( 'puppetgroupid' );
9595 $puppetGroupInfo = array();
9696 $puppetGroupInfo['puppetclassname'] = array(
9797 'type' => 'text',
@@ -127,18 +127,18 @@
128128 * @return bool
129129 */
130130 function deletePuppetClass() {
131 - global $wgRequest;
132131
 132+
133133 $this->setHeaders();
134134 if ( !$this->userCanExecute( $this->getUser() ) ) {
135135 $this->displayRestrictionError();
136136 return false;
137137 }
138138 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removepuppetclass' ) );
139 - if ( ! $wgRequest->wasPosted() ) {
 139+ if ( ! $this->getRequest()->wasPosted() ) {
140140 $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetclassconfirm' );
141141 }
142 - $puppetClassId = $wgRequest->getInt( 'puppetclassid' );
 142+ $puppetClassId = $this->getRequest()->getInt( 'puppetclassid' );
143143 $puppetGroupInfo = array();
144144 $puppetGroupInfo['puppetclassid'] = array(
145145 'type' => 'hidden',
@@ -164,8 +164,8 @@
165165 * @return bool
166166 */
167167 function addPuppetVar() {
168 - global $wgRequest;
169168
 169+
170170 $this->setHeaders();
171171 if ( !$this->userCanExecute( $this->getUser() ) ) {
172172 $this->displayRestrictionError();
@@ -173,7 +173,7 @@
174174 }
175175 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addpuppetvar' ) );
176176
177 - $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
 177+ $puppetGroupId = $this->getRequest()->getInt( 'puppetgroupid' );
178178 $puppetGroupInfo = array();
179179 $puppetGroupInfo['puppetvarname'] = array(
180180 'type' => 'text',
@@ -210,8 +210,8 @@
211211 * @return bool
212212 */
213213 function deletePuppetVar() {
214 - global $wgRequest;
215214
 215+
216216 $this->setHeaders();
217217 if ( !$this->userCanExecute( $this->getUser() ) ) {
218218 $this->displayRestrictionError();
@@ -219,8 +219,8 @@
220220 }
221221 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removepuppetvar' ) );
222222
223 - $puppetVarId = $wgRequest->getText( 'puppetvarid' );
224 - if ( ! $wgRequest->wasPosted() ) {
 223+ $puppetVarId = $this->getRequest()->getText( 'puppetvarid' );
 224+ if ( ! $this->getRequest()->wasPosted() ) {
225225 $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetvarconfirm' );
226226 }
227227 $puppetGroupInfo = array();
@@ -248,8 +248,8 @@
249249 * @return bool
250250 */
251251 function deletePuppetGroup() {
252 - global $wgRequest;
253252
 253+
254254 $this->setHeaders();
255255 if ( !$this->userCanExecute( $this->getUser() ) ) {
256256 $this->displayRestrictionError();
@@ -257,8 +257,8 @@
258258 }
259259 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletepuppetgroup' ) );
260260
261 - $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
262 - if ( ! $wgRequest->wasPosted() ) {
 261+ $puppetGroupId = $this->getRequest()->getInt( 'puppetgroupid' );
 262+ if ( ! $this->getRequest()->wasPosted() ) {
263263 $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetgroupconfirm' );
264264 }
265265 $puppetGroupInfo = array();
@@ -285,8 +285,8 @@
286286 * @return bool
287287 */
288288 function modifyPuppetClass() {
289 - global $wgRequest;
290289
 290+
291291 $this->setHeaders();
292292 if ( !$this->userCanExecute( $this->getUser() ) ) {
293293 $this->displayRestrictionError();
@@ -294,9 +294,9 @@
295295 }
296296 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetclass' ) );
297297
298 - $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
299 - $puppetClassId = $wgRequest->getInt( 'puppetclassid' );
300 - $puppetClassPosition = $wgRequest->getInt( 'puppetclassposition' );
 298+ $puppetGroupId = $this->getRequest()->getInt( 'puppetgroupid' );
 299+ $puppetClassId = $this->getRequest()->getInt( 'puppetclassid' );
 300+ $puppetClassPosition = $this->getRequest()->getInt( 'puppetclassposition' );
301301 $puppetGroupInfo = array();
302302 $puppetGroupInfo['puppetclassid'] = array(
303303 'type' => 'hidden',
@@ -341,8 +341,8 @@
342342 * @return bool
343343 */
344344 function modifyPuppetVar() {
345 - global $wgRequest;
346345
 346+
347347 $this->setHeaders();
348348 if ( !$this->userCanExecute( $this->getUser() ) ) {
349349 $this->displayRestrictionError();
@@ -350,9 +350,9 @@
351351 }
352352 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetvar' ) );
353353
354 - $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
355 - $puppetVarId = $wgRequest->getInt( 'puppetvarid' );
356 - $puppetVarPosition = $wgRequest->getInt( 'puppetvarposition' );
 354+ $puppetGroupId = $this->getRequest()->getInt( 'puppetgroupid' );
 355+ $puppetVarId = $this->getRequest()->getInt( 'puppetvarid' );
 356+ $puppetVarPosition = $this->getRequest()->getInt( 'puppetvarposition' );
357357 $puppetGroupInfo = array();
358358 $puppetGroupInfo['puppetvarid'] = array(
359359 'type' => 'hidden',
@@ -397,8 +397,6 @@
398398 * @return bool
399399 */
400400 function modifyPuppetGroup() {
401 - global $wgRequest;
402 -
403401 $this->setHeaders();
404402 if ( !$this->userCanExecute( $this->getUser() ) ) {
405403 $this->displayRestrictionError();
@@ -406,8 +404,8 @@
407405 }
408406 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetgroup' ) );
409407
410 - $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' );
411 - $puppetGroupPosition = $wgRequest->getInt( 'puppetgroupposition' );
 408+ $puppetGroupId = $this->getRequest()->getInt( 'puppetgroupid' );
 409+ $puppetGroupPosition = $this->getRequest()->getInt( 'puppetgroupposition' );
412410 $puppetGroupInfo = array();
413411 $puppetGroupInfo['puppetgroupid'] = array(
414412 'type' => 'hidden',
Index: trunk/extensions/OpenStackManager/special/SpecialNovaRole.php
@@ -15,14 +15,14 @@
1616 }
1717
1818 function execute( $par ) {
19 - global $wgRequest;
2019
 20+
2121 if ( !$this->getUser()->isLoggedIn() ) {
2222 $this->notLoggedIn();
2323 return;
2424 }
2525 $this->userLDAP = new OpenStackNovaUser();
26 - $action = $wgRequest->getVal( 'action' );
 26+ $action = $this->getRequest()->getVal( 'action' );
2727 if ( $action == "addmember" ) {
2828 $this->addMember();
2929 } elseif ( $action == "deletemember" ) {
@@ -36,14 +36,14 @@
3737 * @return bool
3838 */
3939 function addMember() {
40 - global $wgRequest;
4140
 41+
4242 $this->setHeaders();
4343 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addmember' ) );
4444
4545 $roleInfo = array();
46 - $rolename = $wgRequest->getText( 'rolename' );
47 - $projectname = $wgRequest->getText( 'projectname' );
 46+ $rolename = $this->getRequest()->getText( 'rolename' );
 47+ $projectname = $this->getRequest()->getText( 'projectname' );
4848 if ( $projectname ) {
4949 if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inRole( $rolename, $projectname, true ) ) {
5050 $this->displayRestrictionError();
@@ -100,7 +100,7 @@
101101 );
102102 $roleInfo['returnto'] = array(
103103 'type' => 'hidden',
104 - 'default' => $wgRequest->getText('returnto'),
 104+ 'default' => $this->getRequest()->getText('returnto'),
105105 'name' => 'returnto',
106106 );
107107
@@ -117,13 +117,11 @@
118118 * @return bool
119119 */
120120 function deleteMember() {
121 - global $wgRequest;
122 -
123121 $this->setHeaders();
124122 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removerolemember' ) );
125123
126 - $rolename = $wgRequest->getText( 'rolename' );
127 - $projectname = $wgRequest->getText( 'projectname' );
 124+ $rolename = $this->getRequest()->getText( 'rolename' );
 125+ $projectname = $this->getRequest()->getText( 'projectname' );
128126 if ( $projectname ) {
129127 if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inRole( $rolename, $projectname, true ) ) {
130128 $this->displayRestrictionError();
@@ -180,7 +178,7 @@
181179 );
182180 $roleInfo['returnto'] = array(
183181 'type' => 'hidden',
184 - 'default' => $wgRequest->getText('returnto'),
 182+ 'default' => $this->getRequest()->getText('returnto'),
185183 'name' => 'returnto',
186184 );
187185
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSudoer.php
@@ -10,8 +10,6 @@
1111 }
1212
1313 function execute( $par ) {
14 - global $wgRequest;
15 -
1614 if ( !$this->getUser()->isLoggedIn() ) {
1715 $this->notLoggedIn();
1816 return;
@@ -21,7 +19,7 @@
2220 return;
2321 }
2422
25 - $action = $wgRequest->getVal( 'action' );
 23+ $action = $this->getRequest()->getVal( 'action' );
2624 if ( $action == "create" ) {
2725 $this->createSudoer();
2826 } elseif ( $action == "delete" ) {
@@ -99,13 +97,13 @@
10098 * @return bool
10199 */
102100 function deleteSudoer() {
103 - global $wgRequest;
104101
 102+
105103 $this->setHeaders();
106104 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletesudoer' ) );
107105
108 - $sudoername = $wgRequest->getText( 'sudoername' );
109 - if ( ! $wgRequest->wasPosted() ) {
 106+ $sudoername = $this->getRequest()->getText( 'sudoername' );
 107+ if ( ! $this->getRequest()->wasPosted() ) {
110108 $this->getOutput()->addWikiMsg( 'openstackmanager-deletesudoer-confirm', $sudoername );
111109 }
112110 $sudoerInfo = array();
@@ -132,12 +130,12 @@
133131 * @return bool
134132 */
135133 function modifySudoer() {
136 - global $wgRequest;
137134
 135+
138136 $this->setHeaders();
139137 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifysudoer' ) );
140138
141 - $sudoername = $wgRequest->getText( 'sudoername' );
 139+ $sudoername = $this->getRequest()->getText( 'sudoername' );
142140 $sudoer = OpenStackNovaSudoer::getSudoerByName( $sudoername );
143141 $users = implode( ',', $sudoer->getSudoerUsers() );
144142 $hosts = implode( ',', $sudoer->getSudoerHosts() );

Status & tagging log