Rev 1086 | Rev 1201 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1086 | Rev 1116 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | \defined('INSIDE_OIDPLUS') or die; |
26 | \defined('INSIDE_OIDPLUS') or die; |
27 | // phpcs:enable PSR1.Files.SideEffects |
27 | // phpcs:enable PSR1.Files.SideEffects |
28 | 28 | ||
29 | class OIDplusPageAdminAutomatedAJAXCalls extends OIDplusPagePluginAdmin { |
29 | class OIDplusPageAdminAutomatedAJAXCalls extends OIDplusPagePluginAdmin { |
30 | 30 | ||
- | 31 | /** |
|
- | 32 | * @param string $actionID |
|
- | 33 | * @param array $params |
|
- | 34 | * @return int[] |
|
- | 35 | * @throws OIDplusException |
|
- | 36 | */ |
|
31 | public function action($actionID, $params) { |
37 | public function action(string $actionID, array $params): array { |
32 | if ($actionID == 'blacklistJWT') { |
38 | if ($actionID == 'blacklistJWT') { |
33 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
39 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
34 | throw new OIDplusException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin'))); |
40 | throw new OIDplusException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin'))); |
35 | } |
41 | } |
36 | 42 | ||
Line 43... | Line 49... | ||
43 | 49 | ||
44 | OIDplusAuthContentStoreJWT::jwtBlacklist($gen, $sub); |
50 | OIDplusAuthContentStoreJWT::jwtBlacklist($gen, $sub); |
45 | 51 | ||
46 | return array("status" => 0); |
52 | return array("status" => 0); |
47 | } else { |
53 | } else { |
48 | throw new OIDplusException(_L('Unknown action ID')); |
54 | return parent::action($actionID, $params); |
49 | } |
55 | } |
50 | } |
56 | } |
51 | 57 | ||
- | 58 | /** |
|
- | 59 | * @param string $id |
|
- | 60 | * @param array $out |
|
- | 61 | * @param bool $handled |
|
- | 62 | * @return void |
|
- | 63 | * @throws OIDplusException |
|
- | 64 | */ |
|
52 | public function gui($id, &$out, &$handled) { |
65 | public function gui(string $id, array &$out, bool &$handled) { |
53 | if ($id === 'oidplus:automated_ajax_information_admin') { |
66 | if ($id === 'oidplus:automated_ajax_information_admin') { |
54 | $handled = true; |
67 | $handled = true; |
55 | $out['title'] = _L('Automated AJAX calls'); |
68 | $out['title'] = _L('Automated AJAX calls'); |
56 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
69 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
57 | 70 | ||
Line 123... | Line 136... | ||
123 | $out['text'] .= '<pre id="example_vbs">'.htmlentities($cont).'</pre>'; |
136 | $out['text'] .= '<pre id="example_vbs">'.htmlentities($cont).'</pre>'; |
124 | $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(example_vbs)"></p>'; |
137 | $out['text'] .= '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(example_vbs)"></p>'; |
125 | } |
138 | } |
126 | } |
139 | } |
127 | 140 | ||
- | 141 | /** |
|
- | 142 | * @param array $json |
|
- | 143 | * @param string|null $ra_email |
|
- | 144 | * @param bool $nonjs |
|
- | 145 | * @param string $req_goto |
|
- | 146 | * @return bool |
|
- | 147 | * @throws OIDplusException |
|
- | 148 | */ |
|
128 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
149 | public function tree(array &$json, string $ra_email=null, bool $nonjs=false, string $req_goto=''): bool { |
129 | if (!OIDplus::authUtils()->isAdminLoggedIn()) return false; |
150 | if (!OIDplus::authUtils()->isAdminLoggedIn()) return false; |
130 | 151 | ||
131 | if (file_exists(__DIR__.'/img/main_icon16.png')) { |
152 | if (file_exists(__DIR__.'/img/main_icon16.png')) { |
132 | $tree_icon = OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon16.png'; |
153 | $tree_icon = OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon16.png'; |
133 | } else { |
154 | } else { |
Line 141... | Line 162... | ||
141 | ); |
162 | ); |
142 | 163 | ||
143 | return true; |
164 | return true; |
144 | } |
165 | } |
145 | 166 | ||
- | 167 | /** |
|
- | 168 | * @param string $request |
|
- | 169 | * @return array|false |
|
- | 170 | */ |
|
146 | public function tree_search($request) { |
171 | public function tree_search(string $request) { |
147 | return false; |
172 | return false; |
148 | } |
173 | } |
149 | } |
174 | } |