Index: trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php |
— | — | @@ -16,7 +16,6 @@ |
17 | 17 | } |
18 | 18 | |
19 | 19 | function execute( $par ) { |
20 | | - global $wgRequest; |
21 | 20 | global $wgOpenStackManagerNovaAdminKeys; |
22 | 21 | |
23 | 22 | if ( !$this->getUser()->isLoggedIn() ) { |
— | — | @@ -28,13 +27,13 @@ |
29 | 28 | $this->noCredentials(); |
30 | 29 | return; |
31 | 30 | } |
32 | | - $project = $wgRequest->getVal( 'project' ); |
| 31 | + $project = $this->getRequest()->getVal( 'project' ); |
33 | 32 | $userCredentials = $this->userLDAP->getCredentials(); |
34 | 33 | $this->userNova = new OpenStackNovaController( $userCredentials, $project ); |
35 | 34 | $adminCredentials = $wgOpenStackManagerNovaAdminKeys; |
36 | 35 | $this->adminNova = new OpenStackNovaController( $adminCredentials ); |
37 | 36 | |
38 | | - $action = $wgRequest->getVal( 'action' ); |
| 37 | + $action = $this->getRequest()->getVal( 'action' ); |
39 | 38 | |
40 | 39 | if ( $action == "create" ) { |
41 | 40 | if ( ! $this->userLDAP->inProject( $project ) ) { |
— | — | @@ -75,14 +74,14 @@ |
76 | 75 | * @return bool |
77 | 76 | */ |
78 | 77 | function createInstance() { |
79 | | - global $wgRequest; |
| 78 | + |
80 | 79 | global $wgOpenStackManagerPuppetOptions; |
81 | 80 | global $wgOpenStackManagerInstanceDefaultImage; |
82 | 81 | |
83 | 82 | $this->setHeaders(); |
84 | 83 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createinstance' ) ); |
85 | 84 | |
86 | | - $project = $wgRequest->getText( 'project' ); |
| 85 | + $project = $this->getRequest()->getText( 'project' ); |
87 | 86 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
88 | 87 | $this->notInRole( 'sysadmin' ); |
89 | 88 | return false; |
— | — | @@ -246,18 +245,18 @@ |
247 | 246 | * @return bool |
248 | 247 | */ |
249 | 248 | function configureInstance() { |
250 | | - global $wgRequest; |
| 249 | + |
251 | 250 | global $wgOpenStackManagerPuppetOptions; |
252 | 251 | |
253 | 252 | $this->setHeaders(); |
254 | 253 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-configureinstance' ) ); |
255 | 254 | |
256 | | - $project = $wgRequest->getText( 'project' ); |
| 255 | + $project = $this->getRequest()->getText( 'project' ); |
257 | 256 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
258 | 257 | $this->notInRole( 'sysadmin' ); |
259 | 258 | return false; |
260 | 259 | } |
261 | | - $instanceid = $wgRequest->getText( 'instanceid' ); |
| 260 | + $instanceid = $this->getRequest()->getText( 'instanceid' ); |
262 | 261 | $instanceInfo = array(); |
263 | 262 | $instanceInfo['instanceid'] = array( |
264 | 263 | 'type' => 'hidden', |
— | — | @@ -349,18 +348,18 @@ |
350 | 349 | * @return bool |
351 | 350 | */ |
352 | 351 | function deleteInstance() { |
353 | | - global $wgRequest; |
354 | 352 | |
| 353 | + |
355 | 354 | $this->setHeaders(); |
356 | 355 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deleteinstance' ) ); |
357 | 356 | |
358 | | - $project = $wgRequest->getText( 'project' ); |
| 357 | + $project = $this->getRequest()->getText( 'project' ); |
359 | 358 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
360 | 359 | $this->notInRole( 'sysadmin' ); |
361 | 360 | return false; |
362 | 361 | } |
363 | | - $instanceid = $wgRequest->getText( 'instanceid' ); |
364 | | - if ( ! $wgRequest->wasPosted() ) { |
| 362 | + $instanceid = $this->getRequest()->getText( 'instanceid' ); |
| 363 | + if ( ! $this->getRequest()->wasPosted() ) { |
365 | 364 | $this->getOutput()->addWikiMsg( 'openstackmanager-deleteinstancequestion', $instanceid ); |
366 | 365 | } |
367 | 366 | $instanceInfo = array(); |
— | — | @@ -392,18 +391,18 @@ |
393 | 392 | * @return bool |
394 | 393 | */ |
395 | 394 | function rebootInstance() { |
396 | | - global $wgRequest; |
397 | 395 | |
| 396 | + |
398 | 397 | $this->setHeaders(); |
399 | 398 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-rebootinstance' ) ); |
400 | 399 | |
401 | | - $project = $wgRequest->getText( 'project' ); |
| 400 | + $project = $this->getRequest()->getText( 'project' ); |
402 | 401 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
403 | 402 | $this->notInRole( 'sysadmin' ); |
404 | 403 | return false; |
405 | 404 | } |
406 | | - $instanceid = $wgRequest->getText( 'instanceid' ); |
407 | | - if ( ! $wgRequest->wasPosted() ) { |
| 405 | + $instanceid = $this->getRequest()->getText( 'instanceid' ); |
| 406 | + if ( ! $this->getRequest()->wasPosted() ) { |
408 | 407 | $this->getOutput()->addWikiMsg( 'openstackmanager-rebootinstancequestion', $instanceid ); |
409 | 408 | } |
410 | 409 | $instanceInfo = array(); |
— | — | @@ -434,17 +433,17 @@ |
435 | 434 | * @return bool |
436 | 435 | */ |
437 | 436 | function getConsoleOutput() { |
438 | | - global $wgRequest; |
439 | 437 | |
| 438 | + |
440 | 439 | $this->setHeaders(); |
441 | 440 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-consoleoutput' ) ); |
442 | 441 | |
443 | | - $project = $wgRequest->getText( 'project' ); |
| 442 | + $project = $this->getRequest()->getText( 'project' ); |
444 | 443 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
445 | 444 | $this->notInRole( 'sysadmin' ); |
446 | 445 | return; |
447 | 446 | } |
448 | | - $instanceid = $wgRequest->getText( 'instanceid' ); |
| 447 | + $instanceid = $this->getRequest()->getText( 'instanceid' ); |
449 | 448 | $consoleOutput = $this->userNova->getConsoleOutput( $instanceid ); |
450 | 449 | $out = Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backinstancelist' ) ); |
451 | 450 | $out .= Html::element( 'pre', array(), $consoleOutput ); |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php |
— | — | @@ -16,7 +16,6 @@ |
17 | 17 | } |
18 | 18 | |
19 | 19 | function execute( $par ) { |
20 | | - global $wgRequest; |
21 | 20 | global $wgOpenStackManagerNovaAdminKeys; |
22 | 21 | |
23 | 22 | if ( !$this->getUser()->isLoggedIn() ) { |
— | — | @@ -31,7 +30,7 @@ |
32 | 31 | $adminCredentials = $wgOpenStackManagerNovaAdminKeys; |
33 | 32 | $this->adminNova = new OpenStackNovaController( $adminCredentials ); |
34 | 33 | |
35 | | - $action = $wgRequest->getVal( 'action' ); |
| 34 | + $action = $this->getRequest()->getVal( 'action' ); |
36 | 35 | |
37 | 36 | if ( $action == "create" ) { |
38 | 37 | $this->createSecurityGroup(); |
— | — | @@ -54,12 +53,12 @@ |
55 | 54 | * @return bool |
56 | 55 | */ |
57 | 56 | function createSecurityGroup() { |
58 | | - global $wgRequest; |
59 | 57 | |
| 58 | + |
60 | 59 | $this->setHeaders(); |
61 | 60 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createsecuritygroup' ) ); |
62 | 61 | |
63 | | - $project = $wgRequest->getText( 'project' ); |
| 62 | + $project = $this->getRequest()->getText( 'project' ); |
64 | 63 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
65 | 64 | $this->notInRole( 'netadmin' ); |
66 | 65 | return false; |
— | — | @@ -103,13 +102,13 @@ |
104 | 103 | * @return bool |
105 | 104 | */ |
106 | 105 | function configureSecurityGroup() { |
107 | | - global $wgRequest; |
108 | 106 | |
| 107 | + |
109 | 108 | $this->setHeaders(); |
110 | 109 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-configuresecuritygroup' ) ); |
111 | 110 | |
112 | | - $securitygroupname = $wgRequest->getText( 'groupname' ); |
113 | | - $project = $wgRequest->getText( 'project' ); |
| 111 | + $securitygroupname = $this->getRequest()->getText( 'groupname' ); |
| 112 | + $project = $this->getRequest()->getText( 'project' ); |
114 | 113 | $securitygroup = $this->adminNova->getSecurityGroup( $securitygroupname, $project ); |
115 | 114 | $description = $securitygroup->getGroupDescription(); |
116 | 115 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
— | — | @@ -154,18 +153,18 @@ |
155 | 154 | * @return bool |
156 | 155 | */ |
157 | 156 | function deleteSecurityGroup() { |
158 | | - global $wgRequest; |
159 | 157 | |
| 158 | + |
160 | 159 | $this->setHeaders(); |
161 | 160 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletesecuritygroup' ) ); |
162 | 161 | |
163 | | - $project = $wgRequest->getText( 'project' ); |
| 162 | + $project = $this->getRequest()->getText( 'project' ); |
164 | 163 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
165 | 164 | $this->notInRole( 'netadmin' ); |
166 | 165 | return false; |
167 | 166 | } |
168 | | - $securitygroupname = $wgRequest->getText( 'groupname' ); |
169 | | - if ( ! $wgRequest->wasPosted() ) { |
| 167 | + $securitygroupname = $this->getRequest()->getText( 'groupname' ); |
| 168 | + if ( ! $this->getRequest()->wasPosted() ) { |
170 | 169 | $this->getOutput()->addWikiMsg( 'openstackmanager-deletesecuritygroup-confirm', $securitygroupname ); |
171 | 170 | } |
172 | 171 | $securityGroupInfo = array(); |
— | — | @@ -325,12 +324,12 @@ |
326 | 325 | * @return bool |
327 | 326 | */ |
328 | 327 | function addRule() { |
329 | | - global $wgRequest; |
330 | 328 | |
| 329 | + |
331 | 330 | $this->setHeaders(); |
332 | 331 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addrule' ) ); |
333 | 332 | |
334 | | - $project = $wgRequest->getText( 'project' ); |
| 333 | + $project = $this->getRequest()->getText( 'project' ); |
335 | 334 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
336 | 335 | $this->notInRole( 'netadmin' ); |
337 | 336 | return false; |
— | — | @@ -344,7 +343,7 @@ |
345 | 344 | $info["$securityGroupProject"]["$securityGroupName"] = $securityGroupName . ':' . $securityGroupProject; |
346 | 345 | } |
347 | 346 | $group_keys = $info; |
348 | | - $securitygroupname = $wgRequest->getText( 'groupname' ); |
| 347 | + $securitygroupname = $this->getRequest()->getText( 'groupname' ); |
349 | 348 | $securityGroupInfo = array(); |
350 | 349 | $securityGroupInfo['groupname'] = array( |
351 | 350 | 'type' => 'hidden', |
— | — | @@ -417,18 +416,18 @@ |
418 | 417 | * @return bool |
419 | 418 | */ |
420 | 419 | function removeRule() { |
421 | | - global $wgRequest; |
422 | 420 | |
| 421 | + |
423 | 422 | $this->setHeaders(); |
424 | 423 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removerule' ) ); |
425 | 424 | |
426 | | - $project = $wgRequest->getText( 'project' ); |
| 425 | + $project = $this->getRequest()->getText( 'project' ); |
427 | 426 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
428 | 427 | $this->notInRole( 'netadmin' ); |
429 | 428 | return false; |
430 | 429 | } |
431 | | - $securitygroupname = $wgRequest->getText( 'groupname' ); |
432 | | - if ( ! $wgRequest->wasPosted() ) { |
| 430 | + $securitygroupname = $this->getRequest()->getText( 'groupname' ); |
| 431 | + if ( ! $this->getRequest()->wasPosted() ) { |
433 | 432 | $this->getOutput()->addWikiMsg( 'openstackmanager-removerule-confirm', $securitygroupname ); |
434 | 433 | } |
435 | 434 | $securityGroupInfo = array(); |
— | — | @@ -444,30 +443,30 @@ |
445 | 444 | ); |
446 | 445 | $securityGroupInfo['fromport'] = array( |
447 | 446 | 'type' => 'hidden', |
448 | | - 'default' => $wgRequest->getText( 'fromport' ), |
| 447 | + 'default' => $this->getRequest()->getText( 'fromport' ), |
449 | 448 | 'name' => 'fromport', |
450 | 449 | ); |
451 | 450 | $securityGroupInfo['toport'] = array( |
452 | 451 | 'type' => 'hidden', |
453 | | - 'default' => $wgRequest->getText( 'toport' ), |
| 452 | + 'default' => $this->getRequest()->getText( 'toport' ), |
454 | 453 | 'name' => 'toport', |
455 | 454 | ); |
456 | 455 | $securityGroupInfo['protocol'] = array( |
457 | 456 | 'type' => 'hidden', |
458 | | - 'default' => $wgRequest->getText( 'protocol' ), |
| 457 | + 'default' => $this->getRequest()->getText( 'protocol' ), |
459 | 458 | 'name' => 'protocol', |
460 | 459 | ); |
461 | | - if ( $wgRequest->getText( 'ranges' ) ) { |
| 460 | + if ( $this->getRequest()->getText( 'ranges' ) ) { |
462 | 461 | $securityGroupInfo['ranges'] = array( |
463 | 462 | 'type' => 'hidden', |
464 | | - 'default' => $wgRequest->getText( 'ranges' ), |
| 463 | + 'default' => $this->getRequest()->getText( 'ranges' ), |
465 | 464 | 'name' => 'ranges', |
466 | 465 | ); |
467 | 466 | } |
468 | | - if ( $wgRequest->getText( 'groups' ) ) { |
| 467 | + if ( $this->getRequest()->getText( 'groups' ) ) { |
469 | 468 | $securityGroupInfo['groups'] = array( |
470 | 469 | 'type' => 'hidden', |
471 | | - 'default' => $wgRequest->getText( 'groups' ), |
| 470 | + 'default' => $this->getRequest()->getText( 'groups' ), |
472 | 471 | 'name' => 'groups', |
473 | 472 | ); |
474 | 473 | } |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php |
— | — | @@ -14,7 +14,6 @@ |
15 | 15 | } |
16 | 16 | |
17 | 17 | function execute( $par ) { |
18 | | - global $wgRequest; |
19 | 18 | global $wgOpenStackManagerNovaAdminKeys; |
20 | 19 | |
21 | 20 | if ( !$this->getUser()->isLoggedIn() ) { |
— | — | @@ -29,7 +28,7 @@ |
30 | 29 | $adminCredentials = $wgOpenStackManagerNovaAdminKeys; |
31 | 30 | $this->adminNova = new OpenStackNovaController( $adminCredentials ); |
32 | 31 | |
33 | | - $action = $wgRequest->getVal( 'action' ); |
| 32 | + $action = $this->getRequest()->getVal( 'action' ); |
34 | 33 | if ( $action == "allocate" ) { |
35 | 34 | $this->allocateAddress(); |
36 | 35 | } elseif ( $action == "release" ) { |
— | — | @@ -51,19 +50,17 @@ |
52 | 51 | * @return bool |
53 | 52 | */ |
54 | 53 | function allocateAddress() { |
55 | | - global $wgRequest; |
56 | | - |
57 | 54 | $this->setHeaders(); |
58 | 55 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-allocateaddress' ) ); |
59 | 56 | |
60 | | - $project = $wgRequest->getText( 'project' ); |
| 57 | + $project = $this->getRequest()->getText( 'project' ); |
61 | 58 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
62 | 59 | $this->notInRole( 'netadmin' ); |
63 | 60 | return false; |
64 | 61 | } |
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() ) { |
68 | 65 | $this->getOutput()->addWikiMsg( 'openstackmanager-allocateaddress-confirm', $project ); |
69 | 66 | } |
70 | 67 | $addressInfo = array(); |
— | — | @@ -91,20 +88,18 @@ |
92 | 89 | * @return bool |
93 | 90 | */ |
94 | 91 | function releaseAddress() { |
95 | | - global $wgRequest; |
96 | | - |
97 | 92 | $this->setHeaders(); |
98 | 93 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-releaseaddress' ) ); |
99 | 94 | |
100 | | - $project = $wgRequest->getText( 'project' ); |
| 95 | + $project = $this->getRequest()->getText( 'project' ); |
101 | 96 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
102 | 97 | $this->notInRole( 'netadmin' ); |
103 | 98 | return false; |
104 | 99 | } |
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() ) { |
109 | 104 | $this->getOutput()->addWikiMsg( 'openstackmanager-releaseaddress-confirm', $ip ); |
110 | 105 | } |
111 | 106 | $addressInfo = array(); |
— | — | @@ -137,19 +132,18 @@ |
138 | 133 | * @return bool |
139 | 134 | */ |
140 | 135 | function associateAddress() { |
141 | | - global $wgRequest; |
142 | 136 | |
143 | 137 | $this->setHeaders(); |
144 | 138 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-associateaddress' ) ); |
145 | 139 | |
146 | | - $ip = $wgRequest->getText( 'ip' ); |
147 | | - $project = $wgRequest->getText( 'project' ); |
| 140 | + $ip = $this->getRequest()->getText( 'ip' ); |
| 141 | + $project = $this->getRequest()->getText( 'project' ); |
148 | 142 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
149 | 143 | $this->notInRole( 'netadmin' ); |
150 | 144 | return false; |
151 | 145 | } |
152 | | - $userCredentials = $this->userLDAP->getCredentials(); |
153 | | - $this->userNova = new OpenStackNovaController( $userCredentials, $project ); |
| 146 | + $userCredentials = $this->userLDAP->getCredentials(); |
| 147 | + $this->userNova = new OpenStackNovaController( $userCredentials, $project ); |
154 | 148 | $instances = $this->userNova->getInstances(); |
155 | 149 | $instance_keys = array(); |
156 | 150 | foreach ( $instances as $instance ) { |
— | — | @@ -194,20 +188,18 @@ |
195 | 189 | * @return bool |
196 | 190 | */ |
197 | 191 | function disassociateAddress() { |
198 | | - global $wgRequest; |
199 | | - |
200 | 192 | $this->setHeaders(); |
201 | 193 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-disassociateaddress' ) ); |
202 | 194 | |
203 | | - $project = $wgRequest->getText( 'project' ); |
| 195 | + $project = $this->getRequest()->getText( 'project' ); |
204 | 196 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
205 | 197 | $this->notInRole( 'netadmin' ); |
206 | 198 | return false; |
207 | 199 | } |
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() ) { |
212 | 204 | $this->getOutput()->addWikiMsg( 'openstackmanager-disassociateaddress-confirm', $ip ); |
213 | 205 | } |
214 | 206 | $addressInfo = array(); |
— | — | @@ -240,17 +232,15 @@ |
241 | 233 | * @return bool |
242 | 234 | */ |
243 | 235 | function addHost() { |
244 | | - global $wgRequest; |
245 | | - |
246 | 236 | $this->setHeaders(); |
247 | 237 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addhost' ) ); |
248 | 238 | |
249 | | - $project = $wgRequest->getText( 'project' ); |
| 239 | + $project = $this->getRequest()->getText( 'project' ); |
250 | 240 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
251 | 241 | $this->notInRole( 'netadmin' ); |
252 | 242 | return false; |
253 | 243 | } |
254 | | - $ip = $wgRequest->getText( 'ip' ); |
| 244 | + $ip = $this->getRequest()->getText( 'ip' ); |
255 | 245 | $addressInfo = array(); |
256 | 246 | $addressInfo['project'] = array( |
257 | 247 | 'type' => 'hidden', |
— | — | @@ -299,22 +289,21 @@ |
300 | 290 | * @return bool |
301 | 291 | */ |
302 | 292 | function removeHost() { |
303 | | - global $wgRequest; |
304 | 293 | |
305 | 294 | $this->setHeaders(); |
306 | 295 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removehost' ) ); |
307 | 296 | |
308 | | - $project = $wgRequest->getText( 'project' ); |
| 297 | + $project = $this->getRequest()->getText( 'project' ); |
309 | 298 | if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) { |
310 | 299 | $this->notInRole( 'netadmin' ); |
311 | 300 | return false; |
312 | 301 | } |
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() ) { |
319 | 308 | $this->getOutput()->addWikiMsg( 'openstackmanager-removehost-confirm', $hostname, $ip ); |
320 | 309 | } |
321 | 310 | $addressInfo = array(); |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaProject.php |
— | — | @@ -15,14 +15,14 @@ |
16 | 16 | } |
17 | 17 | |
18 | 18 | function execute( $par ) { |
19 | | - global $wgRequest; |
20 | 19 | |
| 20 | + |
21 | 21 | if ( !$this->getUser()->isLoggedIn() ) { |
22 | 22 | $this->notLoggedIn(); |
23 | 23 | return; |
24 | 24 | } |
25 | 25 | $this->userLDAP = new OpenStackNovaUser(); |
26 | | - $action = $wgRequest->getVal( 'action' ); |
| 26 | + $action = $this->getRequest()->getVal( 'action' ); |
27 | 27 | if ( $action == "create" ) { |
28 | 28 | $this->createProject(); |
29 | 29 | } elseif ( $action == "delete" ) { |
— | — | @@ -94,12 +94,12 @@ |
95 | 95 | * @return bool |
96 | 96 | */ |
97 | 97 | function addMember() { |
98 | | - global $wgRequest; |
99 | 98 | |
| 99 | + |
100 | 100 | $this->setHeaders(); |
101 | 101 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addmember' ) ); |
102 | 102 | |
103 | | - $project = $wgRequest->getText( 'projectname' ); |
| 103 | + $project = $this->getRequest()->getText( 'projectname' ); |
104 | 104 | if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inProject( $project ) ) { |
105 | 105 | $this->notInProject(); |
106 | 106 | return false; |
— | — | @@ -136,12 +136,12 @@ |
137 | 137 | * @return bool |
138 | 138 | */ |
139 | 139 | function deleteMember() { |
140 | | - global $wgRequest; |
141 | 140 | |
| 141 | + |
142 | 142 | $this->setHeaders(); |
143 | 143 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removemember' ) ); |
144 | 144 | |
145 | | - $projectname = $wgRequest->getText( 'projectname' ); |
| 145 | + $projectname = $this->getRequest()->getText( 'projectname' ); |
146 | 146 | if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inProject( $projectname ) ) { |
147 | 147 | $this->notInProject(); |
148 | 148 | return false; |
— | — | @@ -184,8 +184,6 @@ |
185 | 185 | * @return bool |
186 | 186 | */ |
187 | 187 | function deleteProject() { |
188 | | - global $wgRequest; |
189 | | - |
190 | 188 | $this->setHeaders(); |
191 | 189 | if ( !$this->userCanExecute( $this->getUser() ) ) { |
192 | 190 | $this->displayRestrictionError(); |
— | — | @@ -193,8 +191,8 @@ |
194 | 192 | } |
195 | 193 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deleteproject' ) ); |
196 | 194 | |
197 | | - $project = $wgRequest->getText( 'projectname' ); |
198 | | - if ( ! $wgRequest->wasPosted() ) { |
| 195 | + $project = $this->getRequest()->getText( 'projectname' ); |
| 196 | + if ( ! $this->getRequest()->wasPosted() ) { |
199 | 197 | $this->getOutput()->addWikiMsg( 'openstackmanager-removeprojectconfirm', $project ); |
200 | 198 | } |
201 | 199 | $projectInfo = array(); |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php |
— | — | @@ -14,7 +14,6 @@ |
15 | 15 | } |
16 | 16 | |
17 | 17 | function execute( $par ) { |
18 | | - global $wgRequest; |
19 | 18 | global $wgOpenStackManagerLDAPRolesIntersect; |
20 | 19 | |
21 | 20 | if ( !$this->getUser()->isLoggedIn() ) { |
— | — | @@ -39,7 +38,7 @@ |
40 | 39 | return; |
41 | 40 | } |
42 | 41 | |
43 | | - $action = $wgRequest->getVal( 'action' ); |
| 42 | + $action = $this->getRequest()->getVal( 'action' ); |
44 | 43 | if ( $action == "create" ) { |
45 | 44 | $this->createDomain(); |
46 | 45 | } elseif ( $action == "delete" ) { |
— | — | @@ -98,13 +97,11 @@ |
99 | 98 | * @return bool |
100 | 99 | */ |
101 | 100 | function deleteDomain() { |
102 | | - global $wgRequest; |
103 | | - |
104 | 101 | $this->setHeaders(); |
105 | 102 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletedomain' ) ); |
106 | 103 | |
107 | | - $domainname = $wgRequest->getText( 'domainname' ); |
108 | | - if ( ! $wgRequest->wasPosted() ) { |
| 104 | + $domainname = $this->getRequest()->getText( 'domainname' ); |
| 105 | + if ( ! $this->getRequest()->wasPosted() ) { |
109 | 106 | $this->getOutput()->addWikiMsg( 'openstackmanager-deletedomain-confirm', $domainname ); |
110 | 107 | } |
111 | 108 | $domainInfo = array(); |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaVolume.php |
— | — | @@ -16,7 +16,6 @@ |
17 | 17 | } |
18 | 18 | |
19 | 19 | function execute( $par ) { |
20 | | - global $wgRequest; |
21 | 20 | global $wgOpenStackManagerNovaAdminKeys; |
22 | 21 | |
23 | 22 | if ( !$this->getUser()->isLoggedIn() ) { |
— | — | @@ -28,13 +27,13 @@ |
29 | 28 | $this->noCredentials(); |
30 | 29 | return; |
31 | 30 | } |
32 | | - $project = $wgRequest->getVal( 'project' ); |
| 31 | + $project = $this->getRequest()->getVal( 'project' ); |
33 | 32 | $userCredentials = $this->userLDAP->getCredentials(); |
34 | 33 | $this->userNova = new OpenStackNovaController( $userCredentials, $project ); |
35 | 34 | $adminCredentials = $wgOpenStackManagerNovaAdminKeys; |
36 | 35 | $this->adminNova = new OpenStackNovaController( $adminCredentials ); |
37 | 36 | |
38 | | - $action = $wgRequest->getVal( 'action' ); |
| 37 | + $action = $this->getRequest()->getVal( 'action' ); |
39 | 38 | |
40 | 39 | if ( $action == "create" ) { |
41 | 40 | if ( ! $this->userLDAP->inProject( $project ) ) { |
— | — | @@ -69,12 +68,10 @@ |
70 | 69 | * @return bool |
71 | 70 | */ |
72 | 71 | function createVolume() { |
73 | | - global $wgRequest; |
74 | | - |
75 | 72 | $this->setHeaders(); |
76 | 73 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-createvolume' ) ); |
77 | 74 | |
78 | | - $project = $wgRequest->getText( 'project' ); |
| 75 | + $project = $this->getRequest()->getText( 'project' ); |
79 | 76 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
80 | 77 | $this->notInRole( 'sysadmin' ); |
81 | 78 | return false; |
— | — | @@ -143,18 +140,18 @@ |
144 | 141 | * @return bool |
145 | 142 | */ |
146 | 143 | function deleteVolume() { |
147 | | - global $wgRequest; |
148 | 144 | |
| 145 | + |
149 | 146 | $this->setHeaders(); |
150 | 147 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletevolume' ) ); |
151 | 148 | |
152 | | - $project = $wgRequest->getText( 'project' ); |
| 149 | + $project = $this->getRequest()->getText( 'project' ); |
153 | 150 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
154 | 151 | $this->notInRole( 'sysadmin' ); |
155 | 152 | return false; |
156 | 153 | } |
157 | | - $volumeid = $wgRequest->getText( 'volumeid' ); |
158 | | - if ( ! $wgRequest->wasPosted() ) { |
| 154 | + $volumeid = $this->getRequest()->getText( 'volumeid' ); |
| 155 | + if ( ! $this->getRequest()->wasPosted() ) { |
159 | 156 | $this->getOutput()->addWikiMsg( 'openstackmanager-deletevolumequestion', $volumeid ); |
160 | 157 | } |
161 | 158 | $volumeInfo = array(); |
— | — | @@ -186,12 +183,12 @@ |
187 | 184 | * @return bool |
188 | 185 | */ |
189 | 186 | function attachVolume() { |
190 | | - global $wgRequest; |
191 | 187 | |
| 188 | + |
192 | 189 | $this->setHeaders(); |
193 | 190 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-attachvolume' ) ); |
194 | 191 | |
195 | | - $project = $wgRequest->getText( 'project' ); |
| 192 | + $project = $this->getRequest()->getText( 'project' ); |
196 | 193 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
197 | 194 | $this->notInRole( 'sysadmin' ); |
198 | 195 | return false; |
— | — | @@ -209,13 +206,13 @@ |
210 | 207 | $volumeInfo['volumeinfo'] = array( |
211 | 208 | 'type' => 'info', |
212 | 209 | 'label-message' => 'openstackmanager-volumename', |
213 | | - 'default' => $wgRequest->getText( 'volumeid' ), |
| 210 | + 'default' => $this->getRequest()->getText( 'volumeid' ), |
214 | 211 | 'section' => 'volume/info', |
215 | 212 | 'name' => 'volumeinfo', |
216 | 213 | ); |
217 | 214 | $volumeInfo['volumeid'] = array( |
218 | 215 | 'type' => 'hidden', |
219 | | - 'default' => $wgRequest->getText( 'volumeid' ), |
| 216 | + 'default' => $this->getRequest()->getText( 'volumeid' ), |
220 | 217 | 'name' => 'volumeid', |
221 | 218 | ); |
222 | 219 | $volumeInfo['volumedescription'] = array( |
— | — | @@ -261,12 +258,12 @@ |
262 | 259 | * @return bool |
263 | 260 | */ |
264 | 261 | function detachVolume() { |
265 | | - global $wgRequest; |
266 | 262 | |
| 263 | + |
267 | 264 | $this->setHeaders(); |
268 | 265 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-detachvolume' ) ); |
269 | 266 | |
270 | | - $project = $wgRequest->getText( 'project' ); |
| 267 | + $project = $this->getRequest()->getText( 'project' ); |
271 | 268 | if ( ! $this->userLDAP->inRole( 'sysadmin', $project ) ) { |
272 | 269 | $this->notInRole( 'sysadmin' ); |
273 | 270 | return false; |
— | — | @@ -275,7 +272,7 @@ |
276 | 273 | $volumeInfo['volumeinfo'] = array( |
277 | 274 | 'type' => 'info', |
278 | 275 | 'label-message' => 'openstackmanager-volumename', |
279 | | - 'default' => $wgRequest->getText( 'volumeid' ), |
| 276 | + 'default' => $this->getRequest()->getText( 'volumeid' ), |
280 | 277 | 'section' => 'volume/info', |
281 | 278 | 'name' => 'volumeinfo', |
282 | 279 | ); |
— | — | @@ -288,7 +285,7 @@ |
289 | 286 | ); |
290 | 287 | $volumeInfo['volumeid'] = array( |
291 | 288 | 'type' => 'hidden', |
292 | | - 'default' => $wgRequest->getText( 'volumeid' ), |
| 289 | + 'default' => $this->getRequest()->getText( 'volumeid' ), |
293 | 290 | 'name' => 'volumeid', |
294 | 291 | ); |
295 | 292 | $volumeInfo['project'] = array( |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaKey.php |
— | — | @@ -13,8 +13,6 @@ |
14 | 14 | } |
15 | 15 | |
16 | 16 | function execute( $par ) { |
17 | | - global $wgRequest; |
18 | | - |
19 | 17 | if ( !$this->getUser()->isLoggedIn() ) { |
20 | 18 | $this->notLoggedIn(); |
21 | 19 | return; |
— | — | @@ -25,7 +23,7 @@ |
26 | 24 | return; |
27 | 25 | } |
28 | 26 | |
29 | | - $action = $wgRequest->getVal( 'action' ); |
| 27 | + $action = $this->getRequest()->getVal( 'action' ); |
30 | 28 | if ( $action == "import" ) { |
31 | 29 | $this->importKey(); |
32 | 30 | } elseif ( $action == "delete" ) { |
— | — | @@ -39,12 +37,12 @@ |
40 | 38 | * @return bool |
41 | 39 | */ |
42 | 40 | function importKey() { |
43 | | - global $wgRequest; |
| 41 | + |
44 | 42 | global $wgOpenStackManagerNovaKeypairStorage; |
45 | 43 | |
46 | 44 | $project = ''; |
47 | 45 | if ( $wgOpenStackManagerNovaKeypairStorage == 'nova' ) { |
48 | | - $project = $wgRequest->getVal( 'project' ); |
| 46 | + $project = $this->getRequest()->getVal( 'project' ); |
49 | 47 | if ( $project && ! $this->userLDAP->inProject( $project ) ) { |
50 | 48 | $this->notInProject(); |
51 | 49 | return; |
— | — | @@ -100,7 +98,7 @@ |
101 | 99 | * @return bool |
102 | 100 | */ |
103 | 101 | function deleteKey() { |
104 | | - global $wgRequest; |
| 102 | + |
105 | 103 | global $wgOpenStackManagerNovaKeypairStorage; |
106 | 104 | |
107 | 105 | $this->setHeaders(); |
— | — | @@ -111,8 +109,8 @@ |
112 | 110 | $keypairs = array(); |
113 | 111 | |
114 | 112 | 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' ); |
117 | 115 | if ( $project && ! $this->userLDAP->inProject( $project ) ) { |
118 | 116 | $this->notInProject(); |
119 | 117 | return true; |
— | — | @@ -128,9 +126,9 @@ |
129 | 127 | 'name' => 'project', |
130 | 128 | ); |
131 | 129 | } elseif ( $wgOpenStackManagerNovaKeypairStorage == 'ldap' ) { |
132 | | - $hash = $wgRequest->getVal( 'hash' ); |
| 130 | + $hash = $this->getRequest()->getVal( 'hash' ); |
133 | 131 | $keypairs = $this->userLDAP->getKeypairs(); |
134 | | - if ( ! $wgRequest->wasPosted() ) { |
| 132 | + if ( ! $this->getRequest()->wasPosted() ) { |
135 | 133 | $this->getOutput()->addHTML( Html::element( 'pre', array(), $keypairs[$hash] ) ); |
136 | 134 | $this->getOutput()->addWikiMsg( 'openstackmanager-deletekeyconfirm' ); |
137 | 135 | } |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaPuppetGroup.php |
— | — | @@ -6,13 +6,13 @@ |
7 | 7 | } |
8 | 8 | |
9 | 9 | function execute( $par ) { |
10 | | - global $wgRequest; |
11 | 10 | |
| 11 | + |
12 | 12 | if ( ! $this->getUser()->isLoggedIn() ) { |
13 | 13 | $this->notLoggedIn(); |
14 | 14 | return; |
15 | 15 | } |
16 | | - $action = $wgRequest->getVal( 'action' ); |
| 16 | + $action = $this->getRequest()->getVal( 'action' ); |
17 | 17 | if ( $action == "create" ) { |
18 | 18 | $this->createPuppetGroup(); |
19 | 19 | } elseif ( $action == "delete" ) { |
— | — | @@ -81,8 +81,8 @@ |
82 | 82 | * @return bool |
83 | 83 | */ |
84 | 84 | function addPuppetClass() { |
85 | | - global $wgRequest; |
86 | 85 | |
| 86 | + |
87 | 87 | $this->setHeaders(); |
88 | 88 | if ( !$this->userCanExecute( $this->getUser() ) ) { |
89 | 89 | $this->displayRestrictionError(); |
— | — | @@ -90,7 +90,7 @@ |
91 | 91 | } |
92 | 92 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addpuppetclass' ) ); |
93 | 93 | |
94 | | - $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' ); |
| 94 | + $puppetGroupId = $this->getRequest()->getInt( 'puppetgroupid' ); |
95 | 95 | $puppetGroupInfo = array(); |
96 | 96 | $puppetGroupInfo['puppetclassname'] = array( |
97 | 97 | 'type' => 'text', |
— | — | @@ -127,18 +127,18 @@ |
128 | 128 | * @return bool |
129 | 129 | */ |
130 | 130 | function deletePuppetClass() { |
131 | | - global $wgRequest; |
132 | 131 | |
| 132 | + |
133 | 133 | $this->setHeaders(); |
134 | 134 | if ( !$this->userCanExecute( $this->getUser() ) ) { |
135 | 135 | $this->displayRestrictionError(); |
136 | 136 | return false; |
137 | 137 | } |
138 | 138 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removepuppetclass' ) ); |
139 | | - if ( ! $wgRequest->wasPosted() ) { |
| 139 | + if ( ! $this->getRequest()->wasPosted() ) { |
140 | 140 | $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetclassconfirm' ); |
141 | 141 | } |
142 | | - $puppetClassId = $wgRequest->getInt( 'puppetclassid' ); |
| 142 | + $puppetClassId = $this->getRequest()->getInt( 'puppetclassid' ); |
143 | 143 | $puppetGroupInfo = array(); |
144 | 144 | $puppetGroupInfo['puppetclassid'] = array( |
145 | 145 | 'type' => 'hidden', |
— | — | @@ -164,8 +164,8 @@ |
165 | 165 | * @return bool |
166 | 166 | */ |
167 | 167 | function addPuppetVar() { |
168 | | - global $wgRequest; |
169 | 168 | |
| 169 | + |
170 | 170 | $this->setHeaders(); |
171 | 171 | if ( !$this->userCanExecute( $this->getUser() ) ) { |
172 | 172 | $this->displayRestrictionError(); |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | } |
175 | 175 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addpuppetvar' ) ); |
176 | 176 | |
177 | | - $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' ); |
| 177 | + $puppetGroupId = $this->getRequest()->getInt( 'puppetgroupid' ); |
178 | 178 | $puppetGroupInfo = array(); |
179 | 179 | $puppetGroupInfo['puppetvarname'] = array( |
180 | 180 | 'type' => 'text', |
— | — | @@ -210,8 +210,8 @@ |
211 | 211 | * @return bool |
212 | 212 | */ |
213 | 213 | function deletePuppetVar() { |
214 | | - global $wgRequest; |
215 | 214 | |
| 215 | + |
216 | 216 | $this->setHeaders(); |
217 | 217 | if ( !$this->userCanExecute( $this->getUser() ) ) { |
218 | 218 | $this->displayRestrictionError(); |
— | — | @@ -219,8 +219,8 @@ |
220 | 220 | } |
221 | 221 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removepuppetvar' ) ); |
222 | 222 | |
223 | | - $puppetVarId = $wgRequest->getText( 'puppetvarid' ); |
224 | | - if ( ! $wgRequest->wasPosted() ) { |
| 223 | + $puppetVarId = $this->getRequest()->getText( 'puppetvarid' ); |
| 224 | + if ( ! $this->getRequest()->wasPosted() ) { |
225 | 225 | $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetvarconfirm' ); |
226 | 226 | } |
227 | 227 | $puppetGroupInfo = array(); |
— | — | @@ -248,8 +248,8 @@ |
249 | 249 | * @return bool |
250 | 250 | */ |
251 | 251 | function deletePuppetGroup() { |
252 | | - global $wgRequest; |
253 | 252 | |
| 253 | + |
254 | 254 | $this->setHeaders(); |
255 | 255 | if ( !$this->userCanExecute( $this->getUser() ) ) { |
256 | 256 | $this->displayRestrictionError(); |
— | — | @@ -257,8 +257,8 @@ |
258 | 258 | } |
259 | 259 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletepuppetgroup' ) ); |
260 | 260 | |
261 | | - $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' ); |
262 | | - if ( ! $wgRequest->wasPosted() ) { |
| 261 | + $puppetGroupId = $this->getRequest()->getInt( 'puppetgroupid' ); |
| 262 | + if ( ! $this->getRequest()->wasPosted() ) { |
263 | 263 | $this->getOutput()->addWikiMsg( 'openstackmanager-removepuppetgroupconfirm' ); |
264 | 264 | } |
265 | 265 | $puppetGroupInfo = array(); |
— | — | @@ -285,8 +285,8 @@ |
286 | 286 | * @return bool |
287 | 287 | */ |
288 | 288 | function modifyPuppetClass() { |
289 | | - global $wgRequest; |
290 | 289 | |
| 290 | + |
291 | 291 | $this->setHeaders(); |
292 | 292 | if ( !$this->userCanExecute( $this->getUser() ) ) { |
293 | 293 | $this->displayRestrictionError(); |
— | — | @@ -294,9 +294,9 @@ |
295 | 295 | } |
296 | 296 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetclass' ) ); |
297 | 297 | |
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' ); |
301 | 301 | $puppetGroupInfo = array(); |
302 | 302 | $puppetGroupInfo['puppetclassid'] = array( |
303 | 303 | 'type' => 'hidden', |
— | — | @@ -341,8 +341,8 @@ |
342 | 342 | * @return bool |
343 | 343 | */ |
344 | 344 | function modifyPuppetVar() { |
345 | | - global $wgRequest; |
346 | 345 | |
| 346 | + |
347 | 347 | $this->setHeaders(); |
348 | 348 | if ( !$this->userCanExecute( $this->getUser() ) ) { |
349 | 349 | $this->displayRestrictionError(); |
— | — | @@ -350,9 +350,9 @@ |
351 | 351 | } |
352 | 352 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetvar' ) ); |
353 | 353 | |
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' ); |
357 | 357 | $puppetGroupInfo = array(); |
358 | 358 | $puppetGroupInfo['puppetvarid'] = array( |
359 | 359 | 'type' => 'hidden', |
— | — | @@ -397,8 +397,6 @@ |
398 | 398 | * @return bool |
399 | 399 | */ |
400 | 400 | function modifyPuppetGroup() { |
401 | | - global $wgRequest; |
402 | | - |
403 | 401 | $this->setHeaders(); |
404 | 402 | if ( !$this->userCanExecute( $this->getUser() ) ) { |
405 | 403 | $this->displayRestrictionError(); |
— | — | @@ -406,8 +404,8 @@ |
407 | 405 | } |
408 | 406 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifypuppetgroup' ) ); |
409 | 407 | |
410 | | - $puppetGroupId = $wgRequest->getInt( 'puppetgroupid' ); |
411 | | - $puppetGroupPosition = $wgRequest->getInt( 'puppetgroupposition' ); |
| 408 | + $puppetGroupId = $this->getRequest()->getInt( 'puppetgroupid' ); |
| 409 | + $puppetGroupPosition = $this->getRequest()->getInt( 'puppetgroupposition' ); |
412 | 410 | $puppetGroupInfo = array(); |
413 | 411 | $puppetGroupInfo['puppetgroupid'] = array( |
414 | 412 | 'type' => 'hidden', |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaRole.php |
— | — | @@ -15,14 +15,14 @@ |
16 | 16 | } |
17 | 17 | |
18 | 18 | function execute( $par ) { |
19 | | - global $wgRequest; |
20 | 19 | |
| 20 | + |
21 | 21 | if ( !$this->getUser()->isLoggedIn() ) { |
22 | 22 | $this->notLoggedIn(); |
23 | 23 | return; |
24 | 24 | } |
25 | 25 | $this->userLDAP = new OpenStackNovaUser(); |
26 | | - $action = $wgRequest->getVal( 'action' ); |
| 26 | + $action = $this->getRequest()->getVal( 'action' ); |
27 | 27 | if ( $action == "addmember" ) { |
28 | 28 | $this->addMember(); |
29 | 29 | } elseif ( $action == "deletemember" ) { |
— | — | @@ -36,14 +36,14 @@ |
37 | 37 | * @return bool |
38 | 38 | */ |
39 | 39 | function addMember() { |
40 | | - global $wgRequest; |
41 | 40 | |
| 41 | + |
42 | 42 | $this->setHeaders(); |
43 | 43 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addmember' ) ); |
44 | 44 | |
45 | 45 | $roleInfo = array(); |
46 | | - $rolename = $wgRequest->getText( 'rolename' ); |
47 | | - $projectname = $wgRequest->getText( 'projectname' ); |
| 46 | + $rolename = $this->getRequest()->getText( 'rolename' ); |
| 47 | + $projectname = $this->getRequest()->getText( 'projectname' ); |
48 | 48 | if ( $projectname ) { |
49 | 49 | if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inRole( $rolename, $projectname, true ) ) { |
50 | 50 | $this->displayRestrictionError(); |
— | — | @@ -100,7 +100,7 @@ |
101 | 101 | ); |
102 | 102 | $roleInfo['returnto'] = array( |
103 | 103 | 'type' => 'hidden', |
104 | | - 'default' => $wgRequest->getText('returnto'), |
| 104 | + 'default' => $this->getRequest()->getText('returnto'), |
105 | 105 | 'name' => 'returnto', |
106 | 106 | ); |
107 | 107 | |
— | — | @@ -117,13 +117,11 @@ |
118 | 118 | * @return bool |
119 | 119 | */ |
120 | 120 | function deleteMember() { |
121 | | - global $wgRequest; |
122 | | - |
123 | 121 | $this->setHeaders(); |
124 | 122 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removerolemember' ) ); |
125 | 123 | |
126 | | - $rolename = $wgRequest->getText( 'rolename' ); |
127 | | - $projectname = $wgRequest->getText( 'projectname' ); |
| 124 | + $rolename = $this->getRequest()->getText( 'rolename' ); |
| 125 | + $projectname = $this->getRequest()->getText( 'projectname' ); |
128 | 126 | if ( $projectname ) { |
129 | 127 | if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inRole( $rolename, $projectname, true ) ) { |
130 | 128 | $this->displayRestrictionError(); |
— | — | @@ -180,7 +178,7 @@ |
181 | 179 | ); |
182 | 180 | $roleInfo['returnto'] = array( |
183 | 181 | 'type' => 'hidden', |
184 | | - 'default' => $wgRequest->getText('returnto'), |
| 182 | + 'default' => $this->getRequest()->getText('returnto'), |
185 | 183 | 'name' => 'returnto', |
186 | 184 | ); |
187 | 185 | |
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSudoer.php |
— | — | @@ -10,8 +10,6 @@ |
11 | 11 | } |
12 | 12 | |
13 | 13 | function execute( $par ) { |
14 | | - global $wgRequest; |
15 | | - |
16 | 14 | if ( !$this->getUser()->isLoggedIn() ) { |
17 | 15 | $this->notLoggedIn(); |
18 | 16 | return; |
— | — | @@ -21,7 +19,7 @@ |
22 | 20 | return; |
23 | 21 | } |
24 | 22 | |
25 | | - $action = $wgRequest->getVal( 'action' ); |
| 23 | + $action = $this->getRequest()->getVal( 'action' ); |
26 | 24 | if ( $action == "create" ) { |
27 | 25 | $this->createSudoer(); |
28 | 26 | } elseif ( $action == "delete" ) { |
— | — | @@ -99,13 +97,13 @@ |
100 | 98 | * @return bool |
101 | 99 | */ |
102 | 100 | function deleteSudoer() { |
103 | | - global $wgRequest; |
104 | 101 | |
| 102 | + |
105 | 103 | $this->setHeaders(); |
106 | 104 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-deletesudoer' ) ); |
107 | 105 | |
108 | | - $sudoername = $wgRequest->getText( 'sudoername' ); |
109 | | - if ( ! $wgRequest->wasPosted() ) { |
| 106 | + $sudoername = $this->getRequest()->getText( 'sudoername' ); |
| 107 | + if ( ! $this->getRequest()->wasPosted() ) { |
110 | 108 | $this->getOutput()->addWikiMsg( 'openstackmanager-deletesudoer-confirm', $sudoername ); |
111 | 109 | } |
112 | 110 | $sudoerInfo = array(); |
— | — | @@ -132,12 +130,12 @@ |
133 | 131 | * @return bool |
134 | 132 | */ |
135 | 133 | function modifySudoer() { |
136 | | - global $wgRequest; |
137 | 134 | |
| 135 | + |
138 | 136 | $this->setHeaders(); |
139 | 137 | $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-modifysudoer' ) ); |
140 | 138 | |
141 | | - $sudoername = $wgRequest->getText( 'sudoername' ); |
| 139 | + $sudoername = $this->getRequest()->getText( 'sudoername' ); |
142 | 140 | $sudoer = OpenStackNovaSudoer::getSudoerByName( $sudoername ); |
143 | 141 | $users = implode( ',', $sudoer->getSudoerUsers() ); |
144 | 142 | $hosts = implode( ',', $sudoer->getSudoerHosts() ); |