index.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. if ($system->getAuthEnabled()) {
  3. if (cfr('ROOT')) {
  4. $sysConf = new YalfSysConf();
  5. show_window(__('Edit configs'), $sysConf->renderControls());
  6. //just phpinfo() callback
  7. if (ubRouting::checkGet($sysConf::ROUTE_PHPINFO)) {
  8. phpinfo();
  9. die();
  10. }
  11. //save changes if required
  12. if (ubRouting::checkPost(array($sysConf::PROUTE_FILEPATH, $sysConf::PROUTE_FILECONTENT))) {
  13. $saveResult = $sysConf->saveFile();
  14. if (empty($saveResult)) {
  15. $fileUrl = base64_encode(ubRouting::post($sysConf::PROUTE_FILEPATH));
  16. ubRouting::nav($sysConf::URL_ME . '&' . $sysConf::ROUTE_EDIT . '=' . $fileUrl);
  17. } else {
  18. show_error($saveResult);
  19. }
  20. }
  21. //render editing interface
  22. if (ubRouting::checkGet($sysConf::ROUTE_EDIT)) {
  23. $fileToEdit = base64_decode(ubRouting::get($sysConf::ROUTE_EDIT));
  24. show_window(__('Edit') . ' ' . $fileToEdit, $sysConf->renderFileEditor());
  25. }
  26. } else {
  27. show_error(__('Access denied'));
  28. }
  29. } else {
  30. show_error(__('Authorization engine disabled'));
  31. }