fluxdSettings.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. /* $Id: fluxdSettings.php 2980 2007-05-11 21:21:32Z 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.fluxdSettings.tmpl");
  24. // superadmin-links
  25. $tmpl->setvar('SuperAdminLink1', getSuperAdminLink('?f=1','<font class="adminlink">log</font></a>'));
  26. $tmpl->setvar('SuperAdminLink2', getSuperAdminLink('?f=2','<font class="adminlink">error-log</font></a>'));
  27. $tmpl->setvar('SuperAdminLink3', getSuperAdminLink('?f=3','<font class="adminlink">ps</font></a>'));
  28. $tmpl->setvar('SuperAdminLink4', getSuperAdminLink('?f=4','<font class="adminlink">status</font></a>'));
  29. $tmpl->setvar('SuperAdminLink5', getSuperAdminLink('?f=5','<font class="adminlink">check</font></a>'));
  30. $tmpl->setvar('SuperAdminLink6', getSuperAdminLink('?f=6','<font class="adminlink">db-debug</font></a>'));
  31. $tmpl->setvar('SuperAdminLink9', getSuperAdminLink('?f=9','<font class="adminlink">version</font></a>'));
  32. // message section
  33. $message = tfb_getRequestVar('m');
  34. if ($message != "")
  35. $tmpl->setvar('message', urldecode($message));
  36. // fluxd requirements checks
  37. $failed = 0;
  38. // check the needed bins
  39. // perl
  40. if (@file_exists($cfg['perlCmd']) !== true) {
  41. $failed++;
  42. $tmpl->setvar('perlMissing', 1);
  43. }
  44. // php-cli
  45. if (@file_exists($cfg['bin_php']) !== true) {
  46. $failed++;
  47. $tmpl->setvar('phpMissing', 1);
  48. }
  49. // check for sockets
  50. $loadedExtensions = get_loaded_extensions();
  51. if (!in_array("sockets", $loadedExtensions)) {
  52. $failed++;
  53. $tmpl->setvar('socketsMissing', 1);
  54. }
  55. // set supported-var
  56. $tmpl->setvar('fluxdSupported', ($failed > 0) ? 0 : 1);
  57. // fluxd core
  58. if (Fluxd::isRunning()) {
  59. $tmpl->setvar('fluxdRunning', 1);
  60. $tmpl->setvar('fluxdPid', Fluxd::getPid());
  61. } else {
  62. $tmpl->setvar('fluxdRunning', 0);
  63. }
  64. $tmpl->setvar('fluxd_dbmode', $cfg["fluxd_dbmode"]);
  65. $tmpl->setvar('fluxd_loglevel', $cfg["fluxd_loglevel"]);
  66. // Qmgr
  67. FluxdServiceMod::initializeServiceMod('Qmgr'); // would not be needed as its done in main
  68. $tmpl->setvar('fluxd_Qmgr_enabled', $cfg["fluxd_Qmgr_enabled"]);
  69. $tmpl->setvar('fluxd_Qmgr_state', FluxdQmgr::getModState());
  70. $tmpl->setvar('fluxd_Qmgr_interval', $cfg["fluxd_Qmgr_interval"]);
  71. $tmpl->setvar('fluxd_Qmgr_maxTotalTransfers', $cfg["fluxd_Qmgr_maxTotalTransfers"]);
  72. $tmpl->setvar('fluxd_Qmgr_maxUserTransfers', $cfg["fluxd_Qmgr_maxUserTransfers"]);
  73. // Watch
  74. FluxdServiceMod::initializeServiceMod('Watch');
  75. $tmpl->setvar('fluxd_Watch_enabled', $cfg["fluxd_Watch_enabled"]);
  76. $tmpl->setvar('fluxd_Watch_state', FluxdWatch::getModState());
  77. $tmpl->setvar('fluxd_Watch_interval', $cfg["fluxd_Watch_interval"]);
  78. // Rssad
  79. FluxdServiceMod::initializeServiceMod('Rssad');
  80. $tmpl->setvar('fluxd_Rssad_enabled', $cfg["fluxd_Rssad_enabled"]);
  81. $tmpl->setvar('fluxd_Rssad_state', FluxdRssad::getModState());
  82. $tmpl->setvar('fluxd_Rssad_interval', $cfg["fluxd_Rssad_interval"]);
  83. // Fluxinet
  84. FluxdServiceMod::initializeServiceMod('Fluxinet');
  85. $tmpl->setvar('fluxd_Fluxinet_enabled', $cfg["fluxd_Fluxinet_enabled"]);
  86. $tmpl->setvar('fluxd_Fluxinet_state', FluxdFluxinet::getModState());
  87. $tmpl->setvar('fluxd_Fluxinet_port', $cfg["fluxd_Fluxinet_port"]);
  88. // Maintenance
  89. FluxdServiceMod::initializeServiceMod('Maintenance');
  90. $tmpl->setvar('fluxd_Maintenance_enabled', $cfg["fluxd_Maintenance_enabled"]);
  91. $tmpl->setvar('fluxd_Maintenance_state', FluxdMaintenance::getModState());
  92. $tmpl->setvar('fluxd_Maintenance_interval', $cfg["fluxd_Maintenance_interval"]);
  93. $tmpl->setvar('fluxd_Maintenance_trestart', $cfg["fluxd_Maintenance_trestart"]);
  94. // Trigger
  95. FluxdServiceMod::initializeServiceMod('Trigger');
  96. $tmpl->setvar('fluxd_Trigger_enabled', $cfg["fluxd_Trigger_enabled"]);
  97. $tmpl->setvar('fluxd_Trigger_state', FluxdTrigger::getModState());
  98. $tmpl->setvar('fluxd_Trigger_interval', $cfg["fluxd_Trigger_interval"]);
  99. // more vars
  100. $tmpl->setvar('_USER', $cfg['_USER']);
  101. $tmpl->setvar('_FILE', $cfg['_FILE']);
  102. $tmpl->setvar('_TIMESTAMP', $cfg['_TIMESTAMP']);
  103. $tmpl->setvar('_FORCESTOP', str_replace(" ","<br>",$cfg['_FORCESTOP']));
  104. // templ-calls
  105. tmplSetTitleBar("Administration - Fluxd Settings");
  106. tmplSetAdminMenu();
  107. tmplSetFoot();
  108. tmplSetIidVars();
  109. // parse template
  110. $tmpl->pparse();
  111. ?>