Index: trunk/extensions/OpenStackManager/SpecialNovaInstance.php |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | <?php |
3 | | -class SpecialNovaInstance extends SpecialPage { |
| 3 | +class SpecialNovaInstance extends SpecialNova { |
4 | 4 | |
5 | 5 | var $adminNova, $userNova; |
6 | 6 | var $userLDAP; |
— | — | @@ -59,31 +59,6 @@ |
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | | - function notLoggedIn() { |
64 | | - global $wgOut; |
65 | | - |
66 | | - $this->setHeaders(); |
67 | | - $wgOut->setPagetitle("Not logged in"); |
68 | | - $wgOut->addHTML('<p>You must be logged in to perform this action</p>'); |
69 | | - } |
70 | | - |
71 | | - function noCredentials() { |
72 | | - global $wgOut; |
73 | | - |
74 | | - $this->setHeaders(); |
75 | | - $wgOut->setPagetitle("No Nova credentials found for your account"); |
76 | | - $wgOut->addHTML('<p>There were no Nova credentials found for your user account. ' |
77 | | - . 'Please ask a Nova administrator to create credentials for you.</p>'); |
78 | | - } |
79 | | - |
80 | | - function notInProject() { |
81 | | - global $wgOut; |
82 | | - |
83 | | - $this->setHeaders(); |
84 | | - $wgOut->setPagetitle("Your account is not in the project requested"); |
85 | | - $wgOut->addHTML('<p>You can not complete the action requested as your user account is not in the project requested.</p>'); |
86 | | - } |
87 | | - |
88 | 63 | function createInstance() { |
89 | 64 | global $wgRequest, $wgOut; |
90 | 65 | |
Index: trunk/extensions/OpenStackManager/SpecialNovaDomain.php |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | <?php |
3 | | -class SpecialNovaDomain extends SpecialPage { |
| 3 | +class SpecialNovaDomain extends SpecialNova { |
4 | 4 | |
5 | 5 | var $userNova, $adminNova; |
6 | 6 | |
— | — | @@ -36,23 +36,6 @@ |
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | | - function notLoggedIn() { |
41 | | - global $wgOut; |
42 | | - |
43 | | - $this->setHeaders(); |
44 | | - $wgOut->setPagetitle("Not logged in"); |
45 | | - $wgOut->addHTML('<p>You must be logged in to perform this action</p>'); |
46 | | - } |
47 | | - |
48 | | - function noCredentials() { |
49 | | - global $wgOut; |
50 | | - |
51 | | - $this->setHeaders(); |
52 | | - $wgOut->setPagetitle("No Nova credentials found for your account"); |
53 | | - $wgOut->addHTML('<p>There were no Nova credentials found for your user account. ' . |
54 | | - 'Please ask a Nova administrator to create credentials for you.</p>'); |
55 | | - } |
56 | | - |
57 | 40 | function createDomain() { |
58 | 41 | global $wgRequest, $wgOut; |
59 | 42 | |
Index: trunk/extensions/OpenStackManager/SpecialNovaKey.php |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | <?php |
3 | | -class SpecialNovaKey extends SpecialPage { |
| 3 | +class SpecialNovaKey extends SpecialNova { |
4 | 4 | |
5 | 5 | var $userNova, $userLDAP; |
6 | 6 | |
— | — | @@ -34,31 +34,6 @@ |
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | | - function notLoggedIn() { |
39 | | - global $wgOut; |
40 | | - |
41 | | - $this->setHeaders(); |
42 | | - $wgOut->setPagetitle("Not logged in"); |
43 | | - $wgOut->addHTML('<p>You must be logged in to perform this action</p>'); |
44 | | - } |
45 | | - |
46 | | - function noCredentials() { |
47 | | - global $wgOut; |
48 | | - |
49 | | - $this->setHeaders(); |
50 | | - $wgOut->setPagetitle("No Nova credentials found for your account"); |
51 | | - $wgOut->addHTML('<p>There were no Nova credentials found for your user account. ' . |
52 | | - 'Please ask a Nova administrator to create credentials for you.</p>'); |
53 | | - } |
54 | | - |
55 | | - function notInProject() { |
56 | | - global $wgOut; |
57 | | - |
58 | | - $this->setHeaders(); |
59 | | - $wgOut->setPagetitle("Your account is not in the project requested"); |
60 | | - $wgOut->addHTML('<p>You can not complete the action requested as your user account is not in the project requested.</p>'); |
61 | | - } |
62 | | - |
63 | 38 | function importKey() { |
64 | 39 | global $wgRequest, $wgOut; |
65 | 40 | global $wgOpenStackManagerNovaKeypairStorage; |
Index: trunk/extensions/OpenStackManager/OpenStackManager.php |
— | — | @@ -50,6 +50,7 @@ |
51 | 51 | $wgAutoloadClasses['SpecialNovaKey'] = $dir . 'SpecialNovaKey.php'; |
52 | 52 | $wgAutoloadClasses['SpecialNovaProject'] = $dir . 'SpecialNovaProject.php'; |
53 | 53 | $wgAutoloadClasses['SpecialNovaDomain'] = $dir . 'SpecialNovaDomain.php'; |
| 54 | +$wgAutoloadClasses['SpecialNova'] = $dir . 'SpecialNova.php'; |
54 | 55 | $wgAutoloadClasses['AmazonEC2'] = $dir . 'aws-sdk/sdk.class.php'; |
55 | 56 | $wgSpecialPages['NovaInstance'] = 'SpecialNovaInstance'; |
56 | 57 | $wgSpecialPageGroups['NovaInstance'] = 'other'; |
Index: trunk/extensions/OpenStackManager/SpecialNova.php |
— | — | @@ -0,0 +1,28 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +abstract class SpecialNova extends SpecialPage { |
| 5 | + function notLoggedIn() { |
| 6 | + global $wgOut; |
| 7 | + |
| 8 | + $this->setHeaders(); |
| 9 | + $wgOut->setPagetitle("Not logged in"); |
| 10 | + $wgOut->addHTML('<p>You must be logged in to perform this action</p>'); |
| 11 | + } |
| 12 | + |
| 13 | + function noCredentials() { |
| 14 | + global $wgOut; |
| 15 | + |
| 16 | + $this->setHeaders(); |
| 17 | + $wgOut->setPagetitle("No Nova credentials found for your account"); |
| 18 | + $wgOut->addHTML('<p>There were no Nova credentials found for your user account. ' . |
| 19 | + 'Please ask a Nova administrator to create credentials for you.</p>'); |
| 20 | + } |
| 21 | + |
| 22 | + function notInProject() { |
| 23 | + global $wgOut; |
| 24 | + |
| 25 | + $this->setHeaders(); |
| 26 | + $wgOut->setPagetitle("Your account is not in the project requested"); |
| 27 | + $wgOut->addHTML('<p>You can not complete the action requested as your user account is not in the project requested.</p>'); |
| 28 | + } |
| 29 | +} |
Property changes on: trunk/extensions/OpenStackManager/SpecialNova.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 30 | + native |