Projects
Kolab:Winterfell
roundcubemail
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 14
View file
roundcubemail-1.2.tar.gz/program/include/rcmail_install.php
Changed
@@ -5,7 +5,7 @@ | rcmail_install.php | | | | This file is part of the Roundcube Webmail package | - | Copyright (C) 2008-2014, The Roundcube Dev Team | + | Copyright (C) 2008-2016, The Roundcube Dev Team | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | @@ -22,770 +22,815 @@ */ class rcmail_install { - var $step; - var $is_post = false; - var $failures = 0; - var $config = array(); - var $configured = false; - var $legacy_config = false; - var $last_error = null; - var $email_pattern = '([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9])'; - var $bool_config_props = array(); - - var $local_config = array('db_dsnw', 'default_host', 'support_url', 'des_key', 'plugins'); - var $obsolete_config = array('db_backend', 'db_max_length', 'double_auth'); - var $replaced_config = array( - 'skin_path' => 'skin', - 'locale_string' => 'language', - 'multiple_identities' => 'identities_level', - 'addrbook_show_images' => 'show_images', - 'imap_root' => 'imap_ns_personal', - 'pagesize' => 'mail_pagesize', - 'top_posting' => 'reply_mode', - 'keep_alive' => 'refresh_interval', - 'min_keep_alive' => 'min_refresh_interval', - ); - - // list of supported database drivers - var $supported_dbs = array( - 'MySQL' => 'pdo_mysql', - 'PostgreSQL' => 'pdo_pgsql', - 'SQLite' => 'pdo_sqlite', - 'SQLite (v2)' => 'pdo_sqlite2', - 'SQL Server (SQLSRV)' => 'pdo_sqlsrv', - 'SQL Server (DBLIB)' => 'pdo_dblib', - 'Oracle' => 'oci8', - ); - - - /** - * Constructor - */ - function __construct() - { - $this->step = intval($_REQUEST['_step']); - $this->is_post = $_SERVER['REQUEST_METHOD'] == 'POST'; - } - - /** - * Singleton getter - */ - static function get_instance() - { - static $inst; - - if (!$inst) - $inst = new rcmail_install(); - - return $inst; - } - - /** - * Read the local config files and store properties - */ - function load_config() - { - // defaults - if ($config = $this->load_config_file(RCUBE_CONFIG_DIR . 'defaults.inc.php')) { - $this->config = (array) $config; - $this->defaults = $this->config; - } + public $step; + public $last_error; + public $is_post = false; + public $failures = 0; + public $config = array(); + public $configured = false; + public $legacy_config = false; + public $email_pattern = '([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9])'; + public $bool_config_props = array(); + + public $local_config = array('db_dsnw', 'default_host', 'support_url', 'des_key', 'plugins'); + public $obsolete_config = array('db_backend', 'db_max_length', 'double_auth'); + public $replaced_config = array( + 'skin_path' => 'skin', + 'locale_string' => 'language', + 'multiple_identities' => 'identities_level', + 'addrbook_show_images' => 'show_images', + 'imap_root' => 'imap_ns_personal', + 'pagesize' => 'mail_pagesize', + 'top_posting' => 'reply_mode', + 'keep_alive' => 'refresh_interval', + 'min_keep_alive' => 'min_refresh_interval', + ); - $config = null; + // list of supported database drivers + public $supported_dbs = array( + 'MySQL' => 'pdo_mysql', + 'PostgreSQL' => 'pdo_pgsql', + 'SQLite' => 'pdo_sqlite', + 'SQLite (v2)' => 'pdo_sqlite2', + 'SQL Server (SQLSRV)' => 'pdo_sqlsrv', + 'SQL Server (DBLIB)' => 'pdo_dblib', + 'Oracle' => 'oci8', + ); - // config - if ($config = $this->load_config_file(RCUBE_CONFIG_DIR . 'config.inc.php')) { - $this->config = array_merge($this->config, $config); - } - else { - if ($config = $this->load_config_file(RCUBE_CONFIG_DIR . 'main.inc.php')) { - $this->config = array_merge($this->config, $config); - $this->legacy_config = true; - } - if ($config = $this->load_config_file(RCUBE_CONFIG_DIR . 'db.inc.php')) { - $this->config = array_merge($this->config, $config); - $this->legacy_config = true; - } - } - $this->configured = !empty($config); - } - - /** - * Read the default config file and store properties - */ - public function load_config_file($file) - { - if (is_readable($file)) { - include $file; - - // read comments from config file - if (function_exists('token_get_all')) { - $tokens = token_get_all(file_get_contents($file)); - $in_config = false; - $buffer = ''; - for ($i=0; $i < count($tokens); $i++) { - $token = $tokens[$i]; - if ($token[0] == T_VARIABLE && $token[1] == '$config' || $token[1] == '$rcmail_config') { - $in_config = true; - if ($buffer && $tokens[$i+1] == '[' && $tokens[$i+2][0] == T_CONSTANT_ENCAPSED_STRING) { - $propname = trim($tokens[$i+2][1], "'\""); - $this->comments[$propname] = $buffer; - $buffer = ''; - $i += 3; - } - } - else if ($in_config && $token[0] == T_COMMENT) { - $buffer .= strtr($token[1], array('\n' => "\n")); - } - } - } - - // deprecated name of config variable - if (is_array($rcmail_config)) { - return $rcmail_config; - } - - return $config; - } - } - - /** - * Getter for a certain config property - * - * @param string Property name - * @param string Default value - * @return string The property value - */ - function getprop($name, $default = '') - { - $value = $this->config[$name]; - - if ($name == 'des_key' && !$this->configured && !isset($_REQUEST["_$name"])) - $value = rcube_utils::random_bytes(24); - - return $value !== null && $value !== '' ? $value : $default; - } - - - /** - * Create configuration file that contains parameters - * that differ from default values. - * - * @return string The complete config file content - */ - function create_config() - {
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.