thomascube
2008-06-07 235086c7dec474eea538822386c093cf9e1fb93e
program/include/rcube_config.php
@@ -40,6 +40,8 @@
  /**
   * Load config from local config file
   *
   * @todo Remove global $CONFIG
   */
  private function load()
  {
@@ -54,6 +56,9 @@
    // load database config
    include_once(INSTALL_PATH . 'config/db.inc.php');
    $this->prop += (array)$rcmail_config;
    // load host-specific configuration
    $this->load_host_config();
    // fix paths
    $this->prop['skin_path'] = $this->prop['skin_path'] ? unslashify($this->prop['skin_path']) : 'skins/default';
@@ -77,6 +82,9 @@
    
    // clear output buffer
    ob_end_clean();
    // export config data
    $GLOBALS['CONFIG'] = &$this->prop;
  }
  
  
@@ -148,5 +156,26 @@
    return $this->prop;
  }
  
  /**
   * Return a 24 byte key for the DES encryption
   *
   * @return string DES encryption key
   */
  public function get_des_key()
  {
    $key = !empty($this->prop['des_key']) ? $this->prop['des_key'] : 'rcmail?24BitPwDkeyF**ECB';
    $len = strlen($key);
    // make sure the key is exactly 24 chars long
    if ($len<24)
      $key .= str_repeat('_', 24-$len);
    else if ($len>24)
      substr($key, 0, 24);
    return $key;
  }
}