Changeset 9606ffb in github


Ignore:
Timestamp:
Jun 25, 2006 5:18:00 AM (7 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
fb5f4f3
Parents:
cbdd6dc
Message:

Changed behavior to include host-specific configuration (Bug #1483849)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • config/main.inc.php.dist

    r1966c53 r9606ffb  
    174174 */ 
    175175 
     176// try to load host-specific configuration 
     177$rcmail_config['include_host_config'] = FALSE; 
     178 
    176179 
    177180/***** these settings can be overwritten by user's preferences *****/ 
     
    201204$rcmail_config['javascript_config'] = array('read_when_deleted', 'flag_for_deletion'); 
    202205 
    203 /***** try to load host-specific configuration *****/ 
    204  
    205 @include($_SERVER['HTTP_HOST'].'.inc.php'); 
    206  
    207206 
    208207// end of config file 
  • program/include/main.inc

    rd2a9dbb r9606ffb  
    4343  include_once('config/main.inc.php'); 
    4444  $CONFIG = is_array($rcmail_config) ? $rcmail_config : array(); 
     45   
     46  // load host-specific configuration 
     47  rcmail_load_host_config(&$CONFIG); 
     48   
    4549  $CONFIG['skin_path'] = $CONFIG['skin_path'] ? preg_replace('/\/$/', '', $CONFIG['skin_path']) : 'skins/default'; 
    4650 
     
    126130 
    127131  register_shutdown_function('rcmail_shutdown'); 
     132  } 
     133 
     134 
     135// load a host-specific config file if configured 
     136function rcmail_load_host_config(&$config) 
     137  { 
     138  $fname = NULL; 
     139   
     140  if (is_array($config['include_host_config'])) 
     141    $fname = $config['include_host_config'][$_SERVER['HTTP_HOST']]; 
     142  else if (!empty($config['include_host_config'])) 
     143    $fname = preg_replace('/[^a-z0-9\.\-_]/i', '', $_SERVER['HTTP_HOST']) . '.inc.php'; 
     144 
     145   if ($fname && is_file('config/'.$fname)) 
     146     { 
     147     include('config/'.$fname); 
     148     $config = array_merge($config, $rcmail_config); 
     149     } 
    128150  } 
    129151   
Note: See TracChangeset for help on using the changeset viewer.