| | |
| | | |
| | | /** |
| | | * Load config from local config file |
| | | * |
| | | * @todo Remove global $CONFIG |
| | | */ |
| | | private function load() |
| | | { |
| | |
| | | // 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'; |
| | |
| | | |
| | | // clear output buffer |
| | | ob_end_clean(); |
| | | |
| | | // export config data |
| | | $GLOBALS['CONFIG'] = &$this->prop; |
| | | } |
| | | |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | } |
| | | |