r107245 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107244‎ | r107245 | r107246 >
Date:23:47, 24 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Bye to $wgUser also
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,10 +16,10 @@
1717 }
1818
1919 function execute( $par ) {
20 - global $wgRequest, $wgUser;
 20+ global $wgRequest;
2121 global $wgOpenStackManagerNovaAdminKeys;
2222
23 - if ( ! $wgUser->isLoggedIn() ) {
 23+ if ( !$this->getUser()->isLoggedIn() ) {
2424 $this->notLoggedIn();
2525 return;
2626 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php
@@ -16,10 +16,10 @@
1717 }
1818
1919 function execute( $par ) {
20 - global $wgRequest, $wgUser;
 20+ global $wgRequest;
2121 global $wgOpenStackManagerNovaAdminKeys;
2222
23 - if ( !$wgUser->isLoggedIn() ) {
 23+ if ( !$this->getUser()->isLoggedIn() ) {
2424 $this->notLoggedIn();
2525 return;
2626 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaAddress.php
@@ -14,10 +14,10 @@
1515 }
1616
1717 function execute( $par ) {
18 - global $wgRequest, $wgUser;
 18+ global $wgRequest;
1919 global $wgOpenStackManagerNovaAdminKeys;
2020
21 - if ( !$wgUser->isLoggedIn() ) {
 21+ if ( !$this->getUser()->isLoggedIn() ) {
2222 $this->notLoggedIn();
2323 return;
2424 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaProject.php
@@ -15,9 +15,9 @@
1616 }
1717
1818 function execute( $par ) {
19 - global $wgRequest, $wgUser;
 19+ global $wgRequest;
2020
21 - if ( !$wgUser->isLoggedIn() ) {
 21+ if ( !$this->getUser()->isLoggedIn() ) {
2222 $this->notLoggedIn();
2323 return;
2424 }
@@ -40,10 +40,8 @@
4141 * @return bool
4242 */
4343 function createProject() {
44 - global $wgUser;
45 -
4644 $this->setHeaders();
47 - if ( !$this->userCanExecute( $wgUser ) ) {
 45+ if ( !$this->userCanExecute( $this->getUser() ) ) {
4846 $this->displayRestrictionError();
4947 return false;
5048 }
@@ -97,13 +95,12 @@
9896 */
9997 function addMember() {
10098 global $wgRequest;
101 - global $wgUser;
10299
103100 $this->setHeaders();
104101 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addmember' ) );
105102
106103 $project = $wgRequest->getText( 'projectname' );
107 - if ( !$this->userCanExecute( $wgUser ) && !$this->userLDAP->inProject( $project ) ) {
 104+ if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inProject( $project ) ) {
108105 $this->notInProject();
109106 return false;
110107 }
@@ -140,13 +137,12 @@
141138 */
142139 function deleteMember() {
143140 global $wgRequest;
144 - global $wgUser;
145141
146142 $this->setHeaders();
147143 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removemember' ) );
148144
149145 $projectname = $wgRequest->getText( 'projectname' );
150 - if ( !$this->userCanExecute( $wgUser ) && !$this->userLDAP->inProject( $projectname ) ) {
 146+ if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inProject( $projectname ) ) {
151147 $this->notInProject();
152148 return false;
153149 }
@@ -189,10 +185,9 @@
190186 */
191187 function deleteProject() {
192188 global $wgRequest;
193 - global $wgUser;
194189
195190 $this->setHeaders();
196 - if ( !$this->userCanExecute( $wgUser ) ) {
 191+ if ( !$this->userCanExecute( $this->getUser() ) ) {
197192 $this->displayRestrictionError();
198193 return false;
199194 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php
@@ -14,10 +14,10 @@
1515 }
1616
1717 function execute( $par ) {
18 - global $wgRequest, $wgUser;
 18+ global $wgRequest;
1919 global $wgOpenStackManagerLDAPRolesIntersect;
2020
21 - if ( !$wgUser->isLoggedIn() ) {
 21+ if ( !$this->getUser()->isLoggedIn() ) {
2222 $this->notLoggedIn();
2323 return;
2424 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaVolume.php
@@ -16,10 +16,10 @@
1717 }
1818
1919 function execute( $par ) {
20 - global $wgRequest, $wgUser;
 20+ global $wgRequest;
2121 global $wgOpenStackManagerNovaAdminKeys;
2222
23 - if ( !$wgUser->isLoggedIn() ) {
 23+ if ( !$this->getUser()->isLoggedIn() ) {
2424 $this->notLoggedIn();
2525 return;
2626 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaKey.php
@@ -13,9 +13,9 @@
1414 }
1515
1616 function execute( $par ) {
17 - global $wgRequest, $wgUser;
 17+ global $wgRequest;
1818
19 - if ( !$wgUser->isLoggedIn() ) {
 19+ if ( !$this->getUser()->isLoggedIn() ) {
2020 $this->notLoggedIn();
2121 return;
2222 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaPuppetGroup.php
@@ -6,9 +6,9 @@
77 }
88
99 function execute( $par ) {
10 - global $wgRequest, $wgUser;
 10+ global $wgRequest;
1111
12 - if ( ! $wgUser->isLoggedIn() ) {
 12+ if ( ! $this->getUser()->isLoggedIn() ) {
1313 $this->notLoggedIn();
1414 return;
1515 }
@@ -40,10 +40,8 @@
4141 * @return bool
4242 */
4343 function createPuppetGroup() {
44 - global $wgUser;
45 -
4644 $this->setHeaders();
47 - if ( !$this->userCanExecute( $wgUser ) ) {
 45+ if ( !$this->userCanExecute( $this->getUser() ) ) {
4846 $this->displayRestrictionError();
4947 return false;
5048 }
@@ -84,10 +82,9 @@
8583 */
8684 function addPuppetClass() {
8785 global $wgRequest;
88 - global $wgUser;
8986
9087 $this->setHeaders();
91 - if ( !$this->userCanExecute( $wgUser ) ) {
 88+ if ( !$this->userCanExecute( $this->getUser() ) ) {
9289 $this->displayRestrictionError();
9390 return false;
9491 }
@@ -131,10 +128,9 @@
132129 */
133130 function deletePuppetClass() {
134131 global $wgRequest;
135 - global $wgUser;
136132
137133 $this->setHeaders();
138 - if ( !$this->userCanExecute( $wgUser ) ) {
 134+ if ( !$this->userCanExecute( $this->getUser() ) ) {
139135 $this->displayRestrictionError();
140136 return false;
141137 }
@@ -169,10 +165,9 @@
170166 */
171167 function addPuppetVar() {
172168 global $wgRequest;
173 - global $wgUser;
174169
175170 $this->setHeaders();
176 - if ( !$this->userCanExecute( $wgUser ) ) {
 171+ if ( !$this->userCanExecute( $this->getUser() ) ) {
177172 $this->displayRestrictionError();
178173 return false;
179174 }
@@ -216,10 +211,9 @@
217212 */
218213 function deletePuppetVar() {
219214 global $wgRequest;
220 - global $wgUser;
221215
222216 $this->setHeaders();
223 - if ( !$this->userCanExecute( $wgUser ) ) {
 217+ if ( !$this->userCanExecute( $this->getUser() ) ) {
224218 $this->displayRestrictionError();
225219 return false;
226220 }
@@ -255,10 +249,9 @@
256250 */
257251 function deletePuppetGroup() {
258252 global $wgRequest;
259 - global $wgUser;
260253
261254 $this->setHeaders();
262 - if ( !$this->userCanExecute( $wgUser ) ) {
 255+ if ( !$this->userCanExecute( $this->getUser() ) ) {
263256 $this->displayRestrictionError();
264257 return false;
265258 }
@@ -293,10 +286,9 @@
294287 */
295288 function modifyPuppetClass() {
296289 global $wgRequest;
297 - global $wgUser;
298290
299291 $this->setHeaders();
300 - if ( !$this->userCanExecute( $wgUser ) ) {
 292+ if ( !$this->userCanExecute( $this->getUser() ) ) {
301293 $this->displayRestrictionError();
302294 return false;
303295 }
@@ -350,10 +342,9 @@
351343 */
352344 function modifyPuppetVar() {
353345 global $wgRequest;
354 - global $wgUser;
355346
356347 $this->setHeaders();
357 - if ( !$this->userCanExecute( $wgUser ) ) {
 348+ if ( !$this->userCanExecute( $this->getUser() ) ) {
358349 $this->displayRestrictionError();
359350 return false;
360351 }
@@ -407,10 +398,9 @@
408399 */
409400 function modifyPuppetGroup() {
410401 global $wgRequest;
411 - global $wgUser;
412402
413403 $this->setHeaders();
414 - if ( !$this->userCanExecute( $wgUser ) ) {
 404+ if ( !$this->userCanExecute( $this->getUser() ) ) {
415405 $this->displayRestrictionError();
416406 return false;
417407 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaRole.php
@@ -15,9 +15,9 @@
1616 }
1717
1818 function execute( $par ) {
19 - global $wgRequest, $wgUser;
 19+ global $wgRequest;
2020
21 - if ( !$wgUser->isLoggedIn() ) {
 21+ if ( !$this->getUser()->isLoggedIn() ) {
2222 $this->notLoggedIn();
2323 return;
2424 }
@@ -36,7 +36,7 @@
3737 * @return bool
3838 */
3939 function addMember() {
40 - global $wgRequest, $wgUser;
 40+ global $wgRequest;
4141
4242 $this->setHeaders();
4343 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-addmember' ) );
@@ -45,7 +45,7 @@
4646 $rolename = $wgRequest->getText( 'rolename' );
4747 $projectname = $wgRequest->getText( 'projectname' );
4848 if ( $projectname ) {
49 - if ( !$this->userCanExecute( $wgUser ) && !$this->userLDAP->inRole( $rolename, $projectname, true ) ) {
 49+ if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inRole( $rolename, $projectname, true ) ) {
5050 $this->displayRestrictionError();
5151 return false;
5252 }
@@ -71,7 +71,7 @@
7272 'name' => 'members',
7373 );
7474 } else {
75 - if ( !$this->userCanExecute( $wgUser ) ) {
 75+ if ( !$this->userCanExecute( $this->getUser() ) ) {
7676 $this->displayRestrictionError();
7777 return false;
7878 }
@@ -118,7 +118,6 @@
119119 */
120120 function deleteMember() {
121121 global $wgRequest;
122 - global $wgUser;
123122
124123 $this->setHeaders();
125124 $this->getOutput()->setPagetitle( wfMsg( 'openstackmanager-removerolemember' ) );
@@ -126,7 +125,7 @@
127126 $rolename = $wgRequest->getText( 'rolename' );
128127 $projectname = $wgRequest->getText( 'projectname' );
129128 if ( $projectname ) {
130 - if ( !$this->userCanExecute( $wgUser ) && !$this->userLDAP->inRole( $rolename, $projectname, true ) ) {
 129+ if ( !$this->userCanExecute( $this->getUser() ) && !$this->userLDAP->inRole( $rolename, $projectname, true ) ) {
131130 $this->displayRestrictionError();
132131 return false;
133132 }
@@ -141,7 +140,7 @@
142141 }
143142 }
144143 } else {
145 - if ( !$this->userCanExecute( $wgUser ) ) {
 144+ if ( !$this->userCanExecute( $this->getUser() ) ) {
146145 $this->displayRestrictionError();
147146 return false;
148147 }
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSudoer.php
@@ -10,9 +10,9 @@
1111 }
1212
1313 function execute( $par ) {
14 - global $wgRequest, $wgUser;
 14+ global $wgRequest;
1515
16 - if ( !$wgUser->isLoggedIn() ) {
 16+ if ( !$this->getUser()->isLoggedIn() ) {
1717 $this->notLoggedIn();
1818 return;
1919 }

Status & tagging log