config-functions.php 849 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. trait ConfigFunctions
  3. {
  4. public function getConfigItem($item)
  5. {
  6. if ($this->config[$item]) {
  7. $configItem = $this->config[$item];
  8. if ($item == 'organizrHash') {
  9. $configItem = '***Secure***';
  10. }
  11. $this->setAPIResponse('success', null, 200, $configItem);
  12. return $this->config[$item];
  13. } else {
  14. $this->setAPIResponse('error', $item . ' is not defined or is blank', 404);
  15. return false;
  16. }
  17. }
  18. public function getConfigItems()
  19. {
  20. $configItems = $this->config;
  21. /*
  22. foreach ($configItems as $configItem => $configItemValue) {
  23. // should we keep this to filter more items?
  24. if ($configItem == 'organizrHash') {
  25. $configItems[$configItem] = '***Secure***';
  26. }
  27. }
  28. */
  29. $configItems['organizrHash'] = '***Secure***';
  30. $this->setAPIResponse('success', null, 200, $configItems);
  31. return $configItems;
  32. }
  33. }