/jibas/infoguru/include/config.php

https://github.com/wildanm/Jibas · PHP · 112 lines · 69 code · 11 blank · 32 comment · 2 complexity · 0f0e835ccb432b44413a835241c0cc08 MD5 · raw file

  1. <?
  2. /**[N]**
  3. * JIBAS Education Community
  4. * Jaringan Informasi Bersama Antar Sekolah
  5. *
  6. * @version: 18.0 (August 01, 2019)
  7. * @notes: JIBAS Education Community will be managed by Yayasan Indonesia Membaca (http://www.indonesiamembaca.net)
  8. *
  9. * Copyright (C) 2009 Yayasan Indonesia Membaca (http://www.indonesiamembaca.net)
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation, either version 3 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. **[N]**/ ?>
  23. <?
  24. // ------------------------------------------------------------
  25. // PATCH MANAGEMENT FRAMEWORK
  26. // ------------------------------------------------------------
  27. if (file_exists('../include/global.patch.manager.php'))
  28. {
  29. require_once('../include/global.patch.manager.php');
  30. ApplyGlobalPatch("..");
  31. }
  32. elseif (file_exists('../../include/global.patch.manager.php'))
  33. {
  34. require_once('../../include/global.patch.manager.php');
  35. ApplyGlobalPatch("../..");
  36. }
  37. elseif (file_exists('../../../include/global.patch.manager.php'))
  38. {
  39. require_once('../../../include/global.patch.manager.php');
  40. ApplyGlobalPatch("../../..");
  41. }
  42. require_once('module.patch.manager.php');
  43. ApplyModulePatch();
  44. // ------------------------------------------------------------
  45. // MAIN CONFIGURATION
  46. // ------------------------------------------------------------
  47. if (file_exists('../include/mainconfig.php'))
  48. {
  49. require_once('../include/mainconfig.php');
  50. }
  51. elseif (file_exists('../../include/mainconfig.php'))
  52. {
  53. require_once('../../include/mainconfig.php');
  54. }
  55. elseif (file_exists('../../../include/mainconfig.php'))
  56. {
  57. require_once('../../../include/mainconfig.php');
  58. }
  59. // ------------------------------------------------------------
  60. // DEFAULT CONSTANTS
  61. // ------------------------------------------------------------
  62. $db_name = "jbsakad";
  63. $G_WEB_ADDR = "http://$G_SERVER_ADDR/infoguru/";
  64. $VAR_CATATAN_SISWA = 3 ;
  65. $VAR_BERITA_SISWA = 3 ;
  66. $VAR_BERITA_GURU = 3 ;
  67. $G_ENABLE_QUERY_ERROR_LOG = false;
  68. $full_url = "http://$G_SERVER_ADDR/infoguru/";
  69. // ------------------------------------------------------------
  70. // FORMAT SPECIAL CHARACTERS WITHIN ALL REQUEST
  71. // ------------------------------------------------------------
  72. function FmtReq_FormatValue($value)
  73. {
  74. $value = str_replace("'", "`", $value); //&#39;
  75. $value = str_replace('"', "`", $value); //&#34;
  76. //$value = str_replace("<", "&lt;", $value);
  77. //$value = str_replace(">", "&gt;", $value);
  78. $value = addslashes($value);
  79. return $value;
  80. }
  81. function FmtReq_TraverseRequestArray(&$arr)
  82. {
  83. foreach($arr as $key => $value)
  84. {
  85. if (is_array($arr[$key]))
  86. FmtReq_TraverseRequestArray($arr[$key]);
  87. else
  88. $arr[$key] = FmtReq_FormatValue($value);
  89. }
  90. }
  91. foreach($_REQUEST as $key => $value)
  92. {
  93. if (is_array($_REQUEST[$key]))
  94. FmtReq_TraverseRequestArray($_REQUEST[$key]);
  95. else
  96. $_REQUEST[$key] = FmtReq_FormatValue($value);
  97. }
  98. ?>