1
0

serverSettings.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. /* $Id: serverSettings.php 3206 2007-08-29 20:32:44Z warion $ */
  3. /*******************************************************************************
  4. LICENSE
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License (GPL)
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. To read the license please visit http://www.gnu.org/copyleft/gpl.html
  14. *******************************************************************************/
  15. // prevent direct invocation
  16. if ((!isset($cfg['user'])) || (isset($_REQUEST['cfg']))) {
  17. @ob_end_clean();
  18. @header("location: ../../../index.php");
  19. exit();
  20. }
  21. /******************************************************************************/
  22. // init template-instance
  23. tmplInitializeInstance($cfg["theme"], "page.admin.serverSettings.tmpl");
  24. // set vars
  25. // path
  26. $tmpl->setvar('path', $cfg["path"]);
  27. if (is_dir($cfg["path"])) {
  28. $tmpl->setvar('is_path', 1);
  29. $tmpl->setvar('is_writable', (is_writable($cfg["path"])) ? 1 : 0);
  30. } else {
  31. $tmpl->setvar('is_path', 0);
  32. }
  33. // docroot
  34. $tmpl->setvar('docroot', $cfg["docroot"]);
  35. $tmpl->setvar('is_docroot', (is_file($cfg["docroot"]."version.php")) ? 1 : 0);
  36. // homedirs + incoming
  37. $tmpl->setvar('enable_home_dirs', $cfg["enable_home_dirs"]);
  38. $tmpl->setvar('path_incoming', $cfg["path_incoming"]);
  39. $tmpl->setvar('path_incoming_ok', (checkDirectory($cfg["path"].$cfg["path_incoming"], 0777)) ? 1 : 0);
  40. // bins
  41. $tmpl->setvar('btclient_transmission_bin', $cfg["btclient_transmission_bin"]);
  42. $tmpl->setvar('validate_transmission_bin', validateTransmissionCli($cfg["btclient_transmission_bin"]));
  43. $tmpl->setvar('perlCmd', $cfg["perlCmd"]);
  44. $tmpl->setvar('validate_perl', validateBinary($cfg["perlCmd"]));
  45. $tmpl->setvar('bin_grep', $cfg["bin_grep"]);
  46. $tmpl->setvar('validate_grep', validateBinary($cfg["bin_grep"]));
  47. $tmpl->setvar('bin_php', $cfg["bin_php"]);
  48. $tmpl->setvar('validate_php', validatePhpCli($cfg["bin_php"]));
  49. $tmpl->setvar('pythonCmd', $cfg["pythonCmd"]);
  50. $tmpl->setvar('validate_python', validateBinary($cfg["pythonCmd"]));
  51. $tmpl->setvar('bin_awk', $cfg["bin_awk"]);
  52. $tmpl->setvar('validate_awk', validateBinary($cfg["bin_awk"]));
  53. $tmpl->setvar('bin_du', $cfg["bin_du"]);
  54. $tmpl->setvar('validate_du', validateBinary($cfg["bin_du"]));
  55. $tmpl->setvar('bin_wget', $cfg["bin_wget"]);
  56. $tmpl->setvar('validate_wget', validateBinary($cfg["bin_wget"]));
  57. $tmpl->setvar('bin_uudeview', $cfg["bin_uudeview"]);
  58. $tmpl->setvar('validate_uudeview', validateBinary($cfg["bin_uudeview"]));
  59. $tmpl->setvar('bin_unzip', $cfg["bin_unzip"]);
  60. $tmpl->setvar('validate_unzip', validateBinary($cfg["bin_unzip"]));
  61. $tmpl->setvar('bin_cksfv', $cfg["bin_cksfv"]);
  62. $tmpl->setvar('validate_cksfv', validateBinary($cfg["bin_cksfv"]));
  63. $tmpl->setvar('bin_vlc', $cfg["bin_vlc"]);
  64. $tmpl->setvar('validate_vlc', validateBinary($cfg["bin_vlc"]));
  65. $tmpl->setvar('php_uname1', php_uname('s'));
  66. $tmpl->setvar('php_uname2', php_uname('r'));
  67. $tmpl->setvar('bin_unrar', $cfg["bin_unrar"]);
  68. $tmpl->setvar('validate_unrar', validateBinary($cfg["bin_unrar"]));
  69. switch ($cfg["_OS"]) {
  70. case 1:
  71. $tmpl->setvar('loadavg_path', $cfg["loadavg_path"]);
  72. $tmpl->setvar('validate_loadavg', validateFile($cfg["loadavg_path"]));
  73. $tmpl->setvar('bin_netstat', $cfg["bin_netstat"]);
  74. $tmpl->setvar('validate_netstat', validateBinary($cfg["bin_netstat"]));
  75. break;
  76. case 2:
  77. $tmpl->setvar('bin_sockstat', $cfg["bin_sockstat"]);
  78. $tmpl->setvar('validate_sockstat', validateBinary($cfg["bin_sockstat"]));
  79. break;
  80. }
  81. //
  82. $tmpl->setvar('_OS', $cfg["_OS"]);
  83. //
  84. tmplSetTitleBar("Administration - Server Settings");
  85. tmplSetAdminMenu();
  86. tmplSetFoot();
  87. tmplSetIidVars();
  88. // parse template
  89. $tmpl->pparse();
  90. ?>