Rev 1115 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
472 | daniel-mar | 1 | <?php |
2 | |||
3 | /* |
||
4 | * OIDplus 2.0 |
||
1074 | daniel-mar | 5 | * Copyright 2019 - 2023 Daniel Marschall, ViaThinkSoft |
472 | daniel-mar | 6 | * |
7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
||
8 | * you may not use this file except in compliance with the License. |
||
9 | * You may obtain a copy of the License at |
||
10 | * |
||
11 | * http://www.apache.org/licenses/LICENSE-2.0 |
||
12 | * |
||
13 | * Unless required by applicable law or agreed to in writing, software |
||
14 | * distributed under the License is distributed on an "AS IS" BASIS, |
||
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||
16 | * See the License for the specific language governing permissions and |
||
17 | * limitations under the License. |
||
18 | */ |
||
19 | |||
1050 | daniel-mar | 20 | use ViaThinkSoft\OIDplus\OIDplus; |
21 | |||
472 | daniel-mar | 22 | require_once __DIR__ . '/includes/oidplus.inc.php'; |
23 | |||
24 | header('Content-Type:application/json; charset=UTF-8'); |
||
25 | |||
1115 | daniel-mar | 26 | try { |
27 | OIDplus::init(false); |
||
28 | } catch (Exception $e) { |
||
29 | OIDplus::invoke_shutdown(); |
||
30 | $out = array( |
||
31 | "error" => $e->getMessage() |
||
32 | ); |
||
33 | echo json_encode($out); |
||
34 | die(); |
||
35 | } |
||
472 | daniel-mar | 36 | |
1115 | daniel-mar | 37 | |
472 | daniel-mar | 38 | # --- |
39 | |||
40 | $out = array(); |
||
41 | |||
1074 | daniel-mar | 42 | $sysid_id = OIDplus::getSystemId(false); |
43 | if (!$sysid_id) $sysid_id = 'unknown'; // do not translate |
||
44 | $out['SystemID'] = $sysid_id; |
||
45 | |||
472 | daniel-mar | 46 | $sysid_oid = OIDplus::getSystemId(true); |
47 | if (!$sysid_oid) $sysid_oid = 'unknown'; // do not translate |
||
1074 | daniel-mar | 48 | $out['SystemOID'] = $sysid_oid; |
472 | daniel-mar | 49 | |
1074 | daniel-mar | 50 | $sysid_guid = OIDplus::getSystemGuid(); |
51 | if (!$sysid_guid) $sysid_guid = 'unknown'; // do not translate |
||
52 | $out['SystemGUID'] = $sysid_guid; |
||
53 | |||
830 | daniel-mar | 54 | $pubKey = OIDplus::getSystemPublicKey(); |
472 | daniel-mar | 55 | if (!$pubKey) $pubKey = 'unknown'; // do not translate |
56 | $out['PublicKey'] = $pubKey; |
||
57 | |||
1074 | daniel-mar | 58 | $sys_url = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL); |
472 | daniel-mar | 59 | $out['SystemURL'] = $sys_url; |
60 | |||
1074 | daniel-mar | 61 | $sys_title = OIDplus::config()->getValue('system_title'); |
62 | $out['SystemTitle'] = $sys_title; |
||
63 | |||
1201 | daniel-mar | 64 | // commented out because of security |
1074 | daniel-mar | 65 | /* |
472 | daniel-mar | 66 | $sys_ver = OIDplus::getVersion(); |
67 | if (!$sys_ver) $sys_ver = 'unknown'; // do not translate |
||
68 | $out['SystemVersion'] = $sys_ver; |
||
1074 | daniel-mar | 69 | */ |
472 | daniel-mar | 70 | |
1201 | daniel-mar | 71 | // commented out because of security |
1074 | daniel-mar | 72 | /* |
472 | daniel-mar | 73 | $sys_install_type = OIDplus::getInstallType(); |
74 | $out['SystemInstallType'] = $sys_install_type; |
||
1074 | daniel-mar | 75 | */ |
472 | daniel-mar | 76 | |
1074 | daniel-mar | 77 | // commented out because of privacy |
78 | /* |
||
472 | daniel-mar | 79 | $admin_email = OIDplus::config()->getValue('admin_email'); |
80 | $out['AdminEMail'] = $admin_email; |
||
81 | */ |
||
82 | |||
639 | daniel-mar | 83 | OIDplus::invoke_shutdown(); |
84 | |||
472 | daniel-mar | 85 | echo json_encode($out); |