config.php
Upload User: feiyaoda
Upload Date: 2016-11-21
Package Size: 9556k
Code Size: 3k
Category:

WEB Mail

Development Platform:

PHP

  1. <?php
  2. define('FS_FOLDER_UNREADABLE',1000);
  3. // mysql
  4. define('DB_LIST_DB_FORBIDDEN',2000);
  5. define('DB_SERVER_UNREACHABLE',2001);
  6. define('DB_NO_DB',2002);
  7. include('./functions.php');
  8. include('./extensions/phpmyexplorer.func.php');
  9. include('./extensions/international.class.php');
  10. include('./extensions/pref.class.php');
  11. /*
  12.  *  current pat version
  13.  */
  14. $PAT_VERSION = '';
  15. /*
  16.  *  creating $_INI array from config file
  17.  */
  18. $pref = new_pref('file');
  19. $_INI = $pref->INI_fetch();
  20. if ('' == $_INI['use_theme']) $_INI['use_theme'] = 'standard';
  21.     $_INT['theme_path'] = './themes/'.$_INI['use_theme'].'/';
  22. if ('' == $_INI['use_language']) $_INI['use_language'] = 'frensh';
  23.     $_INT['lang_path'] = './lang/'.$_INI['use_language'].'/';
  24. if ($_INI['verbose'] && !$config_no_output)
  25.     echo html_comment('theme : '.$_INT['theme_path'].' language : '.$_INT['lang_path']);
  26. $get_string = new intertionalize($_INT['lang_path']);
  27.  
  28. if ($_INI['use_gzip_output_compression'])
  29. {
  30.     ob_start('ob_gzhandler');
  31.     if ($_INI['verbose'] && !$config_no_output) 
  32.         echo html_comment($get_string->get('ob_gz_start'));
  33.     
  34. }
  35. else echo html_comment($get_string->get('no_output_compression'));
  36. if ($_INI['verbose'] && !$config_no_output) 
  37.     echo html_comment(sprintf($get_string->get('ini_values'),count($_INI)));
  38. /*
  39.  *  setting all functions that are disabled by system
  40.  *
  41.  */ 
  42. if ($_INI['disabled_functions'])
  43. {
  44.     $parts = explode (',',$_INI['disabled_functions']);
  45.     foreach ($parts as $id => $function_name)
  46.     {
  47.         $function_name = trim($function_name);
  48.         if ('' != $function_name) $_DISABLED_FUNCTIONS[$function_name] = true;
  49.     }
  50. }
  51. else
  52. {
  53.     // try to guess and do it alone
  54. }
  55. /*
  56.  * realpath alternative. look at functions file for more explainations
  57.  */
  58. if ($_DISABLED_FUNCTIONS['realpath'])
  59. {    
  60.     set_absolute_reference_folder(__FILE__);
  61.     if ($_INI['verbose'] && !$config_no_output)
  62.         echo html_comment(sprintf($get_string->get('use_realpath_alt'),get_absolute_reference_folder()));
  63. }
  64. // $_PHP_EXT
  65. if (function_exists('gzencode'))    $_PHP_EXT['gzip_encode'] = true;
  66. if (function_exists('gzcompress'))  $_PHP_EXT['gzip_compress'] = true;
  67. if (function_exists('gzcompress'))  $_PHP_EXT['gzip'] = true;
  68. if (function_exists('bzcompress'))  $_PHP_EXT['bzip2'] = true;
  69. if (function_exists('zip_open'))    $_PHP_EXT['zip'] = true;
  70. if (function_exists('imagecreate')) $_PHP_EXT['gd'] = true;
  71. if (function_exists('ini_get'))     $_PHP_EXT['ini_read'] = true;
  72. if (function_exists('ini_set'))     $_PHP_EXT['ini_write'] = true;
  73. /*
  74.  *  ini_set and ini_get workaround
  75.  *
  76.  *  this is to know if php ini values can be changed (if functions are disabled e.g.)
  77.  */
  78. // to know if iniget and ini set works
  79. // -2 : unknown
  80. // -1 : failed
  81. //  0 : changed result not known
  82. //  1 : ok
  83. $_INI['ini_changes'] = -2;
  84. if ($_PHP_EXT['ini_write'])
  85. {
  86.     if($_INI['overwrite_post_size'])
  87.     {
  88.         ini_set('file_uploads',true);
  89.         ini_set('upload_max_filesize',$_INI['overwrite_post_size']);
  90.         ini_set('post_max_size',$_INI['overwrite_post_size']);
  91.         $_INI['ini_changes'] = 0;
  92.     }    
  93. }
  94. // checking that it has worked
  95. if ($_PHP_EXT['ini_read'])
  96. {
  97.     if($_INI['overwrite_post_size'])
  98.     {
  99.         if (ini_get('upload_max_filesize') == $_INI['overwrite_post_size'])
  100.             $_INI['ini_changes'] = 1;
  101.         else
  102.             $_INI['ini_changes'] = -1;
  103.     }    
  104. }