Ticket #1485215: roundcube-config-dir3.diff

File roundcube-config-dir3.diff, 4.2 KB (added by schmonz, 2 years ago)

updated patch for 0.2-alpha

  • installer/config.php

    old new  
    2323if (!empty($_POST['submit'])) { 
    2424   
    2525  echo '<p class="notice">Copy the following configurations and save them in two files (names above the text box)'; 
    26   echo ' within the <tt>config/</tt> directory of your RoundCube installation.<br/>'; 
     26  echo ' within the <tt>'.RCMAIL_CONFIG_DIR.'/</tt> directory of your RoundCube installation.<br/>'; 
    2727  echo ' Make sure that there are no characters outside the <tt>&lt;?php ?&gt;</tt> brackets when saving the files.</p>'; 
    2828   
    2929  $textbox = new html_textarea(array('rows' => 16, 'cols' => 60, 'class' => "configfile")); 
  • installer/index.php

    old new  
    5959  if ($RCI->configured && !$RCI->getprop('enable_installer') && !$_SESSION['allowinstaller']) { 
    6060    // header("HTTP/1.0 404 Not Found"); 
    6161    echo '<h2 class="error">The installer is disabled!</h2>'; 
    62     echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in config/main.inc.php</p>'; 
     62    echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in '.RCMAIL_CONFIG_DIR.'/main.inc.php</p>'; 
    6363    echo '</div></body></html>'; 
    6464    exit; 
    6565  } 
  • installer/rcube_install.php

    old new  
    7979   */ 
    8080  function _load_config($suffix) 
    8181  { 
    82     @include '../config/main.inc' . $suffix; 
     82    @include RCMAIL_CONFIG_DIR . '/main.inc' . $suffix; 
    8383    if (is_array($rcmail_config)) { 
    8484      $this->config += $rcmail_config; 
    8585    } 
    8686       
    87     @include '../config/db.inc'. $suffix; 
     87    @include RCMAIL_CONFIG_DIR . '/db.inc'. $suffix; 
    8888    if (is_array($rcmail_config)) { 
    8989      $this->config += $rcmail_config; 
    9090    } 
  • installer/test.php

    old new  
    33<h3>Check config files</h3> 
    44<?php 
    55 
    6 $read_main = is_readable(INSTALL_PATH.'config/main.inc.php'); 
    7 $read_db = is_readable(INSTALL_PATH.'config/db.inc.php'); 
     6$read_main = is_readable(RCMAIL_CONFIG_DIR.'/main.inc.php'); 
     7$read_db = is_readable(RCMAIL_CONFIG_DIR.'/db.inc.php'); 
    88 
    99if ($read_main && !empty($RCI->config)) { 
    1010  $RCI->pass('main.inc.php'); 
  • program/include/iniset.php

    old new  
    3030  define('INSTALL_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/'); 
    3131} 
    3232 
     33// define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config'); 
     34define('RCMAIL_CONFIG_DIR', '@PKG_SYSCONFDIR@'); 
     35 
    3336// make sure path_separator is defined 
    3437if (!defined('PATH_SEPARATOR')) { 
    3538  define('PATH_SEPARATOR', (eregi('win', PHP_OS) ? ';' : ':')); 
  • program/include/rcmail.php

    old new  
    410410      raise_error(array( 
    411411        'code' => 600, 
    412412        'type' => 'php', 
    413         'file' => "config/main.inc.php", 
     413        'file' => RCMAIL_CONFIG_DIR."/main.inc.php", 
    414414        'message' => "Acces denied for new user $username. 'auto_create_user' is disabled" 
    415415        ), true, false); 
    416416    } 
  • program/include/rcube_config.php

    old new  
    5050    ob_start(); 
    5151     
    5252    // load main config file 
    53     include_once(INSTALL_PATH . 'config/main.inc.php'); 
     53    include_once(RCMAIL_CONFIG_DIR . '/main.inc.php'); 
    5454    $this->prop = (array)$rcmail_config; 
    5555 
    5656    // load database config 
    57     include_once(INSTALL_PATH . 'config/db.inc.php'); 
     57    include_once(RCMAIL_CONFIG_DIR . '/db.inc.php'); 
    5858    $this->prop += (array)$rcmail_config; 
    5959     
    6060    // load host-specific configuration 
     
    103103      $fname = preg_replace('/[^a-z0-9\.\-_]/i', '', $_SERVER['HTTP_HOST']) . '.inc.php'; 
    104104    } 
    105105 
    106     if ($fname && is_file(INSTALL_PATH . 'config/' . $fname)) { 
    107       include(INSTALL_PATH . 'config/' . $fname); 
     106    if ($fname && is_file(RCMAIL_CONFIG_DIR . '/' . $fname)) { 
     107      include(RCMAIL_CONFIG_DIR . '/' . $fname); 
    108108      $this->prop = array_merge($this->prop, (array)$rcmail_config); 
    109109    } 
    110110  }