1
0

webappSettings.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <?php
  2. /* $Id: webappSettings.php 3087 2007-06-09 22:04:46Z danez $ */
  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. // Image class
  23. require_once('inc/classes/Image.php');
  24. // init template-instance
  25. tmplInitializeInstance($cfg["theme"], "page.admin.webappSettings.tmpl");
  26. // set vars
  27. // auth-vars
  28. $authlist = array();
  29. // Form-Auth
  30. array_push($authlist, array(
  31. 'avalue' => 0,
  32. 'atype' => "Form-Auth",
  33. 'aselected' => ($cfg["auth_type"] == 0) ? 1 : 0
  34. )
  35. );
  36. // Form-Auth + Cookie
  37. array_push($authlist, array(
  38. 'avalue' => 1,
  39. 'atype' => "Form-Auth + Cookie",
  40. 'aselected' => ($cfg["auth_type"] == 1) ? 1 : 0
  41. )
  42. );
  43. // Form-Auth + Image-Validation
  44. if (Image::isSupported()) {
  45. array_push($authlist, array(
  46. 'avalue' => 4,
  47. 'atype' => "Form-Auth + Image-Validation",
  48. 'aselected' => ($cfg["auth_type"] == 4) ? 1 : 0
  49. )
  50. );
  51. }
  52. // Basic-Auth
  53. array_push($authlist, array(
  54. 'avalue' => 2,
  55. 'atype' => "Basic-Auth",
  56. 'aselected' => ($cfg["auth_type"] == 2) ? 1 : 0
  57. )
  58. );
  59. // Basic-Passthru
  60. array_push($authlist, array(
  61. 'avalue' => 3,
  62. 'atype' => "Basic-Passthru",
  63. 'aselected' => ($cfg["auth_type"] == 3) ? 1 : 0
  64. )
  65. );
  66. $tmpl->setloop('auth_type_list', $authlist);
  67. $tmpl->setvar('auth_type', $cfg["auth_type"]);
  68. $tmpl->setvar('auth_basic_realm', $cfg["auth_basic_realm"]);
  69. // more vars
  70. $tmpl->setvar('enable_tmpl_cache', $cfg["enable_tmpl_cache"]);
  71. $link = '<img src="themes/';
  72. if ((strpos($cfg["theme"], '/')) === false)
  73. $link .= $cfg["theme"].'/images/';
  74. else
  75. $link .= 'tf_standard_themes/images/';
  76. $link .= 'arrow.gif" width="9" height="9" title="Clean Template Cache Now" border="0"> Clean Template Cache Now</a>';
  77. $tmpl->setvar('SuperAdminLink_tmplCache', getSuperAdminLink('?m=35', $link));
  78. $tmpl->setvar('enable_personal_settings', $cfg["enable_personal_settings"]);
  79. $tmpl->setvar('enable_dereferrer', $cfg["enable_dereferrer"]);
  80. $tmpl->setvar('days_to_keep', $cfg["days_to_keep"]);
  81. $tmpl->setvar('minutes_to_keep', $cfg["minutes_to_keep"]);
  82. $tmpl->setvar('rss_cache_min', $cfg["rss_cache_min"]);
  83. $tmpl->setvar('debug_sql', $cfg["debug_sql"]);
  84. $tmpl->setvar('debuglevel', $cfg["debuglevel"]);
  85. //
  86. $tmpl->setvar('drivespacebar', $cfg["drivespacebar"]);
  87. $tmpl->setvar('servermon_update', $cfg["servermon_update"]);
  88. $tmpl->setvar('transferHosts', $cfg["transferHosts"]);
  89. $tmpl->setvar('transferStatsType', $cfg["transferStatsType"]);
  90. $tmpl->setvar('transferStatsUpdate', $cfg["transferStatsUpdate"]);
  91. // themes
  92. $theme_list = array();
  93. $arThemes = GetThemes();
  94. for ($inx = 0; $inx < sizeof($arThemes); $inx++) {
  95. array_push($theme_list, array(
  96. 'arThemes' => preg_replace('/_beta$/',' (beta)',$arThemes[$inx]),
  97. 'arThemes2' => $arThemes[$inx],
  98. 'selected' => ($cfg["default_theme"] == $arThemes[$inx]) ? "selected=\"selected\"" : ""
  99. )
  100. );
  101. }
  102. $tmpl->setloop('theme_list', $theme_list);
  103. // tf standard themes
  104. $tfstandard_theme_list = array();
  105. $arThemes = GetThemesStandard();
  106. for ($inx = 0; $inx < sizeof($arThemes); $inx++) {
  107. $arThemes2[$inx] = "tf_standard_themes/".$arThemes[$inx];
  108. array_push($tfstandard_theme_list, array(
  109. 'arThemes' => $arThemes[$inx],
  110. 'arThemes2' => $arThemes2[$inx],
  111. 'selected' => ($cfg["default_theme"] == $arThemes2[$inx]) ? "selected=\"selected\"" : ""
  112. )
  113. );
  114. }
  115. $tmpl->setloop('tfstandard_theme_list', $tfstandard_theme_list);
  116. // languages
  117. $lang_list = array();
  118. $arLanguage = GetLanguages();
  119. for ($inx = 0; $inx < sizeof($arLanguage); $inx++) {
  120. array_push($lang_list, array(
  121. 'arLanguage' => $arLanguage[$inx],
  122. 'selected' => ($cfg["default_language"] == $arLanguage[$inx]) ? "selected" : "",
  123. 'GetLanguageFromFile' => GetLanguageFromFile($arLanguage[$inx])
  124. )
  125. );
  126. }
  127. $tmpl->setloop('lang_list', $lang_list);
  128. //
  129. tmplSetTitleBar("Administration - WebApp Settings");
  130. tmplSetAdminMenu();
  131. tmplSetFoot();
  132. tmplSetIidVars();
  133. // parse template
  134. $tmpl->pparse();
  135. ?>