Subversion Repositories oidplus

Rev

Rev 1050 | Rev 1115 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. /*
  4.  * OIDplus 2.0
  5.  * Copyright 2019 - 2023 Daniel Marschall, ViaThinkSoft
  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.  
  20. use ViaThinkSoft\OIDplus\OIDplus;
  21.  
  22. require_once __DIR__ . '/includes/oidplus.inc.php';
  23.  
  24. header('Content-Type:application/json; charset=UTF-8');
  25.  
  26. OIDplus::init(false);
  27.  
  28. # ---
  29.  
  30. $out = array();
  31.  
  32. $sysid_id = OIDplus::getSystemId(false);
  33. if (!$sysid_id) $sysid_id = 'unknown'; // do not translate
  34. $out['SystemID'] = $sysid_id;
  35.  
  36. $sysid_oid = OIDplus::getSystemId(true);
  37. if (!$sysid_oid) $sysid_oid = 'unknown'; // do not translate
  38. $out['SystemOID'] = $sysid_oid;
  39.  
  40. $sysid_guid = OIDplus::getSystemGuid();
  41. if (!$sysid_guid) $sysid_guid = 'unknown'; // do not translate
  42. $out['SystemGUID'] = $sysid_guid;
  43.  
  44. $pubKey = OIDplus::getSystemPublicKey();
  45. if (!$pubKey) $pubKey = 'unknown'; // do not translate
  46. $out['PublicKey'] = $pubKey;
  47.  
  48. $sys_url = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL);
  49. $out['SystemURL'] = $sys_url;
  50.  
  51. $sys_title = OIDplus::config()->getValue('system_title');
  52. $out['SystemTitle'] = $sys_title;
  53.  
  54. // commented out because of privacy
  55. /*
  56. $sys_ver = OIDplus::getVersion();
  57. if (!$sys_ver) $sys_ver = 'unknown'; // do not translate
  58. $out['SystemVersion'] = $sys_ver;
  59. */
  60.  
  61. // commented out because of privacy
  62. /*
  63. $sys_install_type = OIDplus::getInstallType();
  64. $out['SystemInstallType'] = $sys_install_type;
  65. */
  66.  
  67. // commented out because of privacy
  68. /*
  69. $admin_email = OIDplus::config()->getValue('admin_email');
  70. $out['AdminEMail'] = $admin_email;
  71. */
  72.  
  73. OIDplus::invoke_shutdown();
  74.  
  75. echo json_encode($out);
  76.