Index: trunk/extensions/OpenStackManager/special/SpecialNovaProject.php |
— | — | @@ -161,45 +161,47 @@ |
162 | 162 | $this->getOutput()->setPageTitle( wfMsg( 'openstackmanager-projectlist' ) ); |
163 | 163 | $this->getOutput()->addModuleStyles( 'ext.openstack' ); |
164 | 164 | |
165 | | - $projectInfo = array(); |
166 | | - $projectInfo['projectname'] = array( |
167 | | - 'type' => 'text', |
168 | | - 'label-message' => 'openstackmanager-projectname', |
169 | | - 'validation-callback' => array( $this, 'validateText' ), |
170 | | - 'default' => '', |
171 | | - 'section' => 'project', |
172 | | - 'name' => 'projectname', |
173 | | - ); |
174 | | - $projectInfo['member'] = array( |
175 | | - 'type' => 'text', |
176 | | - 'label-message' => 'openstackmanager-member', |
177 | | - 'default' => '', |
178 | | - 'section' => 'project', |
179 | | - 'name' => 'member', |
180 | | - ); |
181 | | - $role_keys = array(); |
182 | | - foreach ( OpenStackNovaProject::$rolenames as $rolename ) { |
183 | | - $role_keys["$rolename"] = $rolename; |
184 | | - } |
185 | | - $projectInfo['roles'] = array( |
186 | | - 'type' => 'multiselect', |
187 | | - 'label-message' => 'openstackmanager-roles', |
188 | | - 'section' => 'project', |
189 | | - 'options' => $role_keys, |
190 | | - 'name' => 'roles', |
191 | | - ); |
| 165 | + if ( $this->userLDAP->inGlobalRole( 'cloudadmin' ) ) { |
| 166 | + $projectInfo = array(); |
| 167 | + $projectInfo['projectname'] = array( |
| 168 | + 'type' => 'text', |
| 169 | + 'label-message' => 'openstackmanager-projectname', |
| 170 | + 'validation-callback' => array( $this, 'validateText' ), |
| 171 | + 'default' => '', |
| 172 | + 'section' => 'project', |
| 173 | + 'name' => 'projectname', |
| 174 | + ); |
| 175 | + $projectInfo['member'] = array( |
| 176 | + 'type' => 'text', |
| 177 | + 'label-message' => 'openstackmanager-member', |
| 178 | + 'default' => '', |
| 179 | + 'section' => 'project', |
| 180 | + 'name' => 'member', |
| 181 | + ); |
| 182 | + $role_keys = array(); |
| 183 | + foreach ( OpenStackNovaProject::$rolenames as $rolename ) { |
| 184 | + $role_keys["$rolename"] = $rolename; |
| 185 | + } |
| 186 | + $projectInfo['roles'] = array( |
| 187 | + 'type' => 'multiselect', |
| 188 | + 'label-message' => 'openstackmanager-roles', |
| 189 | + 'section' => 'project', |
| 190 | + 'options' => $role_keys, |
| 191 | + 'name' => 'roles', |
| 192 | + ); |
192 | 193 | |
193 | | - $projectInfo['action'] = array( |
194 | | - 'type' => 'hidden', |
195 | | - 'default' => 'create', |
196 | | - 'name' => 'action', |
197 | | - ); |
| 194 | + $projectInfo['action'] = array( |
| 195 | + 'type' => 'hidden', |
| 196 | + 'default' => 'create', |
| 197 | + 'name' => 'action', |
| 198 | + ); |
198 | 199 | |
199 | | - $projectForm = new SpecialNovaProjectForm( $projectInfo, 'openstackmanager-novaproject' ); |
200 | | - $projectForm->setTitle( SpecialPage::getTitleFor( 'NovaProject' ) ); |
201 | | - $projectForm->setSubmitID( 'novaproject-form-createprojectsubmit' ); |
202 | | - $projectForm->setSubmitCallback( array( $this, 'tryCreateSubmit' ) ); |
203 | | - $projectForm->show(); |
| 200 | + $projectForm = new SpecialNovaProjectForm( $projectInfo, 'openstackmanager-novaproject' ); |
| 201 | + $projectForm->setTitle( SpecialPage::getTitleFor( 'NovaProject' ) ); |
| 202 | + $projectForm->setSubmitID( 'novaproject-form-createprojectsubmit' ); |
| 203 | + $projectForm->setSubmitCallback( array( $this, 'tryCreateSubmit' ) ); |
| 204 | + $projectForm->show(); |
| 205 | + } |
204 | 206 | |
205 | 207 | $out = ''; |
206 | 208 | |