Rev 1086 | Rev 1171 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1086 | Rev 1116 | ||
---|---|---|---|
Line 23... | Line 23... | ||
23 | \defined('INSIDE_OIDPLUS') or die; |
23 | \defined('INSIDE_OIDPLUS') or die; |
24 | // phpcs:enable PSR1.Files.SideEffects |
24 | // phpcs:enable PSR1.Files.SideEffects |
25 | 25 | ||
26 | class OIDplusPageAdminListRAs extends OIDplusPagePluginAdmin { |
26 | class OIDplusPageAdminListRAs extends OIDplusPagePluginAdmin { |
27 | 27 | ||
- | 28 | /** |
|
- | 29 | * @param bool $html |
|
- | 30 | * @return void |
|
- | 31 | */ |
|
28 | public function init($html=true) { |
32 | public function init(bool $html=true) { |
29 | // Nothing |
33 | // Nothing |
30 | } |
34 | } |
31 | 35 | ||
- | 36 | /** |
|
- | 37 | * @return array |
|
- | 38 | * @throws OIDplusConfigInitializationException |
|
- | 39 | * @throws OIDplusException |
|
- | 40 | */ |
|
32 | private function get_ralist() { |
41 | private function get_ralist(): array { |
33 | $tmp = array(); |
42 | $tmp = array(); |
34 | if (OIDplus::db()->getSlang()->id() == 'mysql') { |
43 | if (OIDplus::db()->getSlang()->id() == 'mysql') { |
35 | $res = OIDplus::db()->query("select distinct BINARY(email) as email from ###ra"); // "binary" because we want to ensure that 'distinct' is case sensitive |
44 | $res = OIDplus::db()->query("select distinct BINARY(email) as email from ###ra"); // "binary" because we want to ensure that 'distinct' is case sensitive |
36 | } else { |
45 | } else { |
37 | $res = OIDplus::db()->query("select distinct email as email from ###ra"); // distinct in PGSQL is always case sensitive |
46 | $res = OIDplus::db()->query("select distinct email as email from ###ra"); // distinct in PGSQL is always case sensitive |
Line 54... | Line 63... | ||
54 | ksort($tmp); |
63 | ksort($tmp); |
55 | 64 | ||
56 | return $tmp; |
65 | return $tmp; |
57 | } |
66 | } |
58 | 67 | ||
- | 68 | /** |
|
- | 69 | * @param string $id |
|
- | 70 | * @param array $out |
|
- | 71 | * @param bool $handled |
|
- | 72 | * @return void |
|
- | 73 | * @throws OIDplusConfigInitializationException |
|
- | 74 | * @throws OIDplusException |
|
- | 75 | */ |
|
59 | public function gui($id, &$out, &$handled) { |
76 | public function gui(string $id, array &$out, bool &$handled) { |
60 | if ($id === 'oidplus:list_ra') { |
77 | if ($id === 'oidplus:list_ra') { |
61 | $handled = true; |
78 | $handled = true; |
62 | $out['title'] = _L('RA Listing'); |
79 | $out['title'] = _L('RA Listing'); |
63 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
80 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
64 | 81 | ||
Line 97... | Line 114... | ||
97 | } |
114 | } |
98 | } |
115 | } |
99 | } |
116 | } |
100 | } |
117 | } |
101 | 118 | ||
- | 119 | /** |
|
- | 120 | * @param array $json |
|
- | 121 | * @param string|null $ra_email |
|
- | 122 | * @param bool $nonjs |
|
- | 123 | * @param string $req_goto |
|
- | 124 | * @return bool |
|
- | 125 | * @throws OIDplusConfigInitializationException |
|
- | 126 | * @throws OIDplusException |
|
- | 127 | */ |
|
102 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
128 | public function tree(array &$json, string $ra_email=null, bool $nonjs=false, string $req_goto=''): bool { |
103 | if (!OIDplus::authUtils()->isAdminLoggedIn()) return false; |
129 | if (!OIDplus::authUtils()->isAdminLoggedIn()) return false; |
104 | 130 | ||
105 | if (file_exists(__DIR__.'/img/main_icon16.png')) { |
131 | if (file_exists(__DIR__.'/img/main_icon16.png')) { |
106 | $tree_icon = OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon16.png'; |
132 | $tree_icon = OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon16.png'; |
107 | } else { |
133 | } else { |
Line 150... | Line 176... | ||
150 | ); |
176 | ); |
151 | 177 | ||
152 | return true; |
178 | return true; |
153 | } |
179 | } |
154 | 180 | ||
- | 181 | /** |
|
- | 182 | * @param string $request |
|
- | 183 | * @return array|false |
|
- | 184 | */ |
|
155 | public function tree_search($request) { |
185 | public function tree_search(string $request) { |
156 | // We don't need this, because the list of RAs is loaded without lazy-loading, |
186 | // We don't need this, because the list of RAs is loaded without lazy-loading, |
157 | // so the node does not need to be searched |
187 | // so the node does not need to be searched |
158 | /* |
188 | /* |
159 | if (strpos($request, 'oidplus:rainfo$') === 0) { |
189 | if (strpos($request, 'oidplus:rainfo$') === 0) { |
160 | if (OIDplus::authUtils()->isAdminLoggedIn()) { |
190 | if (OIDplus::authUtils()->isAdminLoggedIn()) { |