diff --git a/.gitignore b/.gitignore index 2917e66cb..1ab6c7b20 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ .DS_Store Thumbs.db -config.user.inc.php +/config/config.user.inc.php +/config/install.config.php /files/ /build/ /libs/ diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 67d3817d3..b11f9f593 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -487,11 +487,14 @@ class Context * * @return void */ - public static function loadDBInfo() + public static function loadDBInfo($config = null) { // Load new configuration format. - $config = Rhymix\Framework\Config::init(); - if(!count($config)) + if ($config === null) + { + $config = Rhymix\Framework\Config::init(); + } + if (!count($config)) { return; } @@ -620,9 +623,16 @@ class Context { $supported = Rhymix\Framework\Lang::getSupportedList(); $selected = Rhymix\Framework\Config::get('locale.enabled_lang'); - foreach ($selected as $lang) + if ($selected) { - $lang_selected[$lang] = $supported[$lang]; + foreach ($selected as $lang) + { + $lang_selected[$lang] = $supported[$lang]; + } + } + else + { + $lang_selected = $supported; } } return $lang_selected; diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 9e3c7807c..dfff58125 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -132,14 +132,21 @@ class ModuleHandler extends Handler { continue; } - + $urlInfo = parse_url($url); $host = $urlInfo['host']; - - $dbInfo = Context::getDBInfo(); - $defaultUrlInfo = parse_url($dbInfo->default_url); - $defaultHost = $defaultUrlInfo['host']; - + + $defaultUrl = Context::getDBInfo()->default_url; + if($defaultUrl) + { + $defaultUrlInfo = parse_url($defaultUrl); + $defaultHost = $defaultUrlInfo['host']; + } + else + { + $defaultHost = $_SERVER['HTTP_HOST']; + } + if($host && ($host != $defaultHost && $host != $site_module_info->domain)) { throw new Exception('msg_default_url_is_null'); diff --git a/common/framework/config.php b/common/framework/config.php index 227b4a055..414545d10 100644 --- a/common/framework/config.php +++ b/common/framework/config.php @@ -43,6 +43,16 @@ class Config return self::$_config; } + /** + * Get default system configuration. + * + * @return array + */ + public static function getDefaults() + { + return (include RX_BASEDIR . 'common/defaults/config.php'); + } + /** * Get a system configuration value. * @@ -332,15 +342,13 @@ class Config /** * Save the current system configuration. * + * @param array $config (optional) * @return bool */ - public static function save() + public static function save($config = null) { - if (!count(self::$_config)) - { - self::init(); - } - $buff = ' - + diff --git a/modules/install/conf/module.xml b/modules/install/conf/module.xml index d99d2cf41..786106893 100644 --- a/modules/install/conf/module.xml +++ b/modules/install/conf/module.xml @@ -3,15 +3,13 @@ - - + - - - - + + + - + diff --git a/modules/install/install.controller.php b/modules/install/install.controller.php index 771ce9dab..7ddfa5e92 100644 --- a/modules/install/install.controller.php +++ b/modules/install/install.controller.php @@ -7,8 +7,6 @@ */ class installController extends install { - var $db_tmp_config_file = ''; - var $etc_tmp_config_file = ''; var $flagLicenseAgreement = './files/env/license_agreement'; /** @@ -16,12 +14,12 @@ class installController extends install */ function init() { - // Error occurs if already installed - if(Context::isInstalled()) + // Stop if already installed. + if (Context::isInstalled()) { return new Object(-1, 'msg_already_installed'); } - + $this->db_tmp_config_file = _XE_PATH_.'files/config/tmpDB.config.php'; $this->etc_tmp_config_file = _XE_PATH_.'files/config/tmpEtc.config.php'; } @@ -29,30 +27,37 @@ class installController extends install /** * @brief division install step... DB Config temp file create */ - function procDBSetting() + function procDBConfig() { - // Get DB-related variables - $con_string = Context::gets('db_type','db_port','db_hostname','db_userid','db_password','db_database','db_table_prefix'); - $con_string->db_table_prefix = rtrim($con_string->db_table_prefix, '_'); - + // Get DB config variables. + $config = Context::gets('db_type', 'db_host', 'db_port', 'db_user', 'db_pass', 'db_database', 'db_prefix'); + + // Create a temporary setting object. $db_info = new stdClass(); - $db_info->master_db = get_object_vars($con_string); + $db_info->master_db = array(); + $db_info->master_db['db_type'] = $config->db_type; + $db_info->master_db['db_hostname'] = $config->db_host; + $db_info->master_db['db_port'] = $config->db_port; + $db_info->master_db['db_userid'] = $config->db_user; + $db_info->master_db['db_password'] = $config->db_pass; + $db_info->master_db['db_database'] = $config->db_database; + $db_info->master_db['db_table_prefix'] = $config->db_prefix; $db_info->slave_db = array($db_info->master_db); $db_info->default_url = Context::getRequestUri(); $db_info->lang_type = Context::getLangType(); $db_info->use_mobile_view = 'Y'; - - // Set DB type and information Context::setDBInfo($db_info); - - // Check if available to connect to the DB - $oDB = &DB::getInstance(); + + // Check connection to the DB. + $oDB = DB::getInstance(); $output = $oDB->getError(); - if(!$output->toBool()) return $output; - if(!$oDB->isConnected()) return $oDB->getError(); - - // Check if MySQL server supports InnoDB - if(stripos($con_string->db_type, 'innodb') !== false) + if (!$output->toBool() || !$oDB->isConnected()) + { + return $output; + } + + // Check if MySQL server supports InnoDB. + if(stripos($config->db_type, 'innodb') !== false) { $innodb_supported = false; $show_engines = $oDB->_fetch($oDB->_query('SHOW ENGINES')); @@ -63,100 +68,144 @@ class installController extends install $innodb_supported = true; } } - - // If server does not support InnoDB, fall back to default storage engine (usually MyISAM) + + // If server does not support InnoDB, fall back to default storage engine (usually MyISAM). if(!$innodb_supported) { - $con_string->db_type = str_ireplace('_innodb', '', $con_string->db_type); - $db_info->master_db['db_type'] = $con_string->db_type; - $db_info->slave_db[0]['db_type'] = $con_string->db_type; - Context::set('db_type', $con_string->db_type); - Context::setDBInfo($db_info); + $config->db_type = str_ireplace('_innodb', '', $config->db_type); } } - - // Create a db temp config file - if(!$this->makeDBConfigFile()) return new Object(-1, 'msg_install_failed'); - - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) + + // Check if MySQL server supports utf8mb4. + if(stripos($config->db_type, 'mysql') !== false) { - $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'act', 'dispInstallManagerForm'); - header('location:'.$returnUrl); - return; + $oDB->charset = $oDB->getBestSupportedCharset(); + $config->db_charset = $oDB->charset; + } + + // Save DB config in session. + $_SESSION['db_config'] = $config; + + // Continue the installation. + if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON'))) + { + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'act', 'dispInstallOtherConfig'); + $this->setRedirectUrl($returnUrl); } } /** * @brief Install with received information */ - function procInstall() + function procInstall($install_config = null) { // Check if it is already installed - if(Context::isInstalled()) + if (Context::isInstalled()) { return new Object(-1, 'msg_already_installed'); } - - // Save rewrite and time zone settings - if(!Context::get('install_config')) + + // Get install parameters. + $config = Rhymix\Framework\Config::getDefaults(); + if ($install_config) { - $config_info = Context::gets('use_rewrite','time_zone', 'use_ssl'); - if($config_info->use_rewrite!='Y') $config_info->use_rewrite = 'N'; - if(!$this->makeEtcConfigFile($config_info)) - { - return new Object(-1, 'msg_install_failed'); - } + $install_config = (array)$install_config; + $config['db']['master']['type'] = str_replace('_innodb', '', $install_config['db_type']); + $config['db']['master']['host'] = $install_config['db_hostname']; + $config['db']['master']['port'] = $install_config['db_port']; + $config['db']['master']['user'] = $install_config['db_userid']; + $config['db']['master']['pass'] = $install_config['db_password']; + $config['db']['master']['database'] = $install_config['db_database']; + $config['db']['master']['prefix'] = $install_config['db_table_prefix']; + $config['db']['master']['charset'] = $install_config['db_charset']; + $config['db']['master']['engine'] = strpos($install_config['db_type'], 'innodb') !== false ? 'innodb' : (strpos($install_config['db_type'], 'mysql') !== false ? 'myisam' : null); + $config['use_rewrite'] = $install_config['use_rewrite'] === 'Y' ? true : false; + $config['url']['ssl'] = $install_config['use_ssl'] ?: 'none'; + $time_zone = $install_config['time_zone']; + $user_info = new stdClass; + $user_info->email_address = $install_config['email_address']; + $user_info->password = $install_config['password']; + $user_info->nick_name = $install_config['nick_name']; + $user_info->user_id = $install_config['user_id']; } - - // Assign a temporary administrator when installing - $logged_info = new stdClass(); - $logged_info->is_admin = 'Y'; - Context::set('logged_info', $logged_info); - - // check install config - if(Context::get('install_config')) - { - $db_info = $this->_makeDbInfoByInstallConfig(); - } - // install by default XE UI else { - if(FileHandler::exists($this->db_tmp_config_file)) include $this->db_tmp_config_file; - if(FileHandler::exists($this->etc_tmp_config_file)) include $this->etc_tmp_config_file; + $config['db']['master']['type'] = str_replace('_innodb', '', $_SESSION['db_config']->db_type); + $config['db']['master']['host'] = $_SESSION['db_config']->db_host; + $config['db']['master']['port'] = $_SESSION['db_config']->db_port; + $config['db']['master']['user'] = $_SESSION['db_config']->db_user; + $config['db']['master']['pass'] = $_SESSION['db_config']->db_pass; + $config['db']['master']['database'] = $_SESSION['db_config']->db_database; + $config['db']['master']['prefix'] = $_SESSION['db_config']->db_prefix; + $config['db']['master']['charset'] = $_SESSION['db_config']->db_charset; + $config['db']['master']['engine'] = strpos($_SESSION['db_config']->db_type, 'innodb') !== false ? 'innodb' : (strpos($_SESSION['db_config']->db_type, 'mysql') !== false ? 'myisam' : null); + $config['use_rewrite'] = $_SESSION['use_rewrite'] === 'Y' ? true : false; + $config['url']['ssl'] = Context::get('use_ssl') ?: 'none'; + $time_zone = Context::get('time_zone'); + $user_info = Context::gets('email_address', 'password', 'nick_name', 'user_id'); } - - // Set DB type and information - Context::setDBInfo($db_info); - // Create DB Instance - $oDB = &DB::getInstance(); - // Check if available to connect to the DB - if(!$oDB->isConnected()) return $oDB->getError(); - - // Check DB charset if using MySQL - if(stripos($db_info->master_db['db_type'], 'mysql') !== false && !isset($db_info->master_db['db_charset'])) + + // Fix the database table prefix. + $config['db']['master']['prefix'] = rtrim($config['db']['master']['prefix'], '_'); + if ($config['db']['master']['prefix'] !== '') { - $oDB->charset = $oDB->getBestSupportedCharset(); - $db_info->master_db['db_charset'] = $oDB->charset; - $db_info->slave_db[0]['db_charset'] = $oDB->charset; - Context::setDBInfo($db_info); + $config['db']['master']['prefix'] .= '_'; } - - // Install all the modules - try { + + // Set the default language. + $config['locale']['default_lang'] = Context::getLangType(); + $config['locale']['enabled_lang'] = array($config['locale']['default_lang']); + + // Set the internal and default time zones. + $user_timezone = intval(get_time_zone_offset($time_zone ?: '+0900') / 3600); + switch ($user_timezone) + { + case 9: + $config['locale']['default_timezone'] = 'Asia/Seoul'; break; + case 0: + $config['locale']['default_timezone'] = 'Etc/UTC'; break; + default: + $config['locale']['default_timezone'] = 'Etc/GMT' . ($user_timezone > 0 ? '-' : '+') . abs($user_timezone); + } + $config['locale']['internal_timezone'] = intval(date('Z')); + + // Set the default URL. + $config['url']['default'] = Context::getRequestUri(); + + // Load the new configuration. + Context::loadDBInfo($config); + + // Check DB. + $oDB = DB::getInstance(); + if (!$oDB->isConnected()) + { + return $oDB->getError(); + } + + // Assign a temporary administrator while installing. + foreach ($user_info as $key => $val) + { + Context::set($key, $val, true); + } + $user_info->is_admin = 'Y'; + Context::set('logged_info', $user_info); + + // Install all the modules. + try + { $oDB->begin(); $this->installDownloadedModule(); $oDB->commit(); - } catch(Exception $e) { + } + catch(Exception $e) + { $oDB->rollback(); return new Object(-1, $e->getMessage()); } - - // Create a config file - if(!$this->makeConfigFile()) return new Object(-1, 'msg_install_failed'); - - // load script + + // Execute the install script. $scripts = FileHandler::readDir(_XE_PATH_ . 'modules/install/script', '/(\.php)$/'); - if(count($scripts)>0) + if(count($scripts)) { sort($scripts); foreach($scripts as $script) @@ -165,48 +214,23 @@ class installController extends install $output = include($script_path . $script); } } - - // save selected lang info - $oInstallAdminController = getAdminController('install'); - $oInstallAdminController->saveLangSelected(array(Context::getLangType())); - - // Display a message that installation is completed - $this->setMessage('msg_install_completed'); - + + // Save the new configuration. + Rhymix\Framework\Config::save($config); + + // Unset temporary session variables. unset($_SESSION['use_rewrite']); - + unset($_SESSION['db_config']); + + // Redirect to the home page. + $this->setMessage('msg_install_completed'); if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) { $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl(''); - header('location:'.$returnUrl); - return new Object(); + $this->setRedirectUrl($returnUrl); } - } - - /** - * @brief Make DB Information by Install Config - */ - function _makeDbInfoByInstallConfig() - { - $db_info = new stdClass(); - $db_info->master_db = array( - 'db_type' => Context::get('db_type'), - 'db_port' => Context::get('db_port'), - 'db_hostname' => Context::get('db_hostname'), - 'db_userid' => Context::get('db_userid'), - 'db_password' => Context::get('db_password'), - 'db_database' => Context::get('db_database'), - 'db_table_prefix' => Context::get('db_table_prefix'), - 'db_charset' => Context::get('db_charset'), - ); - $db_info->slave_db = array($db_info->master_db); - $db_info->default_url = Context::getRequestUri(); - $db_info->lang_type = Context::get('lang_type') ? Context::get('lang_type') : Context::getLangType(); - Context::setLangType($db_info->lang_type); - $db_info->use_rewrite = Context::get('use_rewrite'); - $db_info->time_zone = Context::get('time_zone'); - - return $db_info; + + return new Object(); } /** @@ -436,7 +460,7 @@ class installController extends install /** * @brief License agreement */ - function procInstallLicenseAggrement() + function procInstallLicenseAgreement() { $vars = Context::getRequestVars(); @@ -575,134 +599,6 @@ class installController extends install if(method_exists($oModule, 'moduleInstall')) $oModule->moduleInstall(); return new Object(); } - - function _getDBConfigFileContents($db_info) - { - if(substr($db_info->master_db['db_table_prefix'], -1) != '_') - { - $db_info->master_db['db_table_prefix'] .= '_'; - } - - foreach($db_info->slave_db as &$slave) - { - if(substr($slave['db_table_prefix'], -1) != '_') - { - $slave['db_table_prefix'] .= '_'; - } - } - - $buff = array(); - $buff[] = 'db_tmp_config_file; - - $db_info = Context::getDBInfo(); - if(!$db_info) return; - - $buff = $this->_getDBConfigFileContents($db_info); - - FileHandler::writeFile($db_tmp_config_file, $buff); - - if(@file_exists($db_tmp_config_file)) return true; - return false; - } - - /** - * @brief Create etc config file - * Create the config file when all settings are completed - */ - function makeEtcConfigFile($config_info) - { - $etc_tmp_config_file = $this->etc_tmp_config_file; - - $buff = ' $val) - { - $buff .= sprintf("\$db_info->%s = '%s';\n", $key, str_replace("'","\\'",$val)); - } - - FileHandler::writeFile($etc_tmp_config_file, $buff); - - if(@file_exists($etc_tmp_config_file)) return true; - return false; - } - - /** - * @brief Create config file - * Create the config file when all settings are completed - */ - function makeConfigFile() - { - try { - $config_file = Context::getConfigFile(); - //if(file_exists($config_file)) return; - - $db_info = Context::getDBInfo(); - if(!$db_info) return; - - $buff = $this->_getDBConfigFileContents($db_info); - - FileHandler::writeFile($config_file, $buff); - - if(@file_exists($config_file)) - { - FileHandler::removeFile($this->db_tmp_config_file); - FileHandler::removeFile($this->etc_tmp_config_file); - return true; - } - return false; - } catch (Exception $e) { - return false; - } - } - - function installByConfig($install_config_file) - { - include $install_config_file; - if(!is_array($auto_config)) return false; - - $auto_config['module'] = 'install'; - $auto_config['act'] = 'procInstall'; - - $fstr = "<%s>\r\n"; - $fheader = "POST %s HTTP/1.1\r\nHost: %s\r\nContent-Type: application/xml\r\nContent-Length: %s\r\n\r\n%s\r\n"; - $body = "\r\n\r\n\r\n"; - foreach($auto_config as $k => $v) - { - if(!in_array($k,array('host','port','path'))) $body .= sprintf($fstr,$k,$v,$k); - } - $body .= "\r\n"; - - $header = sprintf($fheader,$auto_config['path'],$auto_config['host'],strlen($body),$body); - $fp = @fsockopen($auto_config['host'], $auto_config['port'], $errno, $errstr, 5); - - if($fp) - { - fputs($fp, $header); - while(!feof($fp)) - { - $line = trim(fgets($fp, 4096)); - if(strncmp('', $line, 7) === 0) - { - fclose($fp); - return false; - } - } - fclose($fp); - } - return true; - - } } /* End of file install.controller.php */ /* Location: ./modules/install/install.controller.php */ diff --git a/modules/install/install.view.php b/modules/install/install.view.php index 5f505ae78..aff654546 100644 --- a/modules/install/install.view.php +++ b/modules/install/install.view.php @@ -7,8 +7,7 @@ */ class installView extends install { - public $install_enable = false; - + public static $checkEnv = false; public static $rewriteCheckFilePath = 'files/cache/tmpRewriteCheck.txt'; public static $rewriteCheckString = ''; @@ -17,81 +16,56 @@ class installView extends install */ function init() { - // Set browser title + // Stop if already installed. + if (Context::isInstalled()) + { + return $this->stop('msg_already_installed'); + } + + // Set the browser title. Context::setBrowserTitle(Context::getLang('introduce_title')); - // Specify the template path + + // Specify the template path. $this->setTemplatePath($this->module_path.'tpl'); - // Error occurs if already installed - if(Context::isInstalled()) return $this->stop('msg_already_installed'); - // Install a controller + + // Check the environment. $oInstallController = getController('install'); - $this->install_enable = $oInstallController->checkInstallEnv(); - // If the environment is installable, execute installController::makeDefaultDirectory() - if($this->install_enable) $oInstallController->makeDefaultDirectory(); + self::$checkEnv = $oInstallController->checkInstallEnv(); + if (self::$checkEnv) + { + $oInstallController->makeDefaultDirectory(); + } } /** - * @brief Display license messages + * @brief Index page */ - function dispInstallIntroduce() + function dispInstallIndex() { - $install_config_file = FileHandler::getRealPath('./config/install.config.php'); - if(file_exists($install_config_file)) + // If there is an autoinstall config file, use it. + if (file_exists(RX_BASEDIR . 'config/install.config.php')) { - /** - * If './config/install.config.php' file created and write array shown in the example below, XE installed using config file. - * ex ) - $install_config = array( - 'db_type' =>'mysqli_innodb', - 'db_port' =>'3306', - 'db_hostname' =>'localhost', - 'db_userid' =>'root', - 'db_password' =>'root', - 'db_database' =>'rx_database', - 'db_table_prefix' =>'rx', - 'user_rewrite' =>'N', - 'time_zone' =>'0000', - 'email_address' =>'admin@admin.net', - 'password' =>'pass', - 'password2' =>'pass', - 'nick_name' =>'admin', - 'user_id' =>'admin', - 'lang_type' =>'ko', // en, jp, ... - ); - */ - include $install_config_file; - if(is_array($install_config)) + include RX_BASEDIR . 'config/install.config.php'; + + if (isset($install_config) && is_array($install_config)) { - foreach($install_config as $k => $v) - { - $v = ($k == 'db_table_prefix') ? $v.'_' : $v; - Context::set($k,$v,true); - } - unset($GLOBALS['__DB__']); - Context::set('install_config', true, true); $oInstallController = getController('install'); - $output = $oInstallController->procInstall(); - if (!$output->toBool()) return $output; - header("location: ./"); - Context::close(); - exit; + $output = $oInstallController->procInstall($install_config); + if (!$output->toBool()) + { + return $output; + } + else + { + header("location: ./"); + exit; + } } } - - Context::set('l', Context::getLangType()); - return $this->dispInstallLicenseAgreement(); - //$this->setTemplateFile('introduce'); - } - - /** - * @brief License agreement - */ - function dispInstallLicenseAgreement() - { + + // Otherwise, display the license agreement screen. + Context::set('lang_type', Context::getLangType()); $this->setTemplateFile('license_agreement'); - - $lang_type = Context::getLangType(); - Context::set('lang_type', $lang_type); } /** @@ -99,111 +73,82 @@ class installView extends install */ function dispInstallCheckEnv() { - $oInstallController = getController('install'); - + // Create a temporary file for mod_rewrite check. self::$rewriteCheckString = Password::createSecureSalt(32); FileHandler::writeFile(_XE_PATH_ . self::$rewriteCheckFilePath, self::$rewriteCheckString);; - Context::set('use_rewrite', $_SESSION['use_rewrite'] = 'N'); - Context::set('use_nginx', stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false); + // Check if the web server is nginx. + Context::set('use_nginx', stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false); $this->setTemplateFile('check_env'); } /** - * @brief Choose a DB + * @brief Configure the database */ - function dispInstallSelectDB() + function dispInstallDBConfig() { // Display check_env if it is not installable - if(!$this->install_enable) return $this->dispInstallCheckEnv(); + if(!self::$checkEnv) + { + return $this->dispInstallCheckEnv(); + } // Delete mod_rewrite check file FileHandler::removeFile(_XE_PATH_ . self::$rewriteCheckFilePath); - // Save mod_rewrite check status + // Save mod_rewrite check status. if(Context::get('rewrite') === 'Y') { Context::set('use_rewrite', $_SESSION['use_rewrite'] = 'Y'); } - // Enter ftp information + // FTP config is disabled in Rhymix. + /* if(ini_get('safe_mode') && !Context::isFTPRegisted()) { Context::set('progressMenu', '3'); Context::set('server_ip_address', $_SERVER['SERVER_ADDR']); Context::set('server_ftp_user', get_current_user()); $this->setTemplateFile('ftp'); + return; } - else + */ + + $defaultDatabase = 'mysqli_innodb'; + $disableList = DB::getDisableList(); + if(is_array($disableList)) { - $defaultDatabase = 'mysqli_innodb'; - $disableList = DB::getDisableList(); - if(is_array($disableList)) + foreach($disableList as $key => $value) { - foreach($disableList AS $key=>$value) + if($value->db_type == $defaultDatabase) { - if($value->db_type == $defaultDatabase) - { - $defaultDatabase = 'mysql'; - break; - } + $defaultDatabase = 'mysqli'; + break; } } - Context::set('defaultDatabase', $defaultDatabase); - Context::set('progressMenu', '4'); - - $error_return_url = getNotEncodedUrl('', 'act', Context::get('act'), 'db_type', Context::get('db_type')); - if(RX_SSL) - { - // Error occured when using https protocol at "ModuleHandler::init() ' - $parsedUrl = parse_url($error_return_url); - $error_return_url = ''; - if(isset($parsedUrl['path'])) $error_return_url .= $parsedUrl['path']; - if(isset($parsedUrl['query'])) $error_return_url .= '?' . $parsedUrl['query']; - if(isset($parsedUrl['fragment'])) $error_return_url .= '?' . $parsedUrl['fragment']; - } - Context::set('error_return_url', $error_return_url); - - $this->setTemplateFile('select_db'); } + Context::set('defaultDatabase', $defaultDatabase); + + Context::set('progressMenu', '4'); + Context::set('error_return_url', getNotEncodedUrl('', 'act', Context::get('act'), 'db_type', Context::get('db_type'))); + $this->setTemplateFile('db_config'); } /** * @brief Display a screen to enter DB and administrator's information */ - function dispInstallManagerForm() + function dispInstallOtherConfig() { // Display check_env if not installable - if(!$this->install_enable) + if(!self::$checkEnv) { return $this->dispInstallCheckEnv(); } - - include _XE_PATH_.'files/config/tmpDB.config.php'; - + Context::set('use_rewrite', $_SESSION['use_rewrite']); Context::set('use_ssl', RX_SSL ? 'always' : 'none'); Context::set('time_zone', $GLOBALS['time_zone']); - Context::set('db_type', $db_info->db_type); - $this->setTemplateFile('admin_form'); - } - - /** - * @brief Check whether this server supports mod_rewrite - */ - function useRewriteModule() - { - if(function_exists('apache_get_modules') && in_array('mod_rewrite',apache_get_modules())) - { - return true; - } - - require_once(_XE_PATH_.'classes/httprequest/XEHttpRequest.class.php'); - $httpRequest = new XEHttpRequest($_SERVER['HTTP_HOST'], $_SERVER['SERVER_PORT']); - $xeInstallPath = substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'index.php', 1)); - $output = $httpRequest->send($xeInstallPath.'modules/install/conf/info.xml'); - - return (strpos($output->body, 'setTemplateFile('other_config'); } } /* End of file install.view.php */ diff --git a/modules/install/ruleset/install.xml b/modules/install/ruleset/install.xml index 100f8b689..3ed218653 100644 --- a/modules/install/ruleset/install.xml +++ b/modules/install/ruleset/install.xml @@ -8,6 +8,5 @@ - diff --git a/modules/install/script/ko.install.php b/modules/install/script/ko.install.php index 485c8cb9b..e4f53e64b 100644 --- a/modules/install/script/ko.install.php +++ b/modules/install/script/ko.install.php @@ -269,7 +269,7 @@ $obj->email_address = $logged_info->email_address; $obj->module_srl = $module_srl; Context::set('version', __XE_VERSION__); -$obj->title = 'Welcome Rhymix'; +$obj->title = 'Welcome to Rhymix'; $obj->content = $oTemplateHandler->compile(_XE_PATH_ . 'modules/install/script/welcome_content', 'welcome_content_'.$lang); @@ -279,7 +279,7 @@ if(!$output->toBool()) return $output; $document_srl = $output->get('document_srl'); unset($obj->document_srl); -$obj->title = 'Welcome mobile Rhymix'; +$obj->title = 'Welcome to Mobile Rhymix'; $output = $oDocumentController->insertDocument($obj, true); if(!$output->toBool()) return $output; diff --git a/modules/install/tpl/check_env.html b/modules/install/tpl/check_env.html index aadff1a61..8bb498790 100644 --- a/modules/install/tpl/check_env.html +++ b/modules/install/tpl/check_env.html @@ -42,7 +42,7 @@ {$lang->disable_rewrite} -
{$lang->about_nginx_rewrite}
+
{$lang->about_nginx_rewrite}

{$lang->disable_rewrite_can_proceed} @@ -53,7 +53,7 @@ « {$lang->cmd_back} diff --git a/modules/install/tpl/select_db.html b/modules/install/tpl/db_config.html similarity index 67% rename from modules/install/tpl/select_db.html rename to modules/install/tpl/db_config.html index 0a52f8263..5baebc488 100644 --- a/modules/install/tpl/select_db.html +++ b/modules/install/tpl/db_config.html @@ -8,7 +8,7 @@ - +
@@ -27,28 +27,28 @@

{$lang->db_desc[$val->db_type]}

- -
+ +
- -
+ +
- -
+ +
- -
+ +
- -
+ +
- -
+ +

{$lang->db_info_desc}
{$lang->db_prefix_desc} diff --git a/modules/install/tpl/license_agreement.html b/modules/install/tpl/license_agreement.html index 2296de1ae..a13af53b4 100644 --- a/modules/install/tpl/license_agreement.html +++ b/modules/install/tpl/license_agreement.html @@ -7,7 +7,7 @@

{$XE_VALIDATOR_MESSAGE}

- +
@@ -22,7 +22,7 @@
- +
diff --git a/modules/install/tpl/admin_form.html b/modules/install/tpl/other_config.html similarity index 95% rename from modules/install/tpl/admin_form.html rename to modules/install/tpl/other_config.html index 0694b43bd..012d1e52d 100644 --- a/modules/install/tpl/admin_form.html +++ b/modules/install/tpl/other_config.html @@ -7,7 +7,6 @@

{$XE_VALIDATOR_MESSAGE}

-
@@ -61,7 +60,7 @@
diff --git a/modules/install/tpl/progress_menu.html b/modules/install/tpl/progress_menu.html index 103437d45..6fb670a47 100644 --- a/modules/install/tpl/progress_menu.html +++ b/modules/install/tpl/progress_menu.html @@ -3,7 +3,7 @@
  • {$lang->install_progress_menu['license_agreement']}
  • {$lang->install_progress_menu['condition']}
  • {$lang->install_progress_menu['ftp']}
  • -
  • {$lang->install_progress_menu['dbInfo']}
  • -
  • {$lang->install_progress_menu['adminInfo']}
  • +
  • {$lang->install_progress_menu['dbInfo']}
  • +
  • {$lang->install_progress_menu['adminInfo']}