Rev 1005 | Rev 1200 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1005 | Rev 1050 | ||
---|---|---|---|
1 | <?php |
1 | <?php |
2 | 2 | ||
3 | /* |
3 | /* |
4 | * OIDplus 2.0 RDAP |
4 | * OIDplus 2.0 RDAP |
5 | * Copyright 2019 - 2022 Daniel Marschall, ViaThinkSoft |
5 | * Copyright 2019 - 2022 Daniel Marschall, ViaThinkSoft |
6 | * Authors Daniel Marschall, ViaThinkSoft |
6 | * Authors Daniel Marschall, ViaThinkSoft |
7 | * Till Wehowski, Frdlweb |
7 | * Till Wehowski, Frdlweb |
8 | * |
8 | * |
9 | * Licensed under the Apache License, Version 2.0 (the "License"); |
9 | * Licensed under the Apache License, Version 2.0 (the "License"); |
10 | * you may not use this file except in compliance with the License. |
10 | * you may not use this file except in compliance with the License. |
11 | * You may obtain a copy of the License at |
11 | * You may obtain a copy of the License at |
12 | * |
12 | * |
13 | * http://www.apache.org/licenses/LICENSE-2.0 |
13 | * http://www.apache.org/licenses/LICENSE-2.0 |
14 | * |
14 | * |
15 | * Unless required by applicable law or agreed to in writing, software |
15 | * Unless required by applicable law or agreed to in writing, software |
16 | * distributed under the License is distributed on an "AS IS" BASIS, |
16 | * distributed under the License is distributed on an "AS IS" BASIS, |
17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
18 | * See the License for the specific language governing permissions and |
18 | * See the License for the specific language governing permissions and |
19 | * limitations under the License. |
19 | * limitations under the License. |
20 | */ |
20 | */ |
21 | 21 | ||
- | 22 | use ViaThinkSoft\OIDplus\OIDplus; |
|
- | 23 | use ViaThinkSoft\OIDplus\OIDplusGui; |
|
22 | require_once __DIR__ . '/../../../../../includes/oidplus.inc.php'; |
24 | use ViaThinkSoft\OIDplus\OIDplusException; |
23 | - | ||
- | 25 | use Frdlweb\OIDplus\OIDplusRDAP; |
|
24 | 26 | ||
- | 27 | require_once __DIR__ . '/../../../../../includes/oidplus.inc.php'; |
|
25 | 28 | ||
26 | OIDplus::init(true); |
29 | OIDplus::init(true); |
27 | set_exception_handler(array('OIDplusGui', 'html_exception_handler')); |
30 | set_exception_handler(array(OIDplusGui::class, 'html_exception_handler')); |
28 | 31 | ||
29 | if (OIDplus::baseConfig()->getValue('DISABLE_PLUGIN_OIDplusPagePublicRdap', false)) { |
32 | if (OIDplus::baseConfig()->getValue('DISABLE_PLUGIN_Frdlweb\OIDplus\OIDplusPagePublicRdap', false)) { |
30 | throw new OIDplusException(_L('This plugin was disabled by the system administrator!')); |
33 | throw new OIDplusException(_L('This plugin was disabled by the system administrator!')); |
31 | } |
34 | } |
32 | 35 | ||
33 | originHeaders(); |
36 | originHeaders(); |
34 | 37 | ||
35 | if (\PHP_SAPI == 'cli') { |
38 | if (\PHP_SAPI == 'cli') { |
36 | if ($_SERVER['argc'] != 2) { |
39 | if ($_SERVER['argc'] != 2) { |
37 | echo _L('Syntax').': '.$_SERVER['argv'][0].' <query>'."\n"; |
40 | echo _L('Syntax').': '.$_SERVER['argv'][0].' <query>'."\n"; |
38 | exit(2); |
41 | exit(2); |
39 | } |
42 | } |
40 | $query = $_SERVER['argv'][1]; |
43 | $query = $_SERVER['argv'][1]; |
41 | } else { |
44 | } else { |
42 | if (!isset($_REQUEST['query'])) { |
45 | if (!isset($_REQUEST['query'])) { |
43 | http_response_code(400); |
46 | http_response_code(400); |
44 | die('<h1>'._L('Error').'</h1><p>'._L('Argument "%1" is missing','query').'<p>'); |
47 | die('<h1>'._L('Error').'</h1><p>'._L('Argument "%1" is missing','query').'<p>'); |
45 | } |
48 | } |
46 | $query = $_REQUEST['query']; |
49 | $query = $_REQUEST['query']; |
47 | } |
50 | } |
48 | 51 | ||
49 | $x = new OIDplusRDAP(); |
52 | $x = new OIDplusRDAP(); |
50 | list($out_content, $out_type) = $x->rdapQuery($query); |
53 | list($out_content, $out_type) = $x->rdapQuery($query); |
51 | 54 | ||
52 | OIDplus::invoke_shutdown(); |
55 | OIDplus::invoke_shutdown(); |
53 | 56 | ||
54 | if ($out_type) header('Content-Type:'.$out_type); |
57 | if ($out_type) header('Content-Type:'.$out_type); |
55 | echo $out_content; |
58 | echo $out_content; |
56 | 59 |