mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
Merge pull request #211 from kijin/pr/new-config-format
설정 포맷 전반적인 정리 + 관련 기능 다수 개선
This commit is contained in:
commit
bf5942bce5
77 changed files with 2319 additions and 1888 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,7 +1,8 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
config.user.inc.php
|
/config/config.user.inc.php
|
||||||
|
/config/install.config.php
|
||||||
/files/
|
/files/
|
||||||
/build/
|
/build/
|
||||||
/libs/
|
/libs/
|
||||||
|
|
|
||||||
2
classes/cache/CacheHandler.class.php
vendored
2
classes/cache/CacheHandler.class.php
vendored
|
|
@ -28,7 +28,7 @@ class CacheHandler extends Handler
|
||||||
* @param boolean $always_use_file If set true, use a file cache always
|
* @param boolean $always_use_file If set true, use a file cache always
|
||||||
* @return CacheHandler
|
* @return CacheHandler
|
||||||
*/
|
*/
|
||||||
function &getInstance($target = 'object', $info = null, $always_use_file = false)
|
function getInstance($target = 'object', $info = null, $always_use_file = false)
|
||||||
{
|
{
|
||||||
$cache_handler_key = $target . ($always_use_file ? '_file' : '');
|
$cache_handler_key = $target . ($always_use_file ? '_file' : '');
|
||||||
if(!$GLOBALS['__XE_CACHE_HANDLER__'][$cache_handler_key])
|
if(!$GLOBALS['__XE_CACHE_HANDLER__'][$cache_handler_key])
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
*/
|
*/
|
||||||
class Context
|
class Context
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow rewrite
|
* Allow rewrite
|
||||||
* @var bool TRUE: using rewrite mod, FALSE: otherwise
|
* @var bool TRUE: using rewrite mod, FALSE: otherwise
|
||||||
|
|
@ -209,7 +208,7 @@ class Context
|
||||||
*/
|
*/
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
// fix missing HTTP_RAW_POST_DATA in PHP 5.6 and above
|
// Fix missing HTTP_RAW_POST_DATA in PHP 5.6 and above.
|
||||||
if(!isset($GLOBALS['HTTP_RAW_POST_DATA']) && version_compare(PHP_VERSION, '5.6.0', '>=') === TRUE)
|
if(!isset($GLOBALS['HTTP_RAW_POST_DATA']) && version_compare(PHP_VERSION, '5.6.0', '>=') === TRUE)
|
||||||
{
|
{
|
||||||
$GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents("php://input");
|
$GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents("php://input");
|
||||||
|
|
@ -220,17 +219,15 @@ class Context
|
||||||
unset($GLOBALS['HTTP_RAW_POST_DATA']);
|
unset($GLOBALS['HTTP_RAW_POST_DATA']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set context variables in $GLOBALS (backward compatibility)
|
// Set global variables for backward compatibility.
|
||||||
$GLOBALS['__Context__'] = $this;
|
$GLOBALS['__Context__'] = $this;
|
||||||
$GLOBALS['lang'] = &$this->lang;
|
$GLOBALS['lang'] = &$this->lang;
|
||||||
$this->_COOKIE = $_COOKIE;
|
$this->_COOKIE = $_COOKIE;
|
||||||
|
|
||||||
// 20140429 editor/image_link
|
// Set information about the current request.
|
||||||
|
$this->setRequestMethod();
|
||||||
$this->_checkGlobalVars();
|
$this->_checkGlobalVars();
|
||||||
|
|
||||||
$this->setRequestMethod('');
|
|
||||||
|
|
||||||
$this->_setXmlRpcArgument();
|
$this->_setXmlRpcArgument();
|
||||||
$this->_setJSONRequestArgument();
|
$this->_setJSONRequestArgument();
|
||||||
$this->_setRequestArgument();
|
$this->_setRequestArgument();
|
||||||
|
|
@ -241,77 +238,43 @@ class Context
|
||||||
self::$_instance->request_method = 'XMLRPC';
|
self::$_instance->request_method = 'XMLRPC';
|
||||||
self::$_instance->response_method = 'JSON';
|
self::$_instance->response_method = 'JSON';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load system configuration.
|
||||||
$this->loadDBInfo();
|
$this->loadDBInfo();
|
||||||
if($this->db_info->use_sitelock == 'Y')
|
|
||||||
|
// If the site is locked, display the locked page.
|
||||||
|
if(config('lock.locked'))
|
||||||
{
|
{
|
||||||
if(is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
|
self::enforceSiteLock();
|
||||||
|
|
||||||
if(!IpFilter::filter($whitelist))
|
|
||||||
{
|
|
||||||
$title = ($this->db_info->sitelock_title) ? $this->db_info->sitelock_title : 'Maintenance in progress...';
|
|
||||||
$message = $this->db_info->sitelock_message;
|
|
||||||
|
|
||||||
define('_XE_SITELOCK_', TRUE);
|
|
||||||
define('_XE_SITELOCK_TITLE_', $title);
|
|
||||||
define('_XE_SITELOCK_MESSAGE_', $message);
|
|
||||||
|
|
||||||
header("HTTP/1.1 403 Forbidden");
|
|
||||||
if(FileHandler::exists(_XE_PATH_ . 'common/tpl/sitelock.user.html'))
|
|
||||||
{
|
|
||||||
include _XE_PATH_ . 'common/tpl/sitelock.user.html';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
include _XE_PATH_ . 'common/tpl/sitelock.html';
|
|
||||||
}
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If XE is installed, get virtual site information
|
// If Rhymix is installed, get virtual site information.
|
||||||
if(self::isInstalled())
|
if(self::isInstalled())
|
||||||
{
|
{
|
||||||
$oModuleModel = getModel('module');
|
$oModuleModel = getModel('module');
|
||||||
$site_module_info = $oModuleModel->getDefaultMid();
|
$site_module_info = $oModuleModel->getDefaultMid() ?: new stdClass;
|
||||||
|
|
||||||
if(!isset($site_module_info))
|
|
||||||
{
|
|
||||||
$site_module_info = new stdClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if site_srl of site_module_info is 0 (default site), compare the domain to default_url of db_config
|
// if site_srl of site_module_info is 0 (default site), compare the domain to default_url of db_config
|
||||||
if($site_module_info->site_srl == 0 && $site_module_info->domain != $this->db_info->default_url)
|
if($site_module_info->site_srl == 0 && $site_module_info->domain != $this->db_info->default_url)
|
||||||
{
|
{
|
||||||
$site_module_info->domain = $this->db_info->default_url;
|
$site_module_info->domain = $this->db_info->default_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
self::set('site_module_info', $site_module_info);
|
self::set('site_module_info', $site_module_info);
|
||||||
if($site_module_info->site_srl && isSiteID($site_module_info->domain))
|
if($site_module_info->site_srl && isSiteID($site_module_info->domain))
|
||||||
{
|
{
|
||||||
self::set('vid', $site_module_info->domain, TRUE);
|
self::set('vid', $site_module_info->domain, TRUE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(!isset($this->db_info))
|
else
|
||||||
{
|
{
|
||||||
$this->db_info = new stdClass;
|
$site_module_info = new stdClass;
|
||||||
}
|
|
||||||
|
|
||||||
$this->db_info->lang_type = $site_module_info->default_language;
|
|
||||||
if(!$this->db_info->lang_type)
|
|
||||||
{
|
|
||||||
$this->db_info->lang_type = 'ko';
|
|
||||||
}
|
|
||||||
if(!$this->db_info->use_db_session)
|
|
||||||
{
|
|
||||||
$this->db_info->use_db_session = 'N';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load Language File
|
// Load language support.
|
||||||
$lang_supported = self::loadLangSelected();
|
$enabled_langs = self::loadLangSelected();
|
||||||
|
self::set('lang_supported', $enabled_langs);
|
||||||
// Retrieve language type set in user's cookie
|
|
||||||
if($this->lang_type = self::get('l'))
|
if($this->lang_type = self::get('l'))
|
||||||
{
|
{
|
||||||
if($_COOKIE['lang_type'] != $this->lang_type)
|
if($_COOKIE['lang_type'] != $this->lang_type)
|
||||||
|
|
@ -323,33 +286,28 @@ class Context
|
||||||
{
|
{
|
||||||
$this->lang_type = $_COOKIE['lang_type'];
|
$this->lang_type = $_COOKIE['lang_type'];
|
||||||
}
|
}
|
||||||
|
elseif($site_module_info->default_language)
|
||||||
// If it's not exists, follow default language type set in db_info
|
{
|
||||||
if(!$this->lang_type)
|
$this->lang_type = $this->db_info->lang_type = $site_module_info->default_language;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$this->lang_type = $this->db_info->lang_type;
|
$this->lang_type = $this->db_info->lang_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if still lang_type has not been set or has not-supported type , set as Korean.
|
if(!$this->lang_type || !isset($enabled_langs[$this->lang_type]))
|
||||||
if(!$this->lang_type)
|
|
||||||
{
|
|
||||||
$this->lang_type = 'ko';
|
|
||||||
}
|
|
||||||
if(is_array($lang_supported) && !isset($lang_supported[$this->lang_type]))
|
|
||||||
{
|
{
|
||||||
$this->lang_type = 'ko';
|
$this->lang_type = 'ko';
|
||||||
}
|
}
|
||||||
|
|
||||||
self::set('lang_supported', $lang_supported);
|
|
||||||
self::setLangType($this->lang_type);
|
self::setLangType($this->lang_type);
|
||||||
|
|
||||||
// Load languages
|
|
||||||
$this->lang = Rhymix\Framework\Lang::getInstance($this->lang_type);
|
$this->lang = Rhymix\Framework\Lang::getInstance($this->lang_type);
|
||||||
$this->lang->loadDirectory(RX_BASEDIR . 'common/lang', 'common');
|
$this->lang->loadDirectory(RX_BASEDIR . 'common/lang', 'common');
|
||||||
$this->lang->loadDirectory(RX_BASEDIR . 'modules/module/lang', 'module');
|
$this->lang->loadDirectory(RX_BASEDIR . 'modules/module/lang', 'module');
|
||||||
|
|
||||||
// set session handler
|
// set session handler
|
||||||
if(self::isInstalled() && $this->db_info->use_db_session == 'Y')
|
if(self::isInstalled() && config('session.use_db'))
|
||||||
{
|
{
|
||||||
$oSessionModel = getModel('session');
|
$oSessionModel = getModel('session');
|
||||||
$oSessionController = getController('session');
|
$oSessionController = getController('session');
|
||||||
|
|
@ -370,7 +328,7 @@ class Context
|
||||||
$session_id = $_COOKIE[$session_name];
|
$session_id = $_COOKIE[$session_name];
|
||||||
}
|
}
|
||||||
|
|
||||||
if($session_id !== NULL || $this->db_info->delay_session != 'Y')
|
if($session_id !== NULL || !config('session.delay'))
|
||||||
{
|
{
|
||||||
$this->setCacheControl(0, false);
|
$this->setCacheControl(0, false);
|
||||||
session_start();
|
session_start();
|
||||||
|
|
@ -413,57 +371,25 @@ class Context
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if using rewrite module
|
|
||||||
$this->allow_rewrite = ($this->db_info->use_rewrite == 'Y' ? TRUE : FALSE);
|
|
||||||
|
|
||||||
// set locations for javascript use
|
// set locations for javascript use
|
||||||
$url = array();
|
$current_url = $request_uri = self::getRequestUri();
|
||||||
$current_url = self::getRequestUri();
|
if ($_SERVER['REQUEST_METHOD'] == 'GET' && $this->get_vars)
|
||||||
if($_SERVER['REQUEST_METHOD'] == 'GET')
|
|
||||||
{
|
{
|
||||||
if($this->get_vars)
|
if ($query_string = http_build_query($this->get_vars))
|
||||||
{
|
{
|
||||||
$url = array();
|
$current_url .= '?' . $query_string;
|
||||||
foreach($this->get_vars as $key => $val)
|
|
||||||
{
|
|
||||||
if(is_array($val) && count($val) > 0)
|
|
||||||
{
|
|
||||||
foreach($val as $k => $v)
|
|
||||||
{
|
|
||||||
$url[] = $key . '[' . $k . ']=' . urlencode($v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif($val)
|
|
||||||
{
|
|
||||||
$url[] = $key . '=' . urlencode($val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$current_url = self::getRequestUri();
|
|
||||||
if($url) $current_url .= '?' . join('&', $url);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$current_url = self::getUrl();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
if (strpos($current_url, 'xn--') !== false)
|
||||||
{
|
{
|
||||||
$current_url = self::getRequestUri();
|
$current_url = self::decodeIdna($current_url);
|
||||||
|
}
|
||||||
|
if (strpos($request_uri, 'xn--') !== false)
|
||||||
|
{
|
||||||
|
$request_uri = self::decodeIdna($request_uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
self::set('current_url', $current_url);
|
self::set('current_url', $current_url);
|
||||||
self::set('request_uri', self::getRequestUri());
|
self::set('request_uri', $request_uri);
|
||||||
|
|
||||||
if(strpos($current_url, 'xn--') !== FALSE)
|
|
||||||
{
|
|
||||||
self::set('current_url', self::decodeIdna($current_url));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(strpos(self::getRequestUri(), 'xn--') !== FALSE)
|
|
||||||
{
|
|
||||||
self::set('request_uri', self::decodeIdna(self::getRequestUri()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -535,81 +461,75 @@ class Context
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function loadDBInfo()
|
public static function loadDBInfo($config = null)
|
||||||
{
|
{
|
||||||
if(!self::isInstalled())
|
// Load new configuration format.
|
||||||
|
if ($config === null)
|
||||||
|
{
|
||||||
|
$config = Rhymix\Framework\Config::getAll();
|
||||||
|
}
|
||||||
|
if (!count($config))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$config_file = self::getConfigFile();
|
// Copy to old format for backward compatibility.
|
||||||
if(is_readable($config_file))
|
$db_info = new stdClass;
|
||||||
{
|
$db_info->master_db = array(
|
||||||
include($config_file);
|
'db_type' => $config['db']['master']['type'] . ($config['db']['master']['engine'] === 'innodb' ? '_innodb' : ''),
|
||||||
}
|
'db_hostname' => $config['db']['master']['host'],
|
||||||
|
'db_port' => $config['db']['master']['port'],
|
||||||
// If master_db information does not exist, the config file needs to be updated
|
'db_userid' => $config['db']['master']['user'],
|
||||||
if(!isset($db_info->master_db))
|
'db_password' => $config['db']['master']['pass'],
|
||||||
{
|
'db_database' => $config['db']['master']['database'],
|
||||||
$db_info->master_db = array();
|
'db_table_prefix' => $config['db']['master']['prefix'],
|
||||||
$db_info->master_db["db_type"] = $db_info->db_type;
|
'db_charset' => $config['db']['master']['charset'],
|
||||||
unset($db_info->db_type);
|
);
|
||||||
$db_info->master_db["db_port"] = $db_info->db_port;
|
$db_info->slave_db = array($db_info->master_db);
|
||||||
unset($db_info->db_port);
|
$db_info->use_object_cache = count($config['cache']) ? array_first($config['cache']) : null;
|
||||||
$db_info->master_db["db_hostname"] = $db_info->db_hostname;
|
$db_info->ftp_info = new stdClass;
|
||||||
unset($db_info->db_hostname);
|
$db_info->ftp_info->ftp_host = $config['ftp']['host'];
|
||||||
$db_info->master_db["db_password"] = $db_info->db_password;
|
$db_info->ftp_info->ftp_port = $config['ftp']['port'];
|
||||||
unset($db_info->db_password);
|
$db_info->ftp_info->ftp_user = $config['ftp']['user'];
|
||||||
$db_info->master_db["db_database"] = $db_info->db_database;
|
$db_info->ftp_info->ftp_pasv = $config['ftp']['pasv'] ? 'Y' : 'N';
|
||||||
unset($db_info->db_database);
|
$db_info->ftp_info->ftp_root_path = $config['ftp']['path'];
|
||||||
$db_info->master_db["db_userid"] = $db_info->db_userid;
|
$db_info->ftp_info->sftp = $config['ftp']['sftp'] ? 'Y' : 'N';
|
||||||
unset($db_info->db_userid);
|
$db_info->default_url = $config['url']['default'];
|
||||||
$db_info->master_db["db_table_prefix"] = $db_info->db_table_prefix;
|
$db_info->http_port = $config['url']['http_port'];
|
||||||
unset($db_info->db_table_prefix);
|
$db_info->https_port = $config['url']['https_port'];
|
||||||
|
$db_info->use_ssl = $config['url']['ssl'];
|
||||||
if(isset($db_info->master_db["db_table_prefix"]) && substr_compare($db_info->master_db["db_table_prefix"], '_', -1) !== 0)
|
self::set('_http_port', $db_info->http_port ?: null);
|
||||||
{
|
self::set('_https_port', $db_info->https_port ?: null);
|
||||||
$db_info->master_db["db_table_prefix"] .= '_';
|
|
||||||
}
|
|
||||||
|
|
||||||
$db_info->slave_db = array($db_info->master_db);
|
|
||||||
self::setDBInfo($db_info);
|
|
||||||
|
|
||||||
$oInstallController = getController('install');
|
|
||||||
$oInstallController->makeConfigFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$db_info->use_prepared_statements)
|
|
||||||
{
|
|
||||||
$db_info->use_prepared_statements = 'Y';
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$db_info->time_zone)
|
|
||||||
$db_info->time_zone = date('O');
|
|
||||||
$GLOBALS['_time_zone'] = $db_info->time_zone;
|
|
||||||
$GLOBALS['_time_zone_offset'] = get_time_zone_offset($db_info->time_zone);
|
|
||||||
|
|
||||||
if($db_info->qmail_compatibility != 'Y')
|
|
||||||
$db_info->qmail_compatibility = 'N';
|
|
||||||
$GLOBALS['_qmail_compatibility'] = $db_info->qmail_compatibility;
|
|
||||||
|
|
||||||
if(!$db_info->use_db_session)
|
|
||||||
$db_info->use_db_session = 'N';
|
|
||||||
if(!$db_info->use_ssl)
|
|
||||||
$db_info->use_ssl = 'none';
|
|
||||||
self::set('_use_ssl', $db_info->use_ssl);
|
self::set('_use_ssl', $db_info->use_ssl);
|
||||||
self::set('_http_port', ($db_info->http_port) ? $db_info->http_port : NULL);
|
$db_info->lang_type = $config['locale']['default_lang'];
|
||||||
self::set('_https_port', ($db_info->https_port) ? $db_info->https_port : NULL);
|
$db_info->time_zone = $config['locale']['internal_timezone'];
|
||||||
|
$db_info->time_zone = sprintf('%s%02d%02d', $db_info->time_zone >= 0 ? '+' : '-', abs($db_info->time_zone) / 3600, (abs($db_info->time_zone) % 3600 / 60));
|
||||||
if(!$db_info->sitelock_whitelist) {
|
$GLOBALS['_time_zone'] = $db_info->time_zone;
|
||||||
$db_info->sitelock_whitelist = '127.0.0.1';
|
$db_info->delay_session = $config['session']['delay'] ? 'Y' : 'N';
|
||||||
|
$db_info->use_db_session = $config['session']['use_db'] ? 'Y' : 'N';
|
||||||
|
$db_info->minify_scripts = $config['view']['minify_scripts'] ? 'Y' : 'N';
|
||||||
|
$db_info->admin_ip_list = count($config['admin']['allow']) ? $config['admin']['allow'] : null;
|
||||||
|
$db_info->use_sitelock = $config['lock']['locked'] ? 'Y' : 'N';
|
||||||
|
$db_info->sitelock_title = $config['lock']['title'];
|
||||||
|
$db_info->sitelock_message = $config['lock']['message'];
|
||||||
|
$db_info->sitelock_whitelist = count($config['lock']['allow']) ? $config['lock']['allow'] : array('127.0.0.1');
|
||||||
|
$db_info->embed_white_iframe = $config['embedfilter']['iframe'];
|
||||||
|
$db_info->embed_white_object = $config['embedfilter']['object'];
|
||||||
|
$db_info->use_mobile_view = $config['use_mobile_view'] ? 'Y' : 'N';
|
||||||
|
$db_info->use_prepared_statements = $config['use_prepared_statements'] ? 'Y' : 'N';
|
||||||
|
$db_info->use_rewrite = $config['use_rewrite'] ? 'Y' : 'N';
|
||||||
|
$db_info->use_sso = $config['use_sso'] ? 'Y' : 'N';
|
||||||
|
if (is_array($config['other']))
|
||||||
|
{
|
||||||
|
foreach ($config['other'] as $key => $value)
|
||||||
|
{
|
||||||
|
$db_info->{$key} = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_string($db_info->sitelock_whitelist)) {
|
// Save old format to Context instance.
|
||||||
$db_info->sitelock_whitelist = explode(',', $db_info->sitelock_whitelist);
|
self::$_instance->allow_rewrite = $config['use_rewrite'];
|
||||||
}
|
self::$_instance->db_info = $db_info;
|
||||||
|
|
||||||
self::setDBInfo($db_info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -650,7 +570,7 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function getSslStatus()
|
public static function getSslStatus()
|
||||||
{
|
{
|
||||||
return self::getDBInfo()->use_ssl;
|
return self::get('_use_ssl');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -660,7 +580,7 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function getDefaultUrl()
|
public static function getDefaultUrl()
|
||||||
{
|
{
|
||||||
return self::getDBInfo()->default_url;
|
return self::$_instance->db_info->default_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -680,39 +600,21 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function loadLangSelected()
|
public static function loadLangSelected()
|
||||||
{
|
{
|
||||||
static $lang_selected = null;
|
static $lang_selected = array();
|
||||||
if(!$lang_selected)
|
if(!count($lang_selected))
|
||||||
{
|
{
|
||||||
$selected_lang_file = _XE_PATH_ . 'files/config/lang_selected.info';
|
$supported = Rhymix\Framework\Lang::getSupportedList();
|
||||||
if(!FileHandler::hasContent($selected_lang_file))
|
$selected = Rhymix\Framework\Config::get('locale.enabled_lang');
|
||||||
|
if ($selected)
|
||||||
{
|
{
|
||||||
$old_selected_lang_file = _XE_PATH_ . 'files/cache/lang_selected.info';
|
foreach ($selected as $lang)
|
||||||
FileHandler::moveFile($old_selected_lang_file, $selected_lang_file);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!FileHandler::hasContent($selected_lang_file))
|
|
||||||
{
|
|
||||||
$lang_selected = Rhymix\Framework\Lang::getSupportedList();
|
|
||||||
$buff = '';
|
|
||||||
foreach($lang_selected as $key => $val)
|
|
||||||
{
|
{
|
||||||
$buff .= "$key,$val\n";
|
$lang_selected[$lang] = $supported[$lang];
|
||||||
}
|
}
|
||||||
FileHandler::writeFile($selected_lang_file, $buff);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$langs = file($selected_lang_file);
|
$lang_selected = $supported;
|
||||||
foreach($langs as $val)
|
|
||||||
{
|
|
||||||
list($lang_prefix, $lang_text) = explode(',', $val);
|
|
||||||
if($lang_prefix === 'jp')
|
|
||||||
{
|
|
||||||
$lang_prefix = 'ja';
|
|
||||||
}
|
|
||||||
$lang_text = trim($lang_text);
|
|
||||||
$lang_selected[$lang_prefix] = $lang_text;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $lang_selected;
|
return $lang_selected;
|
||||||
|
|
@ -726,7 +628,7 @@ class Context
|
||||||
public function checkSSO()
|
public function checkSSO()
|
||||||
{
|
{
|
||||||
// pass if it's not GET request or XE is not yet installed
|
// pass if it's not GET request or XE is not yet installed
|
||||||
if($this->db_info->use_sso != 'Y' || isCrawler())
|
if(!config('use_sso') || isCrawler())
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
@ -820,7 +722,8 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function isFTPRegisted()
|
public static function isFTPRegisted()
|
||||||
{
|
{
|
||||||
return file_exists(self::getFTPConfigFile());
|
$ftp_info = self::$_instance->db_info->ftp_info;
|
||||||
|
return ($ftp_info->ftp_user && $ftp_info->ftp_root_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -830,11 +733,11 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function getFTPInfo()
|
public static function getFTPInfo()
|
||||||
{
|
{
|
||||||
if(!self::isFTPRegisted())
|
$ftp_info = self::$_instance->db_info->ftp_info;
|
||||||
|
if (!$ftp_info->ftp_user || !$ftp_info->ftp_root_path)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
include(self::getFTPConfigFile());
|
|
||||||
return $ftp_info;
|
return $ftp_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -940,6 +843,11 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function setLangType($lang_type = 'ko')
|
public static function setLangType($lang_type = 'ko')
|
||||||
{
|
{
|
||||||
|
if (!self::$_instance->db_info)
|
||||||
|
{
|
||||||
|
self::$_instance->db_info = new stdClass;
|
||||||
|
}
|
||||||
|
self::$_instance->db_info->lang_type = $lang_type;
|
||||||
self::$_instance->lang_type = $lang_type;
|
self::$_instance->lang_type = $lang_type;
|
||||||
self::set('lang_type', $lang_type);
|
self::set('lang_type', $lang_type);
|
||||||
|
|
||||||
|
|
@ -967,8 +875,14 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function getLang($code)
|
public static function getLang($code)
|
||||||
{
|
{
|
||||||
$lang = self::$_instance->lang;
|
if (self::$_instance->lang)
|
||||||
return isset($lang->{$code}) ? $lang->{$code} : $code;
|
{
|
||||||
|
return self::$_instance->lang->get($code);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $code;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -980,7 +894,10 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function setLang($code, $val)
|
public static function setLang($code, $val)
|
||||||
{
|
{
|
||||||
self::$_instance->lang->{$code} = $val;
|
if (self::$_instance->lang)
|
||||||
|
{
|
||||||
|
self::$_instance->lang->set($code, $val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1478,6 +1395,36 @@ class Context
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enforce site lock.
|
||||||
|
*/
|
||||||
|
private static function enforceSiteLock()
|
||||||
|
{
|
||||||
|
$allowed_list = config('lock.allow');
|
||||||
|
foreach ($allowed_list as $allowed_ip)
|
||||||
|
{
|
||||||
|
if (Rhymix\Framework\IpFilter::inRange(RX_CLIENT_IP, $allowed_ip))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
define('_XE_SITELOCK_', TRUE);
|
||||||
|
define('_XE_SITELOCK_TITLE_', config('lock.title'));
|
||||||
|
define('_XE_SITELOCK_MESSAGE_', config('lock.message'));
|
||||||
|
|
||||||
|
header("HTTP/1.1 403 Forbidden");
|
||||||
|
if(FileHandler::exists(RX_BASEDIR . 'common/tpl/sitelock.user.html'))
|
||||||
|
{
|
||||||
|
include RX_BASEDIR . 'common/tpl/sitelock.user.html';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
include RX_BASEDIR . 'common/tpl/sitelock.html';
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return request method
|
* Return request method
|
||||||
* @return string Request method type. (Optional - GET|POST|XMLRPC|JSON)
|
* @return string Request method type. (Optional - GET|POST|XMLRPC|JSON)
|
||||||
|
|
@ -2468,7 +2415,7 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function getConfigFile()
|
public static function getConfigFile()
|
||||||
{
|
{
|
||||||
return _XE_PATH_ . 'files/config/db.config.php';
|
return RX_BASEDIR . 'files/config/db.config.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2478,7 +2425,7 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function getFTPConfigFile()
|
public static function getFTPConfigFile()
|
||||||
{
|
{
|
||||||
return _XE_PATH_ . 'files/config/ftp.config.php';
|
return RX_BASEDIR . 'files/config/ftp.config.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2488,7 +2435,7 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function isInstalled()
|
public static function isInstalled()
|
||||||
{
|
{
|
||||||
return FileHandler::hasContent(self::getConfigFile());
|
return (bool)config('config_version');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2509,7 +2456,7 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function isAllowRewrite()
|
public static function isAllowRewrite()
|
||||||
{
|
{
|
||||||
return self::getInstance()->allow_rewrite;
|
return self::$_instance->allow_rewrite;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,7 @@ class DB
|
||||||
*/
|
*/
|
||||||
var $priority_dbms = array(
|
var $priority_dbms = array(
|
||||||
'mysqli' => 6,
|
'mysqli' => 6,
|
||||||
'mysqli_innodb' => 5,
|
|
||||||
'mysql' => 4,
|
'mysql' => 4,
|
||||||
'mysql_innodb' => 3,
|
|
||||||
'cubrid' => 2,
|
'cubrid' => 2,
|
||||||
'mssql' => 1
|
'mssql' => 1
|
||||||
);
|
);
|
||||||
|
|
@ -139,11 +137,15 @@ class DB
|
||||||
* @param string $db_type type of db
|
* @param string $db_type type of db
|
||||||
* @return DB return DB object instance
|
* @return DB return DB object instance
|
||||||
*/
|
*/
|
||||||
function &getInstance($db_type = NULL)
|
public static function getInstance($db_type = NULL)
|
||||||
{
|
{
|
||||||
if(!$db_type)
|
if(!$db_type)
|
||||||
{
|
{
|
||||||
$db_type = Context::getDBType();
|
$db_type = config('db.master.type');
|
||||||
|
if (config('db.master.engine') === 'innodb')
|
||||||
|
{
|
||||||
|
$db_type .= '_innodb';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!$db_type && Context::isInstalled())
|
if(!$db_type && Context::isInstalled())
|
||||||
{
|
{
|
||||||
|
|
@ -157,7 +159,7 @@ class DB
|
||||||
if(!isset($GLOBALS['__DB__'][$db_type]))
|
if(!isset($GLOBALS['__DB__'][$db_type]))
|
||||||
{
|
{
|
||||||
$class_name = 'DB' . ucfirst($db_type);
|
$class_name = 'DB' . ucfirst($db_type);
|
||||||
$class_file = _XE_PATH_ . "classes/db/$class_name.class.php";
|
$class_file = RX_BASEDIR . "classes/db/$class_name.class.php";
|
||||||
if(!file_exists($class_file))
|
if(!file_exists($class_file))
|
||||||
{
|
{
|
||||||
return new Object(-1, 'msg_db_not_setted');
|
return new Object(-1, 'msg_db_not_setted');
|
||||||
|
|
@ -165,7 +167,7 @@ class DB
|
||||||
|
|
||||||
// get a singletone instance of the database driver class
|
// get a singletone instance of the database driver class
|
||||||
require_once($class_file);
|
require_once($class_file);
|
||||||
$GLOBALS['__DB__'][$db_type] = call_user_func(array($class_name, 'create'));
|
$GLOBALS['__DB__'][$db_type] = new $class_name;
|
||||||
$GLOBALS['__DB__'][$db_type]->db_type = $db_type;
|
$GLOBALS['__DB__'][$db_type]->db_type = $db_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -176,7 +178,7 @@ class DB
|
||||||
* returns instance of db
|
* returns instance of db
|
||||||
* @return DB return DB object instance
|
* @return DB return DB object instance
|
||||||
*/
|
*/
|
||||||
function create()
|
public static function create()
|
||||||
{
|
{
|
||||||
return new static();
|
return new static();
|
||||||
}
|
}
|
||||||
|
|
@ -185,7 +187,7 @@ class DB
|
||||||
* constructor
|
* constructor
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->count_cache_path = _XE_PATH_ . $this->count_cache_path;
|
$this->count_cache_path = _XE_PATH_ . $this->count_cache_path;
|
||||||
$this->cache_file = _XE_PATH_ . $this->cache_file;
|
$this->cache_file = _XE_PATH_ . $this->cache_file;
|
||||||
|
|
@ -280,30 +282,23 @@ class DB
|
||||||
$supported_list = FileHandler::readDir($db_classes_path, $filter, TRUE);
|
$supported_list = FileHandler::readDir($db_classes_path, $filter, TRUE);
|
||||||
|
|
||||||
// after creating instance of class, check is supported
|
// after creating instance of class, check is supported
|
||||||
for($i = 0; $i < count($supported_list); $i++)
|
foreach ($supported_list as $db_type)
|
||||||
{
|
{
|
||||||
$db_type = $supported_list[$i];
|
|
||||||
|
|
||||||
$class_name = sprintf("DB%s%s", strtoupper(substr($db_type, 0, 1)), strtolower(substr($db_type, 1)));
|
$class_name = sprintf("DB%s%s", strtoupper(substr($db_type, 0, 1)), strtolower(substr($db_type, 1)));
|
||||||
$class_file = sprintf(_XE_PATH_ . "classes/db/%s.class.php", $class_name);
|
$class_file = sprintf(_XE_PATH_ . "classes/db/%s.class.php", $class_name);
|
||||||
if(!file_exists($class_file))
|
if(!file_exists($class_file) || stripos($class_file, '_innodb') !== false)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($oDB);
|
|
||||||
require_once($class_file);
|
require_once($class_file);
|
||||||
$oDB = new $class_name();
|
$oDB = new $class_name();
|
||||||
|
|
||||||
if(!$oDB)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$obj = new stdClass;
|
$obj = new stdClass;
|
||||||
$obj->db_type = $db_type;
|
$obj->db_type = $db_type;
|
||||||
$obj->enable = $oDB->isSupported() ? TRUE : FALSE;
|
$obj->enable = $oDB->isSupported() ? TRUE : FALSE;
|
||||||
|
unset($oDB);
|
||||||
|
|
||||||
$get_supported_list[] = $obj;
|
$get_supported_list[] = $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1010,7 +1005,7 @@ class DB
|
||||||
{
|
{
|
||||||
$this->_connect($type);
|
$this->_connect($type);
|
||||||
}
|
}
|
||||||
$this->connection = 'Master ' . $this->master_db['db_hostname'];
|
$this->connection = 'Master ' . $this->master_db['host'];
|
||||||
return $this->master_db["resource"];
|
return $this->master_db["resource"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1024,7 +1019,7 @@ class DB
|
||||||
$this->_connect($type, $indx);
|
$this->_connect($type, $indx);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->connection = 'Slave ' . $this->slave_db[$indx]['db_hostname'];
|
$this->connection = 'Slave ' . $this->slave_db[$indx]['host'];
|
||||||
return $this->slave_db[$indx]["resource"];
|
return $this->slave_db[$indx]["resource"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1219,23 +1214,11 @@ class DB
|
||||||
*/
|
*/
|
||||||
function _setDBInfo()
|
function _setDBInfo()
|
||||||
{
|
{
|
||||||
$db_info = Context::getDBInfo();
|
$db_info = config('db');
|
||||||
$this->master_db = $db_info->master_db;
|
$this->master_db = $db_info['master'];
|
||||||
if($db_info->master_db["db_hostname"] == $db_info->slave_db[0]["db_hostname"]
|
$this->slave_db = $db_info ? array_values($db_info) : null;
|
||||||
&& $db_info->master_db["db_port"] == $db_info->slave_db[0]["db_port"]
|
$this->prefix = $this->master_db['prefix'];
|
||||||
&& $db_info->master_db["db_userid"] == $db_info->slave_db[0]["db_userid"]
|
$this->use_prepared_statements = config('use_prepared_statements');
|
||||||
&& $db_info->master_db["db_password"] == $db_info->slave_db[0]["db_password"]
|
|
||||||
&& $db_info->master_db["db_database"] == $db_info->slave_db[0]["db_database"]
|
|
||||||
)
|
|
||||||
{
|
|
||||||
$this->slave_db[0] = &$this->master_db;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->slave_db = $db_info->slave_db;
|
|
||||||
}
|
|
||||||
$this->prefix = $db_info->master_db["db_table_prefix"];
|
|
||||||
$this->use_prepared_statements = $db_info->use_prepared_statements;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1301,7 +1284,7 @@ class DB
|
||||||
$connection["is_connected"] = TRUE;
|
$connection["is_connected"] = TRUE;
|
||||||
|
|
||||||
// Save connection info for db logs
|
// Save connection info for db logs
|
||||||
$this->connection = ucfirst($type) . ' ' . $connection["db_hostname"];
|
$this->connection = ucfirst($type) . ' ' . $connection['host'];
|
||||||
|
|
||||||
// regist $this->close callback
|
// regist $this->close callback
|
||||||
register_shutdown_function(array($this, "close"));
|
register_shutdown_function(array($this, "close"));
|
||||||
|
|
|
||||||
|
|
@ -55,15 +55,6 @@ class DBCubrid extends DB
|
||||||
$this->_connect();
|
$this->_connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Create an instance of this class
|
|
||||||
* @return DBCubrid return DBCubrid object instance
|
|
||||||
*/
|
|
||||||
function create()
|
|
||||||
{
|
|
||||||
return new DBCubrid;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DB Connect
|
* DB Connect
|
||||||
* this method is private
|
* this method is private
|
||||||
|
|
@ -73,7 +64,7 @@ class DBCubrid extends DB
|
||||||
function __connect($connection)
|
function __connect($connection)
|
||||||
{
|
{
|
||||||
// attempts to connect
|
// attempts to connect
|
||||||
$result = @cubrid_connect($connection["db_hostname"], $connection["db_port"], $connection["db_database"], $connection["db_userid"], $connection["db_password"]);
|
$result = @cubrid_connect($connection['host'], $connection['port'], $connection['database'], $connection['user'], $connection['pass']);
|
||||||
|
|
||||||
// check connections
|
// check connections
|
||||||
if(!$result)
|
if(!$result)
|
||||||
|
|
|
||||||
|
|
@ -48,15 +48,6 @@ class DBMssql extends DB
|
||||||
$this->_connect();
|
$this->_connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Create an instance of this class
|
|
||||||
* @return DBMssql return DBMssql object instance
|
|
||||||
*/
|
|
||||||
function create()
|
|
||||||
{
|
|
||||||
return new DBMssql;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DB Connect
|
* DB Connect
|
||||||
* this method is private
|
* this method is private
|
||||||
|
|
@ -68,7 +59,11 @@ class DBMssql extends DB
|
||||||
//sqlsrv_configure( 'WarningsReturnAsErrors', 0 );
|
//sqlsrv_configure( 'WarningsReturnAsErrors', 0 );
|
||||||
//sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL );
|
//sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL );
|
||||||
//sqlsrv_configure( 'LogSubsystems', SQLSRV_LOG_SYSTEM_ALL );
|
//sqlsrv_configure( 'LogSubsystems', SQLSRV_LOG_SYSTEM_ALL );
|
||||||
$result = @sqlsrv_connect($connection["db_hostname"], array('Database' => $connection["db_database"], 'UID' => $connection["db_userid"], 'PWD' => $connection["db_password"]));
|
$result = @sqlsrv_connect($connection['host'], array(
|
||||||
|
'Database' => $connection['database'],
|
||||||
|
'UID' => $connection['user'],
|
||||||
|
'PWD' => $connection['pass'],
|
||||||
|
));
|
||||||
|
|
||||||
if(!$result)
|
if(!$result)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -58,13 +58,13 @@ class DBMysql extends DB
|
||||||
function __connect($connection)
|
function __connect($connection)
|
||||||
{
|
{
|
||||||
// Ignore if no DB information exists
|
// Ignore if no DB information exists
|
||||||
if(strpos($connection["db_hostname"], ':') === false && $connection["db_port"])
|
if(strpos($connection['host'], ':') === false && $connection['port'])
|
||||||
{
|
{
|
||||||
$connection["db_hostname"] .= ':' . $connection["db_port"];
|
$connection['host'] .= ':' . $connection['port'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempt to connect
|
// Attempt to connect
|
||||||
$result = @mysql_connect($connection["db_hostname"], $connection["db_userid"], $connection["db_password"]);
|
$result = @mysql_connect($connection['host'], $connection['user'], $connection['pass']);
|
||||||
if(!$result)
|
if(!$result)
|
||||||
{
|
{
|
||||||
exit('Unable to connect to DB.');
|
exit('Unable to connect to DB.');
|
||||||
|
|
@ -84,11 +84,11 @@ class DBMysql extends DB
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set charset
|
// Set charset
|
||||||
$this->charset = isset($connection["db_charset"]) ? $connection["db_charset"] : 'utf8';
|
$this->charset = isset($connection['charset']) ? $connection['charset'] : 'utf8';
|
||||||
mysql_set_charset($this->charset, $result);
|
mysql_set_charset($this->charset, $result);
|
||||||
|
|
||||||
// select db
|
// select db
|
||||||
@mysql_select_db($connection["db_database"], $result);
|
@mysql_select_db($connection['database'], $result);
|
||||||
if(mysql_error())
|
if(mysql_error())
|
||||||
{
|
{
|
||||||
$this->setError(mysql_errno(), mysql_error());
|
$this->setError(mysql_errno(), mysql_error());
|
||||||
|
|
|
||||||
|
|
@ -24,20 +24,13 @@ class DBMysqli extends DBMysql
|
||||||
function __connect($connection)
|
function __connect($connection)
|
||||||
{
|
{
|
||||||
// Attempt to connect
|
// Attempt to connect
|
||||||
if($connection["db_port"])
|
if($connection['port'])
|
||||||
{
|
{
|
||||||
$result = @mysqli_connect($connection["db_hostname"]
|
$result = @mysqli_connect($connection['host'], $connection['user'], $connection['pass'], $connection['database'], $connection['port']);
|
||||||
, $connection["db_userid"]
|
|
||||||
, $connection["db_password"]
|
|
||||||
, $connection["db_database"]
|
|
||||||
, $connection["db_port"]);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = @mysqli_connect($connection["db_hostname"]
|
$result = @mysqli_connect($connection['host'], $connection['user'], $connection['pass'], $connection['database']);
|
||||||
, $connection["db_userid"]
|
|
||||||
, $connection["db_password"]
|
|
||||||
, $connection["db_database"]);
|
|
||||||
}
|
}
|
||||||
$error = mysqli_connect_errno();
|
$error = mysqli_connect_errno();
|
||||||
if($error)
|
if($error)
|
||||||
|
|
@ -45,7 +38,7 @@ class DBMysqli extends DBMysql
|
||||||
$this->setError($error, mysqli_connect_error());
|
$this->setError($error, mysqli_connect_error());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->charset = isset($connection["db_charset"]) ? $connection["db_charset"] : 'utf8';
|
$this->charset = isset($connection['charset']) ? $connection['charset'] : 'utf8';
|
||||||
mysqli_set_charset($result, $this->charset);
|
mysqli_set_charset($result, $this->charset);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
@ -89,6 +82,11 @@ class DBMysqli extends DBMysql
|
||||||
*/
|
*/
|
||||||
function __query($query, $connection)
|
function __query($query, $connection)
|
||||||
{
|
{
|
||||||
|
if ($connection === null)
|
||||||
|
{
|
||||||
|
debug_print_backtrace();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
if($this->use_prepared_statements == 'Y')
|
if($this->use_prepared_statements == 'Y')
|
||||||
{
|
{
|
||||||
// 1. Prepare query
|
// 1. Prepare query
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,7 @@ class CubridTableWithHint extends Table
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
// Retrieve table prefix, to add it to index name
|
// Retrieve table prefix, to add it to index name
|
||||||
$db_info = Context::getDBInfo();
|
$prefix = config('db.master.prefix');
|
||||||
$prefix = $db_info->master_db["db_table_prefix"];
|
|
||||||
|
|
||||||
foreach($this->index_hints_list as $index_hint)
|
foreach($this->index_hints_list as $index_hint)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -433,7 +433,7 @@ class HTMLDisplayHandler
|
||||||
$original_file_list = array('x', 'common', 'js_app', 'xml_handler', 'xml_js_filter');
|
$original_file_list = array('x', 'common', 'js_app', 'xml_handler', 'xml_js_filter');
|
||||||
$jquery_version = preg_match('/MSIE [5-8]\./', $_SERVER['HTTP_USER_AGENT']) ? '1.11.3' : '2.1.4';
|
$jquery_version = preg_match('/MSIE [5-8]\./', $_SERVER['HTTP_USER_AGENT']) ? '1.11.3' : '2.1.4';
|
||||||
|
|
||||||
if(Context::getDBInfo()->minify_scripts === 'none')
|
if(config('view.minify_scripts') === 'none')
|
||||||
{
|
{
|
||||||
Context::loadFile(array('./common/js/jquery-' . $jquery_version . '.js', 'head', '', -1730000), true);
|
Context::loadFile(array('./common/js/jquery-' . $jquery_version . '.js', 'head', '', -1730000), true);
|
||||||
Context::loadFile(array('./common/js/plugins/jquery.migrate/jquery-migrate-1.2.1.js', 'head', '', -1720000), true);
|
Context::loadFile(array('./common/js/plugins/jquery.migrate/jquery-migrate-1.2.1.js', 'head', '', -1720000), true);
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ class FrontEndFileHandler extends Handler
|
||||||
|
|
||||||
if(self::$minify === null)
|
if(self::$minify === null)
|
||||||
{
|
{
|
||||||
self::$minify = Context::getDBInfo()->minify_scripts ?: 'common';
|
self::$minify = config('view.minify_scripts') ?: 'common';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($existsInfo[$existsKey]))
|
if(isset($existsInfo[$existsKey]))
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,9 @@ class Mobile
|
||||||
{
|
{
|
||||||
return $this->ismobile;
|
return $this->ismobile;
|
||||||
}
|
}
|
||||||
if(Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"])
|
if(!config('use_mobile_view') || Context::get('full_browse') || $_COOKIE["FullBrowse"])
|
||||||
{
|
{
|
||||||
return ($this->ismobile = false);
|
return $this->ismobile = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$xe_web_path = Context::pathToUrl(_XE_PATH_);
|
$xe_web_path = Context::pathToUrl(_XE_PATH_);
|
||||||
|
|
@ -231,6 +231,6 @@ class Mobile
|
||||||
|
|
||||||
public static function isMobileEnabled()
|
public static function isMobileEnabled()
|
||||||
{
|
{
|
||||||
return (Context::getDBInfo()->use_mobile_view === 'Y');
|
return config('use_mobile_view');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,14 +132,21 @@ class ModuleHandler extends Handler
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$urlInfo = parse_url($url);
|
$urlInfo = parse_url($url);
|
||||||
$host = $urlInfo['host'];
|
$host = $urlInfo['host'];
|
||||||
|
|
||||||
$dbInfo = Context::getDBInfo();
|
$defaultUrl = Context::getDefaultUrl();
|
||||||
$defaultUrlInfo = parse_url($dbInfo->default_url);
|
if($defaultUrl)
|
||||||
$defaultHost = $defaultUrlInfo['host'];
|
{
|
||||||
|
$defaultUrlInfo = parse_url($defaultUrl);
|
||||||
|
$defaultHost = $defaultUrlInfo['host'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$defaultHost = $_SERVER['HTTP_HOST'];
|
||||||
|
}
|
||||||
|
|
||||||
if($host && ($host != $defaultHost && $host != $site_module_info->domain))
|
if($host && ($host != $defaultHost && $host != $site_module_info->domain))
|
||||||
{
|
{
|
||||||
throw new Exception('msg_default_url_is_null');
|
throw new Exception('msg_default_url_is_null');
|
||||||
|
|
@ -233,8 +240,7 @@ class ModuleHandler extends Handler
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db_info = Context::getDBInfo();
|
if(!Context::getDefaultUrl())
|
||||||
if(!$db_info->default_url)
|
|
||||||
{
|
{
|
||||||
return Context::getLang('msg_default_url_is_not_defined');
|
return Context::getLang('msg_default_url_is_not_defined');
|
||||||
}
|
}
|
||||||
|
|
@ -243,7 +249,7 @@ class ModuleHandler extends Handler
|
||||||
$redirect_url = getNotEncodedSiteUrl($db_info->default_url, 'mid', Context::get('mid'), 'document_srl', Context::get('document_srl'), 'module_srl', Context::get('module_srl'), 'entry', Context::get('entry'));
|
$redirect_url = getNotEncodedSiteUrl($db_info->default_url, 'mid', Context::get('mid'), 'document_srl', Context::get('document_srl'), 'module_srl', Context::get('module_srl'), 'entry', Context::get('entry'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
header("location:" . $redirect_url);
|
header("Location: $redirect_url");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -394,18 +394,16 @@ class EmbedFilter
|
||||||
{
|
{
|
||||||
$this->whiteIframeUrlList[] = $prefix;
|
$this->whiteIframeUrlList[] = $prefix;
|
||||||
}
|
}
|
||||||
|
if ($embedfilter_object = config('embedfilter.object'))
|
||||||
$db_info = Context::getDBInfo();
|
|
||||||
if(isset($db_info->embed_white_object) && count($db_info->embed_white_object))
|
|
||||||
{
|
{
|
||||||
foreach ($db_info->embed_white_object as $prefix)
|
foreach ($embedfilter_object as $prefix)
|
||||||
{
|
{
|
||||||
$this->whiteUrlList[] = preg_match('@^https?://(.*)$@i', $prefix, $matches) ? $matches[1] : $prefix;
|
$this->whiteUrlList[] = preg_match('@^https?://(.*)$@i', $prefix, $matches) ? $matches[1] : $prefix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($db_info->embed_white_iframe) && count($db_info->embed_white_iframe))
|
if ($embedfilter_iframe = config('embedfilter.iframe'))
|
||||||
{
|
{
|
||||||
foreach ($db_info->embed_white_iframe as $prefix)
|
foreach ($embedfilter_iframe as $prefix)
|
||||||
{
|
{
|
||||||
$this->whiteIframeUrlList[] = preg_match('@^https?://(.*)$@i', $prefix, $matches) ? $matches[1] : $prefix;
|
$this->whiteIframeUrlList[] = preg_match('@^https?://(.*)$@i', $prefix, $matches) ? $matches[1] : $prefix;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE ^ E_STRICT ^ E_DEPRECATED);
|
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE ^ E_STRICT ^ E_DEPRECATED);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the default timezone.
|
* Suppress date/time errors until the internal time zone is set (see below).
|
||||||
*/
|
*/
|
||||||
date_default_timezone_set(@date_default_timezone_get());
|
date_default_timezone_set(@date_default_timezone_get());
|
||||||
|
|
||||||
|
|
@ -191,7 +191,15 @@ spl_autoload_register(function($class_name)
|
||||||
/**
|
/**
|
||||||
* Also include the Composer autoloader.
|
* Also include the Composer autoloader.
|
||||||
*/
|
*/
|
||||||
if (file_exists(RX_BASEDIR . 'vendor/autoload.php'))
|
require_once RX_BASEDIR . 'vendor/autoload.php';
|
||||||
{
|
|
||||||
require_once RX_BASEDIR . 'vendor/autoload.php';
|
/**
|
||||||
}
|
* Load system configuration.
|
||||||
|
*/
|
||||||
|
Rhymix\Framework\Config::init();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the internal timezone.
|
||||||
|
*/
|
||||||
|
$internal_timezone = Rhymix\Framework\DateTime::getTimezoneNameByOffset(config('locale.internal_timezone'));
|
||||||
|
date_default_timezone_set($internal_timezone);
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,104 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) Rhymix Developers and Contributors
|
* Copyright (c) Rhymix Developers and Contributors
|
||||||
*/
|
*/
|
||||||
|
return array(
|
||||||
|
'config_version' => '2.0',
|
||||||
|
'db' => array(
|
||||||
|
'master' => array(
|
||||||
|
'type' => 'mysql',
|
||||||
|
'host' => 'localhost',
|
||||||
|
'port' => 3306,
|
||||||
|
'user' => null,
|
||||||
|
'pass' => null,
|
||||||
|
'database' => null,
|
||||||
|
'prefix' => null,
|
||||||
|
'charset' => null,
|
||||||
|
'engine' => null,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'cache' => array(),
|
||||||
|
'ftp' => array(
|
||||||
|
'host' => 'localhost',
|
||||||
|
'port' => 21,
|
||||||
|
'path' => null,
|
||||||
|
'user' => null,
|
||||||
|
'pass' => null,
|
||||||
|
'pasv' => true,
|
||||||
|
'sftp' => false,
|
||||||
|
),
|
||||||
|
'crypto' => array(
|
||||||
|
'encryption_key' => null,
|
||||||
|
'authentication_key' => null,
|
||||||
|
'session_key' => null,
|
||||||
|
),
|
||||||
|
'locale' => array(
|
||||||
|
'default_lang' => 'ko',
|
||||||
|
'enabled_lang' => array('ko'),
|
||||||
|
'default_timezone' => 'Asia/Seoul',
|
||||||
|
'internal_timezone' => 32400,
|
||||||
|
),
|
||||||
|
'url' => array(
|
||||||
|
'default' => null,
|
||||||
|
'http_port' => null,
|
||||||
|
'https_port' => null,
|
||||||
|
'ssl' => 'none',
|
||||||
|
),
|
||||||
|
'session' => array(
|
||||||
|
'delay' => false,
|
||||||
|
'use_db' => false,
|
||||||
|
'domain' => null,
|
||||||
|
'path' => null,
|
||||||
|
'lifetime' => 0,
|
||||||
|
'refresh' => 300,
|
||||||
|
),
|
||||||
|
'file' => array(
|
||||||
|
'umask' => '022',
|
||||||
|
),
|
||||||
|
'mail' => array(
|
||||||
|
'transport' => 'mail',
|
||||||
|
'smtp_host' => null,
|
||||||
|
'smtp_port' => null,
|
||||||
|
'smtp_security' => 'none',
|
||||||
|
'smtp_user' => null,
|
||||||
|
'smtp_pass' => null,
|
||||||
|
'api_domain' => null,
|
||||||
|
'api_token' => null,
|
||||||
|
'api_user' => null,
|
||||||
|
'api_pass' => null,
|
||||||
|
),
|
||||||
|
'view' => array(
|
||||||
|
'minify_scripts' => 'common',
|
||||||
|
'concat_scripts' => 'none',
|
||||||
|
'use_gzip' => false,
|
||||||
|
),
|
||||||
|
'admin' => array(
|
||||||
|
'allow' => array(),
|
||||||
|
'deny' => array(),
|
||||||
|
),
|
||||||
|
'lock' => array(
|
||||||
|
'locked' => false,
|
||||||
|
'title' => 'Maintenance',
|
||||||
|
'message' => '',
|
||||||
|
'allow' => array(),
|
||||||
|
),
|
||||||
|
'debug' => array(
|
||||||
|
'enabled' => true,
|
||||||
|
'log_errors' => true,
|
||||||
|
'log_queries' => false,
|
||||||
|
'log_slow_queries' => 1,
|
||||||
|
'log_slow_triggers' => 1,
|
||||||
|
'log_slow_widgets' => 1,
|
||||||
|
'display_type' => 'comment',
|
||||||
|
'display_to' => 'admin',
|
||||||
|
'allow' => array(),
|
||||||
|
),
|
||||||
|
'embedfilter' => array(
|
||||||
|
'iframe' => array(),
|
||||||
|
'object' => array(),
|
||||||
|
),
|
||||||
|
'use_mobile_view' => true,
|
||||||
|
'use_prepared_statements' => true,
|
||||||
|
'use_rewrite' => true,
|
||||||
|
'use_sso' => false,
|
||||||
|
'other' => array(),
|
||||||
|
);
|
||||||
|
|
|
||||||
416
common/framework/config.php
Normal file
416
common/framework/config.php
Normal file
|
|
@ -0,0 +1,416 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Rhymix\Framework;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The config class.
|
||||||
|
*/
|
||||||
|
class Config
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* System configuration is stored here.
|
||||||
|
*/
|
||||||
|
protected static $_config = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load system configuration.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function init()
|
||||||
|
{
|
||||||
|
if (file_exists(RX_BASEDIR . 'files/config/config.php'))
|
||||||
|
{
|
||||||
|
self::$_config = (include RX_BASEDIR . 'files/config/config.php');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (self::$_config = self::convert())
|
||||||
|
{
|
||||||
|
self::save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return self::$_config;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all system configuration.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function getAll()
|
||||||
|
{
|
||||||
|
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.
|
||||||
|
*
|
||||||
|
* @param string $key
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public static function get($key)
|
||||||
|
{
|
||||||
|
if (!count(self::$_config))
|
||||||
|
{
|
||||||
|
self::init();
|
||||||
|
}
|
||||||
|
$data = self::$_config;
|
||||||
|
$key = explode('.', $key);
|
||||||
|
foreach ($key as $step)
|
||||||
|
{
|
||||||
|
if ($key === '' || !isset($data[$step]))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$data = $data[$step];
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a system configuration value.
|
||||||
|
*
|
||||||
|
* @param string $key
|
||||||
|
* @param mixed $value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function set($key, $value)
|
||||||
|
{
|
||||||
|
if (!count(self::$_config))
|
||||||
|
{
|
||||||
|
self::init();
|
||||||
|
}
|
||||||
|
$data = &self::$_config;
|
||||||
|
$key = explode('.', $key);
|
||||||
|
foreach ($key as $step)
|
||||||
|
{
|
||||||
|
$data = &$data[$step];
|
||||||
|
}
|
||||||
|
$data = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set all system configuration.
|
||||||
|
*
|
||||||
|
* @param array $config
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function setAll($config)
|
||||||
|
{
|
||||||
|
self::$_config = $config;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert previous configuration files to the current format and return it.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function convert()
|
||||||
|
{
|
||||||
|
// Load DB info file.
|
||||||
|
if (file_exists(RX_BASEDIR . 'files/config/db.config.php'))
|
||||||
|
{
|
||||||
|
include RX_BASEDIR . 'files/config/db.config.php';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load FTP info file.
|
||||||
|
if (file_exists(RX_BASEDIR . 'files/config/ftp.config.php'))
|
||||||
|
{
|
||||||
|
include RX_BASEDIR . 'files/config/ftp.config.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load selected language file.
|
||||||
|
if (file_exists(RX_BASEDIR . 'files/config/lang_selected.info'))
|
||||||
|
{
|
||||||
|
$lang_selected = array();
|
||||||
|
$lang_selected_raw = file_get_contents(RX_BASEDIR . 'files/config/lang_selected.info');
|
||||||
|
$lang_selected_raw = array_map('trim', explode("\n", $lang_selected_raw));
|
||||||
|
foreach ($lang_selected_raw as $lang_selected_item)
|
||||||
|
{
|
||||||
|
$lang_selected_item = array_map('trim', explode(',', $lang_selected_item));
|
||||||
|
if (count($lang_selected_item) && $lang_selected_item[0] !== '')
|
||||||
|
{
|
||||||
|
$lang_selected_item[0] = ($lang_selected_item[0] === 'jp' ? 'ja' : $lang_selected_item[0]);
|
||||||
|
$lang_selected[] = $lang_selected_item[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$lang_selected = array_unique($lang_selected);
|
||||||
|
unset($lang_selected_raw, $lang_selected_item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$lang_selected = \Context::getLangType() === 'jp' ? 'ja' : \Context::getLangType();
|
||||||
|
$lang_selected = array($lang_selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load defaults for the new configuration.
|
||||||
|
$config = (include RX_BASEDIR . 'common/defaults/config.php');
|
||||||
|
|
||||||
|
// Convert database configuration.
|
||||||
|
if (!isset($db_info->master_db))
|
||||||
|
{
|
||||||
|
$db_info->master_db = array();
|
||||||
|
$db_info->master_db['db_type'] = $db_info->db_type;
|
||||||
|
$db_info->master_db['db_hostname'] = $db_info->db_hostname;
|
||||||
|
$db_info->master_db['db_port'] = $db_info->db_port;
|
||||||
|
$db_info->master_db['db_userid'] = $db_info->db_userid;
|
||||||
|
$db_info->master_db['db_password'] = $db_info->db_password;
|
||||||
|
$db_info->master_db['db_database'] = $db_info->db_database;
|
||||||
|
$db_info->master_db['db_table_prefix'] = $db_info->db_table_prefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
$config['db']['master']['type'] = strtolower($db_info->master_db['db_type']);
|
||||||
|
$config['db']['master']['host'] = $db_info->master_db['db_hostname'];
|
||||||
|
$config['db']['master']['port'] = $db_info->master_db['db_port'];
|
||||||
|
$config['db']['master']['user'] = $db_info->master_db['db_userid'];
|
||||||
|
$config['db']['master']['pass'] = $db_info->master_db['db_password'];
|
||||||
|
$config['db']['master']['database'] = $db_info->master_db['db_database'];
|
||||||
|
$config['db']['master']['prefix'] = $db_info->master_db['db_table_prefix'];
|
||||||
|
|
||||||
|
if (substr($config['db']['master']['prefix'], -1) !== '_')
|
||||||
|
{
|
||||||
|
$config['db']['master']['prefix'] .= '_';
|
||||||
|
}
|
||||||
|
|
||||||
|
$config['db']['master']['charset'] = $db_info->master_db['db_charset'] ?: 'utf8';
|
||||||
|
|
||||||
|
if (strpos($config['db']['master']['type'], 'innodb') !== false)
|
||||||
|
{
|
||||||
|
$config['db']['master']['type'] = str_replace('_innodb', '', $config['db']['master']['type']);
|
||||||
|
$config['db']['master']['engine'] = 'innodb';
|
||||||
|
}
|
||||||
|
elseif (strpos($config['db']['master']['type'], 'mysql') !== false)
|
||||||
|
{
|
||||||
|
$config['db']['master']['engine'] = 'myisam';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($db_info->slave_db) && count($db_info->slave_db))
|
||||||
|
{
|
||||||
|
foreach ($db_info->slave_db as $slave_id => $slave_db)
|
||||||
|
{
|
||||||
|
if ($slave_db !== $db_info->master_db)
|
||||||
|
{
|
||||||
|
$slave_id = 'slave' . $slave_id;
|
||||||
|
$config['db'][$slave_id]['type'] = strtolower($slave_db['db_type']);
|
||||||
|
$config['db'][$slave_id]['host'] = $slave_db['db_hostname'];
|
||||||
|
$config['db'][$slave_id]['port'] = $slave_db['db_type'];
|
||||||
|
$config['db'][$slave_id]['user'] = $slave_db['db_userid'];
|
||||||
|
$config['db'][$slave_id]['pass'] = $slave_db['db_password'];
|
||||||
|
$config['db'][$slave_id]['database'] = $slave_db['db_database'];
|
||||||
|
$config['db'][$slave_id]['prefix'] = $slave_db['db_table_prefix'];
|
||||||
|
|
||||||
|
if (substr($config['db'][$slave_id]['prefix'], -1) !== '_')
|
||||||
|
{
|
||||||
|
$config['db'][$slave_id]['prefix'] .= '_';
|
||||||
|
}
|
||||||
|
|
||||||
|
$config['db'][$slave_id]['charset'] = $slave_db['db_charset'] ?: 'utf8';
|
||||||
|
|
||||||
|
if (strpos($config['db'][$slave_id]['type'], 'innodb') !== false)
|
||||||
|
{
|
||||||
|
$config['db'][$slave_id]['type'] = str_replace('_innodb', '', $config['db'][$slave_id]['type']);
|
||||||
|
$config['db'][$slave_id]['engine'] = 'innodb';
|
||||||
|
}
|
||||||
|
elseif (strpos($config['db'][$slave_id]['type'], 'mysql') !== false)
|
||||||
|
{
|
||||||
|
$config['db'][$slave_id]['engine'] = 'myisam';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert cache configuration.
|
||||||
|
if (isset($db_info->use_object_cache))
|
||||||
|
{
|
||||||
|
$config['cache'][] = $db_info->use_object_cache;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert FTP configuration.
|
||||||
|
if (isset($ftp_info))
|
||||||
|
{
|
||||||
|
$config['ftp']['host'] = $ftp_info->ftp_host;
|
||||||
|
$config['ftp']['port'] = $ftp_info->ftp_port;
|
||||||
|
$config['ftp']['path'] = $ftp_info->ftp_root_path;
|
||||||
|
$config['ftp']['user'] = $ftp_info->ftp_user;
|
||||||
|
$config['ftp']['pasv'] = $ftp_info->ftp_pasv;
|
||||||
|
$config['ftp']['sftp'] = $ftp_info->sftp === 'Y' ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create new crypto keys.
|
||||||
|
$config['crypto']['encryption_key'] = \Password::createSecureSalt(64, 'alnum');
|
||||||
|
$config['crypto']['authentication_key'] = \Password::createSecureSalt(64, 'alnum');
|
||||||
|
$config['crypto']['session_key'] = \Password::createSecureSalt(64, 'alnum');
|
||||||
|
|
||||||
|
// Convert language configuration.
|
||||||
|
if (isset($db_info->lang_type))
|
||||||
|
{
|
||||||
|
$config['locale']['default_lang'] = str_replace('jp', 'ja', strtolower($db_info->lang_type));
|
||||||
|
}
|
||||||
|
elseif (count($lang_selected))
|
||||||
|
{
|
||||||
|
$config['locale']['default_lang'] = array_first($lang_selected);
|
||||||
|
}
|
||||||
|
$config['locale']['enabled_lang'] = array_values($lang_selected);
|
||||||
|
|
||||||
|
// Convert timezone configuration.
|
||||||
|
$old_timezone = DateTime::getTimezoneOffsetByLegacyFormat($db_info->time_zone ?: '+0900');
|
||||||
|
switch ($old_timezone)
|
||||||
|
{
|
||||||
|
case 32400:
|
||||||
|
$config['locale']['default_timezone'] = 'Asia/Seoul'; break;
|
||||||
|
default:
|
||||||
|
$config['locale']['default_timezone'] = DateTime::getTimezoneNameByOffset($old_timezone);
|
||||||
|
}
|
||||||
|
$config['locale']['internal_timezone'] = intval(date('Z'));
|
||||||
|
|
||||||
|
// Convert URL configuration.
|
||||||
|
$default_url = $db_info->default_url;
|
||||||
|
if (strpos($default_url, 'xn--') !== false)
|
||||||
|
{
|
||||||
|
$default_url = \Context::decodeIdna($default_url);
|
||||||
|
}
|
||||||
|
$config['url']['default'] = $default_url ?: \RX_BASEURL;
|
||||||
|
$config['url']['http_port'] = $db_info->http_port ?: null;
|
||||||
|
$config['url']['https_port'] = $db_info->https_port ?: null;
|
||||||
|
$config['url']['ssl'] = $db_info->use_ssl ?: 'none';
|
||||||
|
|
||||||
|
// Convert session configuration.
|
||||||
|
$config['session']['delay'] = $db_info->delay_session === 'Y' ? true : false;
|
||||||
|
$config['session']['use_db'] = $db_info->use_db_session === 'Y' ? true : false;
|
||||||
|
|
||||||
|
// Convert view configuration.
|
||||||
|
$config['view']['minify_scripts'] = $db_info->minify_scripts ?: 'common';
|
||||||
|
$config['view']['use_gzip'] = (defined('__OB_GZHANDLER_ENABLE__') && constant('__OB_GZHANDLER_ENABLE__'));
|
||||||
|
|
||||||
|
// Convert admin IP whitelist.
|
||||||
|
if (isset($db_info->admin_ip_list) && is_array($db_info->admin_ip_list) && count($db_info->admin_ip_list))
|
||||||
|
{
|
||||||
|
$config['admin']['allow'] = array_values($db_info->admin_ip_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert sitelock configuration.
|
||||||
|
$config['lock']['locked'] = $db_info->use_sitelock === 'Y' ? true : false;
|
||||||
|
$config['lock']['title'] = strval($db_info->sitelock_title);
|
||||||
|
$config['lock']['message'] = strval($db_info->sitelock_message);
|
||||||
|
if (!is_array($db_info->sitelock_whitelist))
|
||||||
|
{
|
||||||
|
$db_info->sitelock_whitelist = $db_info->sitelock_whitelist ? array_map('trim', explode(',', trim($db_info->sitelock_whitelist))) : array();
|
||||||
|
}
|
||||||
|
if (!in_array('127.0.0.1', $db_info->sitelock_whitelist))
|
||||||
|
{
|
||||||
|
$db_info->sitelock_whitelist[] = '127.0.0.1';
|
||||||
|
}
|
||||||
|
$config['lock']['allow'] = array_values($db_info->sitelock_whitelist);
|
||||||
|
|
||||||
|
// Convert debug configuration.
|
||||||
|
$config['debug']['enabled'] = true;
|
||||||
|
$config['debug']['log_errors'] = true;
|
||||||
|
$config['debug']['log_queries'] = (\__DEBUG__ & 4) ? true : false;
|
||||||
|
$config['debug']['log_slow_queries'] = floatval(\__LOG_SLOW_QUERY__);
|
||||||
|
$config['debug']['log_slow_triggers'] = floatval(\__LOG_SLOW_TRIGGER__ * 1000);
|
||||||
|
$config['debug']['log_slow_widgets'] = floatval(\__LOG_SLOW_WIDGET__ * 1000);
|
||||||
|
|
||||||
|
// Convert embed filter configuration.
|
||||||
|
if (is_array($db_info->embed_white_iframe))
|
||||||
|
{
|
||||||
|
$whitelist = array_unique(array_map(function($item) {
|
||||||
|
return preg_match('@^https?://(.*)$@i', $item, $matches) ? $matches[1] : $item;
|
||||||
|
}, $db_info->embed_white_iframe));
|
||||||
|
natcasesort($whitelist);
|
||||||
|
$config['embedfilter']['iframe'] = $whitelist;
|
||||||
|
}
|
||||||
|
if (is_array($db_info->embed_white_object))
|
||||||
|
{
|
||||||
|
$whitelist = array_unique(array_map(function($item) {
|
||||||
|
return preg_match('@^https?://(.*)$@i', $item, $matches) ? $matches[1] : $item;
|
||||||
|
}, $db_info->embed_white_object));
|
||||||
|
natcasesort($whitelist);
|
||||||
|
$config['embedfilter']['object'] = $whitelist;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert miscellaneous configuration.
|
||||||
|
$config['use_mobile_view'] = $db_info->use_mobile_view === 'Y' ? true : false;
|
||||||
|
$config['use_prepared_statements'] = $db_info->use_prepared_statements === 'Y' ? true : false;
|
||||||
|
$config['use_rewrite'] = $db_info->use_rewrite === 'Y' ? true : false;
|
||||||
|
$config['use_sso'] = $db_info->use_sso === 'Y' ? true : false;
|
||||||
|
|
||||||
|
// Copy other configuration.
|
||||||
|
unset($db_info->master_db, $db_info->slave_db);
|
||||||
|
unset($db_info->lang_type, $db_info->time_zone);
|
||||||
|
unset($db_info->default_url, $db_info->http_port, $db_info->https_port, $db_info->use_ssl);
|
||||||
|
unset($db_info->delay_session, $db_info->use_db_session);
|
||||||
|
unset($db_info->minify_scripts, $db_info->admin_ip_list);
|
||||||
|
unset($db_info->use_sitelock, $db_info->sitelock_title, $db_info->sitelock_message, $db_info->sitelock_whitelist);
|
||||||
|
unset($db_info->embed_white_iframe, $db_info->embed_white_object);
|
||||||
|
unset($db_info->use_object_cache, $db_info->use_mobile_view, $db_info->use_prepared_statements);
|
||||||
|
unset($db_info->use_rewrite, $db_info->use_sso);
|
||||||
|
foreach ($db_info as $key => $value)
|
||||||
|
{
|
||||||
|
$config['other'][$key] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return the new configuration.
|
||||||
|
return $config;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save the current system configuration.
|
||||||
|
*
|
||||||
|
* @param array $config (optional)
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function save($config = null)
|
||||||
|
{
|
||||||
|
if ($config)
|
||||||
|
{
|
||||||
|
self::setAll($config);
|
||||||
|
}
|
||||||
|
$buff = '<?php' . "\n" . '// Rhymix System Configuration' . "\n" . 'return ' . self::serialize(self::$_config) . ';' . "\n";
|
||||||
|
return \FileHandler::writeFile(RX_BASEDIR . 'files/config/config.php', $buff) ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize a value for insertion into a PHP-based configuration file.
|
||||||
|
*
|
||||||
|
* @param mixed $value
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function serialize($value)
|
||||||
|
{
|
||||||
|
if (is_object($value))
|
||||||
|
{
|
||||||
|
return '(object)' . self::serialize((array)$value);
|
||||||
|
}
|
||||||
|
elseif (is_array($value))
|
||||||
|
{
|
||||||
|
$value = var_export($value, true);
|
||||||
|
$value = preg_replace('/array \(\n/', "array(\n", $value);
|
||||||
|
$value = preg_replace('/=>\s+array\(\n/', "=> array(\n", $value);
|
||||||
|
$value = preg_replace('/array\(\s*\n\s*\)/', 'array()', $value);
|
||||||
|
$value = preg_replace_callback('/\n(\x20+)/', function($m) {
|
||||||
|
return "\n" . str_repeat("\t", intval(strlen($m[1]) / 2));
|
||||||
|
}, $value);
|
||||||
|
$value = preg_replace('/\n(\t+)[0-9]+ => /', "\n\$1", $value);
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return var_export($value, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
139
common/framework/datetime.php
Normal file
139
common/framework/datetime.php
Normal file
|
|
@ -0,0 +1,139 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Rhymix\Framework;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The datetime class.
|
||||||
|
*/
|
||||||
|
class DateTime
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Time zone objects and settings are cached here.
|
||||||
|
*/
|
||||||
|
protected static $_timezones = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format a Unix timestamp for the current user's timezone.
|
||||||
|
*
|
||||||
|
* @param string $format Format used in PHP date() function
|
||||||
|
* @param int $timestamp Unix timestamp (optional, default is now)
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function formatTimestampForCurrentUser($format, $timestamp = null)
|
||||||
|
{
|
||||||
|
$timezone = self::getTimezoneForCurrentUser();
|
||||||
|
if (!isset(self::$_timezones[$timezone]))
|
||||||
|
{
|
||||||
|
self::$_timezones[$timezone] = new \DateTimeZone($timezone);
|
||||||
|
}
|
||||||
|
$datetime = new \DateTime();
|
||||||
|
$datetime->setTimestamp($timestamp ?: time());
|
||||||
|
$datetime->setTimezone(self::$_timezones[$timezone]);
|
||||||
|
return $datetime->format($format);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current user's timezone.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getTimezoneForCurrentUser()
|
||||||
|
{
|
||||||
|
if (isset($_SESSION['timezone']) && $_SESSION['timezone'])
|
||||||
|
{
|
||||||
|
return $_SESSION['timezone'];
|
||||||
|
}
|
||||||
|
elseif ($default = Config::get('locale.default_timezone'))
|
||||||
|
{
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return @date_default_timezone_get();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the list of time zones supported on this server.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function getTimezoneList()
|
||||||
|
{
|
||||||
|
$result = array();
|
||||||
|
$tzlist = \DateTimeZone::listIdentifiers();
|
||||||
|
foreach ($tzlist as $tzid)
|
||||||
|
{
|
||||||
|
if (!preg_match('/^(?:A|Europe|Indian|Pacific)/', $tzid)) continue;
|
||||||
|
$name = str_replace('_', ' ', $tzid);
|
||||||
|
$datetime = new \DateTime(null, new \DateTimeZone($tzid));
|
||||||
|
$offset = $datetime->getOffset();
|
||||||
|
$offset = ($offset >= 0 ? '+' : '-') . sprintf('%02d', floor(abs($offset) / 3600)) . ':' . sprintf('%02d', (abs($offset) % 3600) / 60);
|
||||||
|
unset($datetime);
|
||||||
|
$result[$tzid] = "$name ($offset)";
|
||||||
|
}
|
||||||
|
asort($result);
|
||||||
|
$result['Etc/UTC'] = 'GMT/UTC (+00:00)';
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the absolute (UTC) offset of a timezone.
|
||||||
|
*
|
||||||
|
* @param string $timezone Timezone identifier, e.g. Asia/Seoul
|
||||||
|
* @param int $timestamp Unix timestamp (optional, default is now)
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public static function getTimezoneOffset($timezone, $timestamp = null)
|
||||||
|
{
|
||||||
|
if (!isset(self::$_timezones[$timezone]))
|
||||||
|
{
|
||||||
|
self::$_timezones[$timezone] = new \DateTimeZone($timezone);
|
||||||
|
}
|
||||||
|
$datetime = new \DateTime();
|
||||||
|
$datetime->setTimestamp($timestamp ?: time());
|
||||||
|
$datetime->setTimezone(self::$_timezones[$timezone]);
|
||||||
|
return $datetime->getOffset();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the relative offset between a timezone and Rhymix's internal timezone.
|
||||||
|
*
|
||||||
|
* @param string $timezone Timezone identifier, e.g. Asia/Seoul
|
||||||
|
* @param int $timestamp Unix timestamp (optional, default is now)
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public static function getTimezoneOffsetFromInternal($timezone, $timestamp = null)
|
||||||
|
{
|
||||||
|
return self::getTimezoneOffset($timezone, $timestamp) - Config::get('locale.internal_timezone');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the absolute (UTC) offset of a timezone written in XE legacy format ('+0900').
|
||||||
|
*
|
||||||
|
* @param string $timezone
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public static function getTimezoneOffsetByLegacyFormat($timezone)
|
||||||
|
{
|
||||||
|
$multiplier = ($timezone[0] === '-') ? -60 : 60;
|
||||||
|
$timezone = preg_replace('/[^0-9]/', '', $timezone);
|
||||||
|
list($hours, $minutes) = str_split($timezone, 2);
|
||||||
|
return (((int)$hours * 60) + (int)$minutes) * $multiplier;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a PHP time zone by UTC offset.
|
||||||
|
*
|
||||||
|
* @param int $offset
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function getTimezoneNameByOffset($offset)
|
||||||
|
{
|
||||||
|
switch ($offset)
|
||||||
|
{
|
||||||
|
case 0: return 'Etc/UTC';
|
||||||
|
default: return 'Etc/GMT' . ($offset > 0 ? '-' : '+') . intval(abs($offset / 3600));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -293,7 +293,7 @@ class Lang
|
||||||
public function __get($key)
|
public function __get($key)
|
||||||
{
|
{
|
||||||
// Separate the plugin name from the key.
|
// Separate the plugin name from the key.
|
||||||
if (($keys = explode('.', $key, 2)) && count($keys) === 2)
|
if (preg_match('/^[a-z0-9_.-]+$/i', $key) && ($keys = explode('.', $key, 2)) && count($keys) === 2)
|
||||||
{
|
{
|
||||||
list($plugin_name, $key) = $keys;
|
list($plugin_name, $key) = $keys;
|
||||||
if (!isset($this->_loaded_plugins[$plugin_name]))
|
if (!isset($this->_loaded_plugins[$plugin_name]))
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,26 @@
|
||||||
* Copyright (c) Rhymix Developers and Contributors
|
* Copyright (c) Rhymix Developers and Contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get system configuration.
|
||||||
|
*
|
||||||
|
* @param string $key
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function config($key, $value = null)
|
||||||
|
{
|
||||||
|
if ($value === null)
|
||||||
|
{
|
||||||
|
return Rhymix\Framework\Config::get($key);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Rhymix\Framework\Config::set($key, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Get the first value of an array.
|
/**
|
||||||
|
* Get the first value of an array.
|
||||||
*
|
*
|
||||||
* @param array $array The input array
|
* @param array $array The input array
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
|
@ -17,7 +35,8 @@ function array_first(array $array)
|
||||||
return reset($array);
|
return reset($array);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the first key of an array.
|
/**
|
||||||
|
* Get the first key of an array.
|
||||||
*
|
*
|
||||||
* @param array $array The input array
|
* @param array $array The input array
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
|
@ -28,7 +47,8 @@ function array_first_key(array $array)
|
||||||
return key($array);
|
return key($array);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the last value of an array.
|
/**
|
||||||
|
* Get the last value of an array.
|
||||||
*
|
*
|
||||||
* @param array $array The input array
|
* @param array $array The input array
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
|
@ -38,7 +58,8 @@ function array_last(array $array)
|
||||||
return end($array);
|
return end($array);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the last key of an array.
|
/**
|
||||||
|
* Get the last key of an array.
|
||||||
*
|
*
|
||||||
* @param array $array The input array
|
* @param array $array The input array
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ $lang->cmd_delete = 'Delete';
|
||||||
$lang->cmd_modify = 'Update';
|
$lang->cmd_modify = 'Update';
|
||||||
$lang->cmd_edit = 'Edit';
|
$lang->cmd_edit = 'Edit';
|
||||||
$lang->cmd_view = 'View';
|
$lang->cmd_view = 'View';
|
||||||
$lang->inquiry = 'Inquiry';
|
$lang->inquiry = 'View';
|
||||||
$lang->all = 'All';
|
$lang->all = 'All';
|
||||||
$lang->cmd_view_all = 'View All';
|
$lang->cmd_view_all = 'View All';
|
||||||
$lang->cmd_list = 'List';
|
$lang->cmd_list = 'List';
|
||||||
|
|
|
||||||
|
|
@ -6,54 +6,6 @@
|
||||||
* Copyright (c) NAVER <http://www.navercorp.com>
|
* Copyright (c) NAVER <http://www.navercorp.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Time zone
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
$time_zone = array(
|
|
||||||
'-1200' => '[UTC -12:00] Baker Island',
|
|
||||||
'-1100' => '[UTC -11:00] Niue, American Samoa',
|
|
||||||
'-1000' => '[UTC -10:00] Hawaii, Aleutian Islands, Cook Islands',
|
|
||||||
'-0930' => '[UTC -09:30] Marquesas Islands',
|
|
||||||
'-0900' => '[UTC -09:00] Alaska, Gambier Islands',
|
|
||||||
'-0800' => '[UTC -08:00] U.S. and Canada (Pacific)',
|
|
||||||
'-0700' => '[UTC -07:00] U.S. and Canada (Mountain)',
|
|
||||||
'-0600' => '[UTC -06:00] U.S. and Canada (Central), Mexico',
|
|
||||||
'-0500' => '[UTC -05:00] U.S. and Canada (Eastern), Chile',
|
|
||||||
'-0430' => '[UTC -04:30] Venezuela',
|
|
||||||
'-0400' => '[UTC -04:00] Canada (Atlantic), Brazil (Western)',
|
|
||||||
'-0330' => '[UTC -03:30] Canada (Newfoundland)',
|
|
||||||
'-0300' => '[UTC -03:00] Argentina, Brazil (Eastern), Greenland',
|
|
||||||
'-0200' => '[UTC -02:00] Fernando de Noronha, South Georgia & South Sandwich Islands',
|
|
||||||
'-0100' => '[UTC -01:00] Azores, Cape Verde',
|
|
||||||
'0000' => '[UTC ±00:00] GMT, Ireland, Portugal, West Africa',
|
|
||||||
'+0100' => '[UTC +01:00] Central Europe, West Africa',
|
|
||||||
'+0200' => '[UTC +02:00] Eastern Europe, Central Africa, Russia (Kaliningrad)',
|
|
||||||
'+0300' => '[UTC +03:00] Russia (Moscow), East Africa',
|
|
||||||
'+0330' => '[UTC +03:30] Iran',
|
|
||||||
'+0400' => '[UTC +04:00] Armenia, Azerbaijan, Georgia, Oman, Russia (Samara), UAE',
|
|
||||||
'+0430' => '[UTC +04:30] Afghanistan',
|
|
||||||
'+0500' => '[UTC +05:00] Pakistan, Russia (Yekaterinburg), Central Asia',
|
|
||||||
'+0530' => '[UTC +05:30] India, Sri Lanka',
|
|
||||||
'+0545' => '[UTC +05:45] Nepal',
|
|
||||||
'+0600' => '[UTC +06:00] Bangladesh, Bhutan, Kyrgyzstan, Russia (Omsk)',
|
|
||||||
'+0630' => '[UTC +06:30] Cocos Islands, Myanmar',
|
|
||||||
'+0700' => '[UTC +07:00] Cambodia, Indonesia, Laos, Russia (Krasnoyarsk), Thailand, Vietnam',
|
|
||||||
'+0800' => '[UTC +08:00] China, Malaysia, Philippines, Russia (Irkutsk), Singapore, Taiwan',
|
|
||||||
'+0830' => '[UTC +08:30] North Korea',
|
|
||||||
'+0845' => '[UTC +08:45] Australia (Eucla)',
|
|
||||||
'+0900' => '[UTC +09:00] Korea, Japan, Palua, East Timor, Russia (Yakutsk)',
|
|
||||||
'+0930' => '[UTC +09:30] Australia (Central)',
|
|
||||||
'+1000' => '[UTC +10:00] Australia (Eastern), Guam, Russia (Vladivostok)',
|
|
||||||
'+1030' => '[UTC +10:30] Lord Howe Island',
|
|
||||||
'+1100' => '[UTC +11:00] New Caledonia, Solomon Islands, Vanuatu, Russia (Srednekolymsk)',
|
|
||||||
'+1130' => '[UTC +11:30] Norfolk Island (before 2015)',
|
|
||||||
'+1200' => '[UTC +12:00] Fiji, New Zealand, Russia (Kamchatka)',
|
|
||||||
'+1245' => '[UTC +12:45] Chatham Islands',
|
|
||||||
'+1300' => '[UTC +13:00] Samoa, Tokelau, Tonga, Phoenix Islands',
|
|
||||||
'+1400' => '[UTC +14:00] Line Islands'
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define a function to use {@see ModuleHandler::getModuleObject()} ($module_name, $type)
|
* Define a function to use {@see ModuleHandler::getModuleObject()} ($module_name, $type)
|
||||||
*
|
*
|
||||||
|
|
@ -531,35 +483,32 @@ function cut_str($string, $cut_size = 0, $tail = '...')
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get integer offset of time zone
|
* Convert XE legacy time zone format into UTC offset.
|
||||||
*
|
*
|
||||||
* @param string $time_zone Time zone in +0900 format
|
* @param string $time_zone Time zone in '+0900' format
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function get_time_zone_offset($time_zone)
|
function get_time_zone_offset($timezone)
|
||||||
{
|
{
|
||||||
$multiplier = ($time_zone[0] === '-') ? -60 : 60;
|
return Rhymix\Framework\DateTime::getTimezoneOffsetByLegacyFormat($timezone);
|
||||||
$time_zone = preg_replace('/[^0-9]/', '', $time_zone);
|
|
||||||
list($hours, $minutes) = str_split($time_zone, 2);
|
|
||||||
return (((int)$hours * 60) + (int)$minutes) * $multiplier;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a time gap between server's timezone and XE's timezone
|
* Get the offset between the current user's time zone and Rhymix's internal time zone.
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function zgap()
|
function zgap($timestamp = null)
|
||||||
{
|
{
|
||||||
$time_zone_offset = $GLOBALS['_time_zone_offset'];
|
$current_user_timezone = Rhymix\Framework\DateTime::getTimezoneForCurrentUser();
|
||||||
$server_offset = date('Z');
|
return Rhymix\Framework\DateTime::getTimezoneOffsetFromInternal($current_user_timezone, $timestamp);
|
||||||
return $time_zone_offset - $server_offset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* YYYYMMDDHHIISS format changed to unix time value
|
* Convert YYYYMMDDHHIISS format to Unix timestamp.
|
||||||
|
* This function assumes the internal timezone.
|
||||||
*
|
*
|
||||||
* @param string $str Time value in format of YYYYMMDDHHIISS
|
* @param string $str Time in YYYYMMDDHHIISS format
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function ztime($str)
|
function ztime($str)
|
||||||
|
|
@ -576,24 +525,25 @@ function ztime($str)
|
||||||
$hour = (int)substr($str, 8, 2);
|
$hour = (int)substr($str, 8, 2);
|
||||||
$min = (int)substr($str, 10, 2);
|
$min = (int)substr($str, 10, 2);
|
||||||
$sec = (int)substr($str, 12, 2);
|
$sec = (int)substr($str, 12, 2);
|
||||||
$offset = zgap();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$hour = $min = $sec = $offset = 0;
|
$hour = $min = $sec = 0;
|
||||||
}
|
}
|
||||||
return mktime($hour, $min, $sec, $month, $day, $year) + $offset;
|
$offset = Rhymix\Framework\Config::get('locale.internal_timezone') ?: date('Z');
|
||||||
|
return gmmktime($hour, $min, $sec, $month, $day, $year) - $offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the time format YYYYMMDDHHIISS to the user defined format
|
* Convert YYYYMMDDHHIISS format to user-defined format.
|
||||||
|
* This function assumes the internal timezone.
|
||||||
*
|
*
|
||||||
* @param string|int $str YYYYMMDDHHIISS format time values
|
* @param string $str Time in YYYYMMDDHHIISS format
|
||||||
* @param string $format Time format of php date() function
|
* @param string $format Time format for date() function
|
||||||
* @param bool $conversion Means whether to convert automatically according to the language
|
* @param bool $conversion If true, convert automatically for the current language.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function zdate($str, $format = 'Y-m-d H:i:s', $conversion = TRUE)
|
function zdate($str, $format = 'Y-m-d H:i:s', $conversion = false)
|
||||||
{
|
{
|
||||||
if(!$str)
|
if(!$str)
|
||||||
{
|
{
|
||||||
|
|
@ -601,7 +551,7 @@ function zdate($str, $format = 'Y-m-d H:i:s', $conversion = TRUE)
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert the date format according to the language
|
// convert the date format according to the language
|
||||||
if($conversion == TRUE)
|
if($conversion)
|
||||||
{
|
{
|
||||||
static $convtable = array(
|
static $convtable = array(
|
||||||
'en' => array(
|
'en' => array(
|
||||||
|
|
@ -637,18 +587,18 @@ function zdate($str, $format = 'Y-m-d H:i:s', $conversion = TRUE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get unixtime by using ztime() for date() function's argument.
|
// get unixtime by using ztime() for date() function's argument.
|
||||||
$string = date($format, ztime($str));
|
$result = Rhymix\Framework\DateTime::formatTimestampForCurrentUser($format, ztime($str));
|
||||||
|
|
||||||
// change day and am/pm for each language
|
// change day and am/pm for each language
|
||||||
if(preg_match('/[MFAa]/', $format))
|
if(preg_match('/[MFAa]/', $format))
|
||||||
{
|
{
|
||||||
$unit_week = (Array)Context::getLang('unit_week');
|
$unit_week = (Array)Context::getLang('unit_week');
|
||||||
$unit_meridiem = (Array)Context::getLang('unit_meridiem');
|
$unit_meridiem = (Array)Context::getLang('unit_meridiem');
|
||||||
$string = str_replace(array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'), $unit_week, $string);
|
$result = str_replace(array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'), $unit_week, $result);
|
||||||
$string = str_replace(array('am', 'pm', 'AM', 'PM'), $unit_meridiem, $string);
|
$result = str_replace(array('am', 'pm', 'AM', 'PM'), $unit_meridiem, $result);
|
||||||
}
|
}
|
||||||
return $string;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -475,7 +475,6 @@ class adminAdminController extends admin
|
||||||
*/
|
*/
|
||||||
function procAdminRemoveIcons()
|
function procAdminRemoveIcons()
|
||||||
{
|
{
|
||||||
|
|
||||||
$site_info = Context::get('site_module_info');
|
$site_info = Context::get('site_module_info');
|
||||||
$virtual_site = '';
|
$virtual_site = '';
|
||||||
if($site_info->site_srl)
|
if($site_info->site_srl)
|
||||||
|
|
@ -495,97 +494,361 @@ class adminAdminController extends admin
|
||||||
}
|
}
|
||||||
$this->setMessage('success_deleted');
|
$this->setMessage('success_deleted');
|
||||||
}
|
}
|
||||||
|
|
||||||
function procAdminUpdateSitelock()
|
/**
|
||||||
|
* Update general configuration.
|
||||||
|
*/
|
||||||
|
function procAdminUpdateConfigGeneral()
|
||||||
|
{
|
||||||
|
$oModuleController = getController('module');
|
||||||
|
$vars = Context::getRequestVars();
|
||||||
|
|
||||||
|
// Site title and HTML footer
|
||||||
|
$args = new stdClass;
|
||||||
|
$args->siteTitle = escape($vars->site_title);
|
||||||
|
$args->htmlFooter = escape($vars->html_footer);
|
||||||
|
$oModuleController->updateModuleConfig('module', $args);
|
||||||
|
|
||||||
|
// Index module
|
||||||
|
$site_args = new stdClass();
|
||||||
|
$site_args->site_srl = 0;
|
||||||
|
$site_args->index_module_srl = $vars->index_module_srl;
|
||||||
|
$site_args->default_language = $vars->default_lang;
|
||||||
|
$oModuleController->updateSite($site_args);
|
||||||
|
|
||||||
|
// Thumbnail settings
|
||||||
|
$args = new stdClass;
|
||||||
|
$args->thumbnail_type = $vars->thumbnail_type === 'ratio' ? 'ratio' : 'crop';
|
||||||
|
$oModuleController->insertModuleConfig('document', $args);
|
||||||
|
|
||||||
|
// Default and enabled languages
|
||||||
|
$enabled_lang = $vars->enabled_lang;
|
||||||
|
if (!in_array($vars->default_lang, $enabled_lang))
|
||||||
|
{
|
||||||
|
$enabled_lang[] = $vars->default_lang;
|
||||||
|
}
|
||||||
|
Rhymix\Framework\Config::set('locale.default_lang', $vars->default_lang);
|
||||||
|
Rhymix\Framework\Config::set('locale.enabled_lang', array_values($enabled_lang));
|
||||||
|
|
||||||
|
// Default time zone
|
||||||
|
Rhymix\Framework\Config::set('locale.default_timezone', $vars->default_timezone);
|
||||||
|
|
||||||
|
// Mobile view
|
||||||
|
Rhymix\Framework\Config::set('use_mobile_view', $vars->use_mobile_view === 'Y');
|
||||||
|
|
||||||
|
// Favicon and mobicon
|
||||||
|
$this->_saveFavicon('favicon.ico', $vars->is_delete_favicon);
|
||||||
|
$this->_saveFavicon('mobicon.png', $vars->is_delete_mobicon);
|
||||||
|
|
||||||
|
// Save
|
||||||
|
Rhymix\Framework\Config::save();
|
||||||
|
|
||||||
|
$this->setMessage('success_updated');
|
||||||
|
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update security configuration.
|
||||||
|
*/
|
||||||
|
function procAdminUpdateSecurity()
|
||||||
{
|
{
|
||||||
$vars = Context::getRequestVars();
|
$vars = Context::getRequestVars();
|
||||||
$oInstallController = getController('install');
|
|
||||||
|
// iframe filter
|
||||||
$db_info = Context::getDBInfo();
|
$embed_iframe = $vars->embedfilter_iframe;
|
||||||
|
$embed_iframe = array_filter(array_map('trim', preg_split('/[\r\n]/', $embed_iframe)), function($item) {
|
||||||
$db_info->use_sitelock = ($vars->use_sitelock) ? $vars->use_sitelock : 'N';
|
return $item !== '';
|
||||||
$db_info->sitelock_title = $vars->sitelock_title;
|
});
|
||||||
$db_info->sitelock_message = $vars->sitelock_message;
|
$embed_iframe = array_unique(array_map(function($item) {
|
||||||
|
return preg_match('@^https?://(.*)$@i', $item, $matches) ? $matches[1] : $item;
|
||||||
$whitelist = $vars->sitelock_whitelist;
|
}, $embed_iframe));
|
||||||
$whitelist = preg_replace("/[\r|\n|\r\n]+/",",",$whitelist);
|
natcasesort($embed_iframe);
|
||||||
$whitelist = preg_replace("/\s+/","",$whitelist);
|
Rhymix\Framework\Config::set('embedfilter.iframe', array_values($embed_iframe));
|
||||||
if(preg_match('/(<\?|<\?php|\?>)/xsm', $whitelist))
|
|
||||||
{
|
// object filter
|
||||||
$whitelist = '';
|
$embed_object = $vars->embedfilter_object;
|
||||||
}
|
$embed_object = array_filter(array_map('trim', preg_split('/[\r\n]/', $embed_object)), function($item) {
|
||||||
$whitelist .= ',127.0.0.1,' . $_SERVER['REMOTE_ADDR'];
|
return $item !== '';
|
||||||
$whitelist = explode(',',trim($whitelist, ','));
|
});
|
||||||
$whitelist = array_unique($whitelist);
|
$embed_object = array_unique(array_map(function($item) {
|
||||||
|
return preg_match('@^https?://(.*)$@i', $item, $matches) ? $matches[1] : $item;
|
||||||
if(!IpFilter::validate($whitelist)) {
|
}, $embed_object));
|
||||||
|
natcasesort($embed_object);
|
||||||
|
Rhymix\Framework\Config::set('embedfilter.object', array_values($embed_object));
|
||||||
|
|
||||||
|
// Admin IP access control
|
||||||
|
$allowed_ip = array_map('trim', preg_split('/[\r\n]/', $vars->admin_allowed_ip));
|
||||||
|
$allowed_ip = array_unique(array_filter($allowed_ip, function($item) {
|
||||||
|
return $item !== '';
|
||||||
|
}));
|
||||||
|
if (!IpFilter::validate($whitelist)) {
|
||||||
return new Object(-1, 'msg_invalid_ip');
|
return new Object(-1, 'msg_invalid_ip');
|
||||||
}
|
}
|
||||||
|
Rhymix\Framework\Config::set('admin.allow', array_values($allowed_ip));
|
||||||
$db_info->sitelock_whitelist = $whitelist;
|
|
||||||
|
// Save
|
||||||
$oInstallController = getController('install');
|
Rhymix\Framework\Config::save();
|
||||||
if(!$oInstallController->makeConfigFile())
|
|
||||||
{
|
$this->setMessage('success_updated');
|
||||||
return new Object(-1, 'msg_invalid_request');
|
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'act', 'dispAdminConfigSecurity'));
|
||||||
}
|
|
||||||
|
|
||||||
if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON')))
|
|
||||||
{
|
|
||||||
$returnUrl = Context::get('success_return_url');
|
|
||||||
if(!$returnUrl) $returnUrl = getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral');
|
|
||||||
header('location:' . $returnUrl);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function procAdminUpdateEmbedWhitelist()
|
/**
|
||||||
|
* Update advanced configuration.
|
||||||
|
*/
|
||||||
|
function procAdminUpdateAdvanced()
|
||||||
{
|
{
|
||||||
$vars = Context::getRequestVars();
|
$vars = Context::getRequestVars();
|
||||||
|
|
||||||
$db_info = Context::getDBInfo();
|
// Default URL
|
||||||
|
$default_url = rtrim(trim($vars->default_url), '/\\') . '/';
|
||||||
$white_object = $vars->embed_white_object;
|
if (!filter_var($default_url, FILTER_VALIDATE_URL) || !preg_match('@^https?://@', $default_url))
|
||||||
$white_object = preg_replace("/[\r\n|\r|\n]+/", '|@|', $white_object);
|
|
||||||
$white_object = preg_replace("/[\s\'\"]+/", '', $white_object);
|
|
||||||
$white_object = explode('|@|', $white_object);
|
|
||||||
$white_object = array_unique(array_map(function($item) {
|
|
||||||
return preg_match('@^https?://(.*)$@i', $item, $matches) ? $matches[1] : $item;
|
|
||||||
}, $white_object));
|
|
||||||
natcasesort($white_object);
|
|
||||||
|
|
||||||
$white_iframe = $vars->embed_white_iframe;
|
|
||||||
$white_iframe = preg_replace("/[\r\n|\r|\n]+/", '|@|', $white_iframe);
|
|
||||||
$white_iframe = preg_replace("/[\s\'\"]+/", '', $white_iframe);
|
|
||||||
$white_iframe = explode('|@|', $white_iframe);
|
|
||||||
$white_iframe = array_unique(array_map(function($item) {
|
|
||||||
return preg_match('@^https?://(.*)$@i', $item, $matches) ? $matches[1] : $item;
|
|
||||||
}, $white_iframe));
|
|
||||||
natcasesort($white_iframe);
|
|
||||||
|
|
||||||
$whitelist = array(
|
|
||||||
'object' => $white_object,
|
|
||||||
'iframe' => $white_iframe,
|
|
||||||
);
|
|
||||||
|
|
||||||
$db_info->embed_white_object = $white_object;
|
|
||||||
$db_info->embed_white_iframe = $white_iframe;
|
|
||||||
|
|
||||||
$oInstallController = getController('install');
|
|
||||||
if(!$oInstallController->makeConfigFile())
|
|
||||||
{
|
{
|
||||||
return new Object(-1, 'msg_invalid_request');
|
return new Object(-1, 'msg_invalid_default_url');
|
||||||
|
}
|
||||||
|
if (parse_url($default_url, PHP_URL_PATH) !== RX_BASEURL)
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_invalid_default_url');
|
||||||
|
}
|
||||||
|
Rhymix\Framework\Config::set('url.default', $vars->default_url);
|
||||||
|
|
||||||
|
// SSL and ports
|
||||||
|
if ($vars->http_port == 80) $vars->http_port = null;
|
||||||
|
if ($vars->https_port == 443) $vars->https_port = null;
|
||||||
|
Rhymix\Framework\Config::set('url.http_port', $vars->http_port ?: null);
|
||||||
|
Rhymix\Framework\Config::set('url.https_port', $vars->https_port ?: null);
|
||||||
|
Rhymix\Framework\Config::set('url.ssl', $vars->use_ssl ?: 'none');
|
||||||
|
|
||||||
|
// Other settings
|
||||||
|
Rhymix\Framework\Config::set('use_mobile_view', $vars->use_mobile_view === 'Y');
|
||||||
|
Rhymix\Framework\Config::set('use_rewrite', $vars->use_rewrite === 'Y');
|
||||||
|
Rhymix\Framework\Config::set('use_sso', $vars->use_sso === 'Y');
|
||||||
|
Rhymix\Framework\Config::set('session.delay', $vars->delay_session === 'Y');
|
||||||
|
Rhymix\Framework\Config::set('session.use_db', $vars->use_db_session === 'Y');
|
||||||
|
Rhymix\Framework\Config::set('view.minify_scripts', $vars->minify_scripts ?: 'common');
|
||||||
|
Rhymix\Framework\Config::set('view.gzip', $vars->use_gzip === 'Y');
|
||||||
|
|
||||||
|
// Save
|
||||||
|
Rhymix\Framework\Config::save();
|
||||||
|
|
||||||
|
$this->setMessage('success_updated');
|
||||||
|
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'act', 'dispAdminConfigAdvanced'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update sitelock configuration.
|
||||||
|
*/
|
||||||
|
function procAdminUpdateSitelock()
|
||||||
|
{
|
||||||
|
$vars = Context::gets('sitelock_locked', 'sitelock_allowed_ip', 'sitelock_title', 'sitelock_message');
|
||||||
|
|
||||||
|
$allowed_ip = array_map('trim', preg_split('/[\r\n]/', $vars->sitelock_allowed_ip));
|
||||||
|
$allowed_ip = array_unique(array_filter($allowed_ip, function($item) {
|
||||||
|
return $item !== '';
|
||||||
|
}));
|
||||||
|
if (!in_array(RX_CLIENT_IP, $allowed_ip)) array_unshift($allowed_ip, RX_CLIENT_IP);
|
||||||
|
if (!in_array('127.0.0.1', $allowed_ip)) array_unshift($allowed_ip, '127.0.0.1');
|
||||||
|
if (!IpFilter::validate($whitelist)) {
|
||||||
|
return new Object(-1, 'msg_invalid_ip');
|
||||||
|
}
|
||||||
|
|
||||||
|
Rhymix\Framework\Config::set('lock.locked', $vars->sitelock_locked === 'Y');
|
||||||
|
Rhymix\Framework\Config::set('lock.title', trim($vars->sitelock_title));
|
||||||
|
Rhymix\Framework\Config::set('lock.message', trim($vars->sitelock_message));
|
||||||
|
Rhymix\Framework\Config::set('lock.allow', array_values($allowed_ip));
|
||||||
|
Rhymix\Framework\Config::save();
|
||||||
|
|
||||||
|
$this->setMessage('success_updated');
|
||||||
|
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'act', 'dispAdminConfigSitelock'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update FTP configuration.
|
||||||
|
*/
|
||||||
|
function procAdminUpdateFTPInfo()
|
||||||
|
{
|
||||||
|
$vars = Context::getRequestVars();
|
||||||
|
$vars->ftp_path = str_replace('\\', '/', rtrim(trim($vars->ftp_path), '/\\')) . '/';
|
||||||
|
if (strlen($vars->ftp_pass) === 0)
|
||||||
|
{
|
||||||
|
$vars->ftp_pass = Rhymix\Framework\Config::get('ftp.pass');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test FTP connection.
|
||||||
|
if ($vars->ftp_sftp !== 'Y')
|
||||||
|
{
|
||||||
|
if (!($conn = @ftp_connect($vars->ftp_host, $vars->ftp_port, 3)))
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_ftp_not_connected');
|
||||||
|
}
|
||||||
|
if (!@ftp_login($conn, $vars->ftp_user, $vars->ftp_pass))
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||||
|
}
|
||||||
|
if (!@ftp_pasv($conn, $vars->ftp_pasv === 'Y'))
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_ftp_cannot_set_passive_mode');
|
||||||
|
}
|
||||||
|
if (!@ftp_chdir($conn, $vars->ftp_path))
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_ftp_invalid_path');
|
||||||
|
}
|
||||||
|
ftp_close($conn);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!function_exists('ssh2_connect'))
|
||||||
|
{
|
||||||
|
return new Object(-1, 'disable_sftp_support');
|
||||||
|
}
|
||||||
|
if (!($conn = ssh2_connect($vars->ftp_host, $vars->ftp_port)))
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_ftp_not_connected');
|
||||||
|
}
|
||||||
|
if (!@ssh2_auth_password($conn, $vars->ftp_user, $vars->ftp_pass))
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_ftp_invalid_auth_info');
|
||||||
|
}
|
||||||
|
if (!@($sftp = ssh2_sftp($conn)))
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_ftp_sftp_error');
|
||||||
|
}
|
||||||
|
if (!@ssh2_sftp_stat($sftp, $vars->ftp_path . 'common/defaults/config.php'))
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_ftp_invalid_path');
|
||||||
|
}
|
||||||
|
unset($sftp, $conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save settings.
|
||||||
|
Rhymix\Framework\Config::set('ftp.host', $vars->ftp_host);
|
||||||
|
Rhymix\Framework\Config::set('ftp.port', $vars->ftp_port);
|
||||||
|
Rhymix\Framework\Config::set('ftp.user', $vars->ftp_user);
|
||||||
|
Rhymix\Framework\Config::set('ftp.pass', $vars->ftp_pass);
|
||||||
|
Rhymix\Framework\Config::set('ftp.path', $vars->ftp_path);
|
||||||
|
Rhymix\Framework\Config::set('ftp.pasv', $vars->ftp_pasv === 'Y');
|
||||||
|
Rhymix\Framework\Config::set('ftp.sftp', $vars->ftp_sftp === 'Y');
|
||||||
|
Rhymix\Framework\Config::save();
|
||||||
|
|
||||||
|
$this->setMessage('success_updated');
|
||||||
|
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'act', 'dispAdminConfigFtp'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove FTP configuration.
|
||||||
|
*/
|
||||||
|
function procAdminRemoveFTPInfo()
|
||||||
|
{
|
||||||
|
Rhymix\Framework\Config::set('ftp.host', null);
|
||||||
|
Rhymix\Framework\Config::set('ftp.port', null);
|
||||||
|
Rhymix\Framework\Config::set('ftp.user', null);
|
||||||
|
Rhymix\Framework\Config::set('ftp.pass', null);
|
||||||
|
Rhymix\Framework\Config::set('ftp.path', null);
|
||||||
|
Rhymix\Framework\Config::set('ftp.pasv', true);
|
||||||
|
Rhymix\Framework\Config::set('ftp.sftp', false);
|
||||||
|
Rhymix\Framework\Config::save();
|
||||||
|
$this->setMessage('success_deleted');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upload favicon and mobicon.
|
||||||
|
*/
|
||||||
|
public function procAdminFaviconUpload()
|
||||||
|
{
|
||||||
|
if ($favicon = Context::get('favicon'))
|
||||||
|
{
|
||||||
|
$name = 'favicon';
|
||||||
|
$tmpFileName = $this->_saveFaviconTemp($favicon, 'favicon.ico');
|
||||||
|
}
|
||||||
|
elseif ($mobicon = Context::get('mobicon'))
|
||||||
|
{
|
||||||
|
$name = 'mobicon';
|
||||||
|
$tmpFileName = $this->_saveFaviconTemp($mobicon, 'mobicon.png');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$name = $tmpFileName = '';
|
||||||
|
Context::set('msg', Context::getLang('msg_invalid_format'));
|
||||||
|
}
|
||||||
|
|
||||||
|
Context::set('name', $name);
|
||||||
|
Context::set('tmpFileName', $tmpFileName . '?' . time());
|
||||||
|
$this->setTemplatePath($this->module_path . 'tpl');
|
||||||
|
$this->setTemplateFile("favicon_upload.html");
|
||||||
|
}
|
||||||
|
|
||||||
|
private function _saveFaviconTemp($icon, $iconname)
|
||||||
|
{
|
||||||
|
$site_info = Context::get('site_module_info');
|
||||||
|
$virtual_site = '';
|
||||||
|
if ($site_info->site_srl)
|
||||||
|
{
|
||||||
|
$virtual_site = $site_info->site_srl . '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON')))
|
$original_filename = $icon['tmp_name'];
|
||||||
|
$type = $icon['type'];
|
||||||
|
$relative_filename = 'files/attach/xeicon/'.$virtual_site.'tmp/'.$iconname;
|
||||||
|
$target_filename = RX_BASEDIR . $relative_filename;
|
||||||
|
|
||||||
|
list($width, $height, $type_no, $attrs) = @getimagesize($original_filename);
|
||||||
|
if ($iconname == 'favicon.ico')
|
||||||
{
|
{
|
||||||
$returnUrl = Context::get('success_return_url');
|
if(!preg_match('/^.*(x-icon|\.icon)$/i',$type)) {
|
||||||
if(!$returnUrl) $returnUrl = getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral');
|
Context::set('msg', '*.ico '.Context::getLang('msg_possible_only_file'));
|
||||||
header('location:' . $returnUrl);
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($iconname == 'mobicon.png')
|
||||||
|
{
|
||||||
|
if (!preg_match('/^.*(png).*$/',$type))
|
||||||
|
{
|
||||||
|
Context::set('msg', '*.png '.Context::getLang('msg_possible_only_file'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!(($height == '57' && $width == '57') || ($height == '114' && $width == '114')))
|
||||||
|
{
|
||||||
|
Context::set('msg', Context::getLang('msg_invalid_format').' (size : 57x57, 114x114)');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Context::set('msg', Context::getLang('msg_invalid_format'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$fitHeight = $fitWidth = $height;
|
||||||
|
FileHandler::copyFile($original_filename, $target_filename);
|
||||||
|
return $relative_filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function _saveFavicon($iconname, $deleteIcon = false)
|
||||||
|
{
|
||||||
|
$site_info = Context::get('site_module_info');
|
||||||
|
$virtual_site = '';
|
||||||
|
if ($site_info->site_srl)
|
||||||
|
{
|
||||||
|
$virtual_site = $site_info->site_srl . '/';
|
||||||
|
}
|
||||||
|
|
||||||
|
$image_filepath = RX_BASEDIR . 'files/attach/xeicon/' . $virtual_site;
|
||||||
|
|
||||||
|
if ($deleteIcon)
|
||||||
|
{
|
||||||
|
FileHandler::removeFile($image_filepath.$iconname);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tmpicon_filepath = $image_filepath.'tmp/'.$iconname;
|
||||||
|
$icon_filepath = $image_filepath.$iconname;
|
||||||
|
if (file_exists($tmpicon_filepath))
|
||||||
|
{
|
||||||
|
FileHandler::moveFile($tmpicon_filepath, $icon_filepath);
|
||||||
|
}
|
||||||
|
|
||||||
|
FileHandler::removeFile($tmpicon_filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/* End of file admin.admin.controller.php */
|
/* End of file admin.admin.controller.php */
|
||||||
/* Location: ./modules/admin/admin.admin.controller.php */
|
/* Location: ./modules/admin/admin.admin.controller.php */
|
||||||
|
|
|
||||||
|
|
@ -401,7 +401,6 @@ class adminAdminModel extends admin
|
||||||
, 'widgetstyle' => array(),
|
, 'widgetstyle' => array(),
|
||||||
);
|
);
|
||||||
$info = array();
|
$info = array();
|
||||||
$db_info = Context::getDBInfo();
|
|
||||||
|
|
||||||
$info['type'] = ($type != 'INSTALL' ? 'WORKING' : 'INSTALL');
|
$info['type'] = ($type != 'INSTALL' ? 'WORKING' : 'INSTALL');
|
||||||
$info['location'] = _XE_LOCATION_;
|
$info['location'] = _XE_LOCATION_;
|
||||||
|
|
@ -412,9 +411,9 @@ class adminAdminModel extends admin
|
||||||
$info['php'] = phpversion();
|
$info['php'] = phpversion();
|
||||||
|
|
||||||
$info['db_type'] = Context::getDBType();
|
$info['db_type'] = Context::getDBType();
|
||||||
$info['use_rewrite'] = $db_info->use_rewrite;
|
$info['use_rewrite'] = config('use_rewrite') ? 'Y' : 'N';
|
||||||
$info['use_db_session'] = $db_info->use_db_session == 'Y' ? 'Y' : 'N';
|
$info['use_db_session'] = config('session.use_db') ? 'Y' : 'N';
|
||||||
$info['use_ssl'] = $db_info->use_ssl;
|
$info['use_ssl'] = config('url.ssl') ?: 'none';
|
||||||
|
|
||||||
$info['phpext'] = '';
|
$info['phpext'] = '';
|
||||||
foreach(get_loaded_extensions() as $ext)
|
foreach(get_loaded_extensions() as $ext)
|
||||||
|
|
|
||||||
|
|
@ -26,17 +26,7 @@ class adminAdminView extends admin
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
$db_info = Context::getDBInfo();
|
Context::set('xe_default_url', Context::getDefaultUrl());
|
||||||
|
|
||||||
if(strpos($db_info->default_url, 'xn--') !== FALSE)
|
|
||||||
{
|
|
||||||
$xe_default_url = Context::decodeIdna($db_info->default_url);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$xe_default_url = $db_info->default_url;
|
|
||||||
}
|
|
||||||
Context::set('xe_default_url', $xe_default_url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -61,30 +51,6 @@ class adminAdminView extends admin
|
||||||
$this->makeGnbUrl();
|
$this->makeGnbUrl();
|
||||||
|
|
||||||
// Retrieve the list of installed modules
|
// Retrieve the list of installed modules
|
||||||
|
|
||||||
$db_info = Context::getDBInfo();
|
|
||||||
|
|
||||||
Context::set('time_zone_list', $GLOBALS['time_zone']);
|
|
||||||
Context::set('time_zone', $GLOBALS['_time_zone']);
|
|
||||||
Context::set('use_rewrite', $db_info->use_rewrite == 'Y' ? 'Y' : 'N');
|
|
||||||
Context::set('use_sso', $db_info->use_sso == 'Y' ? 'Y' : 'N');
|
|
||||||
Context::set('use_html5', $db_info->use_html5 == 'Y' ? 'Y' : 'N');
|
|
||||||
Context::set('use_spaceremover', $db_info->use_spaceremover ? $db_info->use_spaceremover : 'Y'); //not use
|
|
||||||
Context::set('qmail_compatibility', $db_info->qmail_compatibility == 'Y' ? 'Y' : 'N');
|
|
||||||
Context::set('minify_scripts', $db_info->minify_scripts ?: 'common');
|
|
||||||
Context::set('delay_session', $db_info->delay_session == 'Y' ? 'Y' : 'N');
|
|
||||||
Context::set('use_db_session', $db_info->use_db_session == 'N' ? 'N' : 'Y');
|
|
||||||
Context::set('use_mobile_view', $db_info->use_mobile_view == 'Y' ? 'Y' : 'N');
|
|
||||||
Context::set('use_ssl', $db_info->use_ssl ? $db_info->use_ssl : "none");
|
|
||||||
if($db_info->http_port)
|
|
||||||
{
|
|
||||||
Context::set('http_port', $db_info->http_port);
|
|
||||||
}
|
|
||||||
if($db_info->https_port)
|
|
||||||
{
|
|
||||||
Context::set('https_port', $db_info->https_port);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->checkEasyinstall();
|
$this->checkEasyinstall();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -262,9 +228,6 @@ class adminAdminView extends admin
|
||||||
*/
|
*/
|
||||||
function dispAdminIndex()
|
function dispAdminIndex()
|
||||||
{
|
{
|
||||||
$db_info = Context::getDBInfo();
|
|
||||||
Context::set('db_info',$db_info);
|
|
||||||
|
|
||||||
// Get statistics
|
// Get statistics
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
$args->date = date("Ymd000000", $_SERVER['REQUEST_TIME'] - 60 * 60 * 24);
|
$args->date = date("Ymd000000", $_SERVER['REQUEST_TIME'] - 60 * 60 * 24);
|
||||||
|
|
@ -403,95 +366,132 @@ class adminAdminView extends admin
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display Configuration(settings) page
|
* Display General Settings page
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function dispAdminConfigGeneral()
|
function dispAdminConfigGeneral()
|
||||||
{
|
{
|
||||||
Context::loadLang('modules/install/lang');
|
// Default and enabled languages
|
||||||
|
Context::set('supported_lang', Rhymix\Framework\Lang::getSupportedList());
|
||||||
$db_info = Context::getDBInfo();
|
Context::set('default_lang', Rhymix\Framework\Config::get('locale.default_lang'));
|
||||||
|
Context::set('enabled_lang', Rhymix\Framework\Config::get('locale.enabled_lang'));
|
||||||
Context::set('selected_lang', $db_info->lang_type);
|
|
||||||
|
// Site title and HTML footer
|
||||||
if(strpos($db_info->default_url, 'xn--') !== FALSE)
|
$oModuleModel = getModel('module');
|
||||||
{
|
$config = $oModuleModel->getModuleConfig('module');
|
||||||
$db_info->default_url = Context::decodeIdna($db_info->default_url);
|
Context::set('site_title', escape($config->siteTitle));
|
||||||
}
|
Context::set('html_footer', escape($config->htmlFooter));
|
||||||
Context::set('default_url', $db_info->default_url);
|
|
||||||
Context::set('langs', Context::loadLangSupported());
|
// Index module
|
||||||
|
$columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl');
|
||||||
// site lock
|
$start_module = $oModuleModel->getSiteInfo(0, $columnList);
|
||||||
Context::set('IP', $_SERVER['REMOTE_ADDR']);
|
Context::set('start_module', $start_module);
|
||||||
if(!$db_info->sitelock_title) $db_info->sitelock_title = 'Maintenance in progress...';
|
|
||||||
if(!in_array('127.0.0.1', $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = '127.0.0.1';
|
// Thumbnail settings
|
||||||
if(!in_array($_SERVER['REMOTE_ADDR'], $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = $_SERVER['REMOTE_ADDR'];
|
$oDocumentModel = getModel('document');
|
||||||
$db_info->sitelock_whitelist = array_unique($db_info->sitelock_whitelist);
|
$config = $oDocumentModel->getDocumentConfig();
|
||||||
Context::set('remote_addr', $_SERVER['REMOTE_ADDR']);
|
Context::set('thumbnail_type', $config->thumbnail_type ?: 'crop');
|
||||||
Context::set('use_sitelock', $db_info->use_sitelock);
|
|
||||||
Context::set('sitelock_title', $db_info->sitelock_title);
|
// Default time zone
|
||||||
Context::set('sitelock_message', htmlspecialchars($db_info->sitelock_message, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
|
Context::set('timezones', Rhymix\Framework\DateTime::getTimezoneList());
|
||||||
|
Context::set('selected_timezone', Rhymix\Framework\Config::get('locale.default_timezone'));
|
||||||
$whitelist = implode("\r\n", $db_info->sitelock_whitelist);
|
|
||||||
Context::set('sitelock_whitelist', $whitelist);
|
// Mobile view
|
||||||
|
Context::set('use_mobile_view', config('use_mobile_view') ? 'Y' : 'N');
|
||||||
|
|
||||||
if($db_info->admin_ip_list) $admin_ip_list = implode("\r\n", $db_info->admin_ip_list);
|
// Favicon and mobicon
|
||||||
else $admin_ip_list = '';
|
|
||||||
Context::set('admin_ip_list', $admin_ip_list);
|
|
||||||
|
|
||||||
Context::set('lang_selected', Context::loadLangSelected());
|
|
||||||
|
|
||||||
$oAdminModel = getAdminModel('admin');
|
$oAdminModel = getAdminModel('admin');
|
||||||
$favicon_url = $oAdminModel->getFaviconUrl();
|
$favicon_url = $oAdminModel->getFaviconUrl();
|
||||||
$mobicon_url = $oAdminModel->getMobileIconUrl();
|
$mobicon_url = $oAdminModel->getMobileIconUrl();
|
||||||
Context::set('favicon_url', $favicon_url.'?'.$_SERVER['REQUEST_TIME']);
|
Context::set('favicon_url', $favicon_url.'?'.$_SERVER['REQUEST_TIME']);
|
||||||
Context::set('mobicon_url', $mobicon_url.'?'.$_SERVER['REQUEST_TIME']);
|
Context::set('mobicon_url', $mobicon_url.'?'.$_SERVER['REQUEST_TIME']);
|
||||||
|
|
||||||
$oDocumentModel = getModel('document');
|
|
||||||
$config = $oDocumentModel->getDocumentConfig();
|
|
||||||
Context::set('thumbnail_type', $config->thumbnail_type);
|
|
||||||
|
|
||||||
|
|
||||||
$oModuleModel = getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('module');
|
|
||||||
Context::set('siteTitle', $config->siteTitle);
|
|
||||||
Context::set('htmlFooter', htmlspecialchars($config->htmlFooter));
|
|
||||||
|
|
||||||
// embed filter
|
|
||||||
$oEmbedFilter = EmbedFilter::getInstance();
|
|
||||||
context::set('embed_white_object', implode(PHP_EOL, $oEmbedFilter->whiteUrlList));
|
|
||||||
context::set('embed_white_iframe', implode(PHP_EOL, $oEmbedFilter->whiteIframeUrlList));
|
|
||||||
|
|
||||||
$columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl');
|
|
||||||
$start_module = $oModuleModel->getSiteInfo(0, $columnList);
|
|
||||||
Context::set('start_module', $start_module);
|
|
||||||
|
|
||||||
Context::set('pwd', $pwd);
|
|
||||||
$this->setTemplateFile('config_general');
|
$this->setTemplateFile('config_general');
|
||||||
|
|
||||||
$security = new Security();
|
|
||||||
$security->encodeHTML('news..', 'released_version', 'download_link', 'selected_lang', 'module_list..', 'module_list..author..', 'addon_list..', 'addon_list..author..', 'start_module.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display Security Settings page
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function dispAdminConfigSecurity()
|
||||||
|
{
|
||||||
|
// Load embed filter.
|
||||||
|
$oEmbedFilter = EmbedFilter::getInstance();
|
||||||
|
context::set('embedfilter_iframe', implode(PHP_EOL, $oEmbedFilter->whiteIframeUrlList));
|
||||||
|
context::set('embedfilter_object', implode(PHP_EOL, $oEmbedFilter->whiteUrlList));
|
||||||
|
|
||||||
|
// Admin IP access control
|
||||||
|
$allowed_ip = Rhymix\Framework\Config::get('admin.allow');
|
||||||
|
Context::set('admin_allowed_ip', implode(PHP_EOL, $allowed_ip));
|
||||||
|
$denied_ip = Rhymix\Framework\Config::get('admin.deny');
|
||||||
|
Context::set('admin_denied_ip', implode(PHP_EOL, $denied_ip));
|
||||||
|
Context::set('remote_addr', RX_CLIENT_IP);
|
||||||
|
|
||||||
|
$this->setTemplateFile('config_security');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display Advanced Settings page
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function dispAdminConfigAdvanced()
|
||||||
|
{
|
||||||
|
// Default URL
|
||||||
|
$default_url = Rhymix\Framework\Config::get('url.default');
|
||||||
|
if(strpos($default_url, 'xn--') !== FALSE)
|
||||||
|
{
|
||||||
|
$default_url = Context::decodeIdna($default_url);
|
||||||
|
}
|
||||||
|
Context::set('default_url', $default_url);
|
||||||
|
|
||||||
|
// SSL and ports
|
||||||
|
Context::set('use_ssl', Rhymix\Framework\Config::get('url.ssl') ?: 'none');
|
||||||
|
Context::set('http_port', Rhymix\Framework\Config::get('url.http_port'));
|
||||||
|
Context::set('https_port', Rhymix\Framework\Config::get('url.https_port'));
|
||||||
|
|
||||||
|
// Other settings
|
||||||
|
Context::set('use_mobile_view', Rhymix\Framework\Config::get('use_mobile_view'));
|
||||||
|
Context::set('use_rewrite', Rhymix\Framework\Config::get('use_rewrite'));
|
||||||
|
Context::set('use_sso', Rhymix\Framework\Config::get('use_sso'));
|
||||||
|
Context::set('delay_session', Rhymix\Framework\Config::get('session.delay'));
|
||||||
|
Context::set('use_db_session', Rhymix\Framework\Config::get('session.use_db'));
|
||||||
|
Context::set('minify_scripts', Rhymix\Framework\Config::get('view.minify_scripts'));
|
||||||
|
Context::set('use_gzip', Rhymix\Framework\Config::get('view.gzip'));
|
||||||
|
|
||||||
|
$this->setTemplateFile('config_advanced');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display Sitelock Settings page
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function dispAdminConfigSitelock()
|
||||||
|
{
|
||||||
|
Context::set('sitelock_locked', Rhymix\Framework\Config::get('lock.locked'));
|
||||||
|
Context::set('sitelock_title', escape(Rhymix\Framework\Config::get('lock.title')));
|
||||||
|
Context::set('sitelock_message', escape(Rhymix\Framework\Config::get('lock.message')));
|
||||||
|
|
||||||
|
$allowed_ip = Rhymix\Framework\Config::get('lock.allow');
|
||||||
|
if (!in_array('127.0.0.1', $allowed_ip)) $allowed_ip[] = '127.0.0.1';
|
||||||
|
if (!in_array(RX_CLIENT_IP, $allowed_ip)) $allowed_ip[] = RX_CLIENT_IP;
|
||||||
|
Context::set('sitelock_allowed_ip', implode(PHP_EOL, $allowed_ip));
|
||||||
|
Context::set('remote_addr', RX_CLIENT_IP);
|
||||||
|
|
||||||
|
$this->setTemplateFile('config_sitelock');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display FTP Configuration(settings) page
|
* Display FTP Configuration(settings) page
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function dispAdminConfigFtp()
|
function dispAdminConfigFtp()
|
||||||
{
|
{
|
||||||
Context::loadLang('modules/install/lang');
|
Context::set('ftp_info', Rhymix\Framework\Config::get('ftp'));
|
||||||
|
Context::set('sftp_support', function_exists('ssh2_sftp'));
|
||||||
$ftp_info = Context::getFTPInfo();
|
|
||||||
Context::set('ftp_info', $ftp_info);
|
|
||||||
Context::set('sftp_support', function_exists(ssh2_sftp));
|
|
||||||
|
|
||||||
$this->setTemplateFile('config_ftp');
|
$this->setTemplateFile('config_ftp');
|
||||||
|
|
||||||
//$security = new Security();
|
|
||||||
//$security->encodeHTML('ftp_info..');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display Admin Menu Configuration(settings) page
|
* Display Admin Menu Configuration(settings) page
|
||||||
* @return void
|
* @return void
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@
|
||||||
<actions>
|
<actions>
|
||||||
<action name="dispAdminIndex" type="view" index="true" />
|
<action name="dispAdminIndex" type="view" index="true" />
|
||||||
<action name="dispAdminConfigGeneral" type="view" menu_name="adminConfigurationGeneral" menu_index="true" />
|
<action name="dispAdminConfigGeneral" type="view" menu_name="adminConfigurationGeneral" menu_index="true" />
|
||||||
|
<action name="dispAdminConfigSecurity" type="view" menu_name="adminConfigurationGeneral" />
|
||||||
|
<action name="dispAdminConfigAdvanced" type="view" menu_name="adminConfigurationGeneral" />
|
||||||
|
<action name="dispAdminConfigSitelock" type="view" menu_name="adminConfigurationGeneral" />
|
||||||
<action name="dispAdminConfigFtp" type="view" menu_name="adminConfigurationFtp" menu_index="true" />
|
<action name="dispAdminConfigFtp" type="view" menu_name="adminConfigurationFtp" menu_index="true" />
|
||||||
<action name="dispAdminSetup" type="view" menu_name="adminMenuSetup" menu_index="true" />
|
<action name="dispAdminSetup" type="view" menu_name="adminMenuSetup" menu_index="true" />
|
||||||
<action name="dispAdminViewServerEnv" type="view" />
|
<action name="dispAdminViewServerEnv" type="view" />
|
||||||
|
|
@ -18,52 +21,58 @@
|
||||||
<action name="procAdminUpdateConfig" type="controller" />
|
<action name="procAdminUpdateConfig" type="controller" />
|
||||||
<action name="procAdminDeleteLogo" type="controller" />
|
<action name="procAdminDeleteLogo" type="controller" />
|
||||||
<action name="procAdminMenuReset" type="controller" />
|
<action name="procAdminMenuReset" type="controller" />
|
||||||
|
<action name="procAdminUpdateConfigGeneral" type="controller" />
|
||||||
|
<action name="procAdminUpdateSecurity" type="controller" />
|
||||||
|
<action name="procAdminUpdateAdvanced" type="controller" />
|
||||||
<action name="procAdminUpdateSitelock" type="controller" />
|
<action name="procAdminUpdateSitelock" type="controller" />
|
||||||
<action name="procAdminUpdateEmbedWhitelist" type="controller" />
|
<action name="procAdminUpdateFTPInfo" type="controller" />
|
||||||
|
<action name="procAdminRemoveFTPInfo" type="controller" />
|
||||||
|
<action name="procAdminFaviconUpload" type="controller" />
|
||||||
|
|
||||||
<action name="getAdminFTPList" type="model" />
|
|
||||||
<action name="getAdminFTPPath" type="model" />
|
|
||||||
<action name="getSiteAllList" type="model" />
|
<action name="getSiteAllList" type="model" />
|
||||||
</actions>
|
</actions>
|
||||||
<menus>
|
<menus>
|
||||||
<menu name="adminConfigurationGeneral" type="all">
|
<menu name="adminConfigurationGeneral" type="all">
|
||||||
<title xml:lang="en">General</title>
|
<title xml:lang="en">System Settings</title>
|
||||||
<title xml:lang="ko">일반</title>
|
<title xml:lang="ko">시스템 설정</title>
|
||||||
<title xml:lang="zh-CN">总览</title>
|
<title xml:lang="zh-CN">系统设置</title>
|
||||||
<title xml:lang="jp">一般</title>
|
<title xml:lang="zh-TW">系統設置</title>
|
||||||
<title xml:lang="es">General</title>
|
<title xml:lang="jp">システムの設定</title>
|
||||||
<title xml:lang="ru">General</title>
|
<title xml:lang="es">System Settings</title>
|
||||||
<title xml:lang="fr">General</title>
|
<title xml:lang="ru">System Settings</title>
|
||||||
<title xml:lang="zh-TW">General</title>
|
<title xml:lang="fr">System Settings</title>
|
||||||
<title xml:lang="vi">General</title>
|
<title xml:lang="zh-TW">System Settings</title>
|
||||||
<title xml:lang="mn">General</title>
|
<title xml:lang="vi">System Settings</title>
|
||||||
<title xml:lang="tr">General</title>
|
<title xml:lang="mn">System Settings</title>
|
||||||
|
<title xml:lang="tr">System Settings</title>
|
||||||
</menu>
|
</menu>
|
||||||
<menu name="adminMenuSetup" type="all">
|
<menu name="adminMenuSetup" type="all">
|
||||||
<title xml:lang="en">Admin Setup</title>
|
<title xml:lang="en">Admin Panel Settings</title>
|
||||||
<title xml:lang="ko">관리자 설정</title>
|
<title xml:lang="ko">관리자 화면 설정</title>
|
||||||
<title xml:lang="zh-CN">后台设置</title>
|
<title xml:lang="zh-CN">管理者页面设置</title>
|
||||||
<title xml:lang="jp">管理者設定</title>
|
<title xml:lang="zh-TW">管理者頁面設置</title>
|
||||||
<title xml:lang="es">Admin Setup</title>
|
<title xml:lang="jp">管理者画面の設定</title>
|
||||||
<title xml:lang="ru">Admin Setup</title>
|
<title xml:lang="es">Admin Panel Settings</title>
|
||||||
<title xml:lang="fr">Admin Setup</title>
|
<title xml:lang="ru">Admin Panel Settings</title>
|
||||||
<title xml:lang="zh-TW">Admin Setup</title>
|
<title xml:lang="fr">Admin Panel Settings</title>
|
||||||
<title xml:lang="vi">Admin Setup</title>
|
<title xml:lang="zh-TW">Admin Panel Settings</title>
|
||||||
<title xml:lang="mn">Admin Setup</title>
|
<title xml:lang="vi">Admin Panel Settings</title>
|
||||||
<title xml:lang="tr">Admin Setup</title>
|
<title xml:lang="mn">Admin Panel Settings</title>
|
||||||
|
<title xml:lang="tr">Admin Panel Settings</title>
|
||||||
</menu>
|
</menu>
|
||||||
<menu name="adminConfigurationFtp" type="all">
|
<menu name="adminConfigurationFtp" type="all">
|
||||||
<title xml:lang="en">FTP Configuration</title>
|
<title xml:lang="en">FTP Settings</title>
|
||||||
<title xml:lang="ko">FTP 설정</title>
|
<title xml:lang="ko">FTP 설정</title>
|
||||||
<title xml:lang="zh-CN">FTP 配置</title>
|
<title xml:lang="zh-CN">FTP设置</title>
|
||||||
|
<title xml:lang="zh-TW">FTP設置</title>
|
||||||
<title xml:lang="jp">FTP設定</title>
|
<title xml:lang="jp">FTP設定</title>
|
||||||
<title xml:lang="es">FTP Configuration</title>
|
<title xml:lang="es">FTP Settings</title>
|
||||||
<title xml:lang="ru">FTP Configuration</title>
|
<title xml:lang="ru">FTP Settings</title>
|
||||||
<title xml:lang="fr">FTP Configuration</title>
|
<title xml:lang="fr">FTP Settings</title>
|
||||||
<title xml:lang="zh-TW">FTP Configuration</title>
|
<title xml:lang="zh-TW">FTP Settings</title>
|
||||||
<title xml:lang="vi">FTP Configuration</title>
|
<title xml:lang="vi">FTP Settings</title>
|
||||||
<title xml:lang="mn">FTP Configuration</title>
|
<title xml:lang="mn">FTP Settings</title>
|
||||||
<title xml:lang="tr">FTP Configuration</title>
|
<title xml:lang="tr">FTP Settings</title>
|
||||||
</menu>
|
</menu>
|
||||||
</menus>
|
</menus>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
$lang->admin = 'Admin';
|
$lang->admin = 'Admin';
|
||||||
$lang->subtitle_primary = 'Primary';
|
$lang->subtitle_primary = 'General Settings';
|
||||||
$lang->subtitle_advanced = 'Advanced';
|
$lang->subtitle_security = 'Security Settings';
|
||||||
$lang->subtitle_etc = 'Others';
|
$lang->subtitle_advanced = 'Advanced Settings';
|
||||||
|
$lang->subtitle_etc = 'Other Settings';
|
||||||
$lang->current_state = 'Current state';
|
$lang->current_state = 'Current state';
|
||||||
$lang->latest_documents = 'Latest Documents';
|
$lang->latest_documents = 'Latest Documents';
|
||||||
$lang->latest_comments = 'Latest Comments';
|
$lang->latest_comments = 'Latest Comments';
|
||||||
|
|
@ -81,13 +82,19 @@ $lang->cmd_minify_all = 'All files';
|
||||||
$lang->cmd_minify_common = 'Common files only';
|
$lang->cmd_minify_common = 'Common files only';
|
||||||
$lang->cmd_minify_none = 'None';
|
$lang->cmd_minify_none = 'None';
|
||||||
$lang->about_minify_scripts = 'Automatically minify all CSS and JS scripts in the Core and all modules.';
|
$lang->about_minify_scripts = 'Automatically minify all CSS and JS scripts in the Core and all modules.';
|
||||||
|
$lang->use_gzip = 'gzip Compression';
|
||||||
$lang->delay_session = 'Delay session start';
|
$lang->delay_session = 'Delay session start';
|
||||||
$lang->about_delay_session = 'To improve performance when using a caching proxy server such as Varnish, do not issue sessions to visitors until they log in.<br>Selecting this option may cause view counts and visitor counts to become inaccurate.';
|
$lang->about_delay_session = 'To improve performance when using a caching proxy server such as Varnish, do not issue sessions to visitors until they log in.<br>Selecting this option may cause view counts and visitor counts to become inaccurate.';
|
||||||
|
$lang->msg_invalid_default_url = 'The default URL is invalid.';
|
||||||
$lang->sftp = 'Use SFTP';
|
$lang->sftp = 'Use SFTP';
|
||||||
$lang->ftp_get_list = 'Get List';
|
$lang->ftp_get_list = 'Get List';
|
||||||
$lang->ftp_remove_info = 'Remove FTP Info.';
|
$lang->ftp_remove_info = 'Remove FTP Info.';
|
||||||
$lang->msg_find_xe_path_fail = 'Failed to search Rhymix installed path automatically. Please set manually.';
|
$lang->msg_find_xe_path_fail = 'Failed to search Rhymix installed path automatically. Please set manually.';
|
||||||
|
$lang->msg_ftp_not_connected = 'Failed to connect to FTP server. Please check the hostname and port.';
|
||||||
|
$lang->msg_ftp_invalid_auth_info = 'Failed to log in to FTP server. Please check your username and password.';
|
||||||
|
$lang->msg_ftp_cannot_set_passive_mode = 'Failed to set passive mode. Please change your settings and try again.';
|
||||||
$lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.';
|
$lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.';
|
||||||
|
$lang->msg_ftp_sftp_error = 'Failed to initialize SFTP mode after connecting to SSH server.';
|
||||||
$lang->use_ftp_passive_mode = 'Use FTP Passive Mode';
|
$lang->use_ftp_passive_mode = 'Use FTP Passive Mode';
|
||||||
$lang->use_sftp_support = 'Use SFTP';
|
$lang->use_sftp_support = 'Use SFTP';
|
||||||
$lang->disable_sftp_support = 'You should install ssh2 PHP module to use SFTP.';
|
$lang->disable_sftp_support = 'You should install ssh2 PHP module to use SFTP.';
|
||||||
|
|
@ -110,8 +117,8 @@ $lang->corp = 'Crop(Cut)';
|
||||||
$lang->ratio = 'Ratio(Keep Aspect)';
|
$lang->ratio = 'Ratio(Keep Aspect)';
|
||||||
$lang->admin_ip_limit = 'Sepcify IP address band that can access the admin page.';
|
$lang->admin_ip_limit = 'Sepcify IP address band that can access the admin page.';
|
||||||
$lang->local_ip_address = 'Local IP address';
|
$lang->local_ip_address = 'Local IP address';
|
||||||
$lang->about_admin_ip_limit = 'Specify IP address which can access to admin page. Please note that only the specified IP addresses can access the admin page. The information on IP address band is stored in /files/config/db.config.php. Change the line to multiple IP.';
|
$lang->about_admin_ip_limit = 'Specify IP address which can access to admin page. Please note that only the specified IP addresses can access the admin page.';
|
||||||
$lang->detail_about_ftp_info = 'Enable easy installation if you enter FTP information. The information of FTP is stored in files/config/ftp.config.php. If you are unable to easy install, PHP\'s \'safe_mode\' must be changed \'On\'';
|
$lang->detail_about_ftp_info = 'FTP information is needed for easyinstall when save_mode = on.';
|
||||||
$lang->allow_use_favicon = 'Do you want to use favicon?';
|
$lang->allow_use_favicon = 'Do you want to use favicon?';
|
||||||
$lang->about_use_favicon = 'You can upload 16x16 size<em>*.ico</em> file only.';
|
$lang->about_use_favicon = 'You can upload 16x16 size<em>*.ico</em> file only.';
|
||||||
$lang->allow_use_mobile_icon = 'Do you want to use the mobile home screen icon?';
|
$lang->allow_use_mobile_icon = 'Do you want to use the mobile home screen icon?';
|
||||||
|
|
@ -169,6 +176,7 @@ $lang->msg_ftp_connect_success = 'Successfully connected to FTP server and authe
|
||||||
$lang->ftp_path_title = 'FTP Path Information';
|
$lang->ftp_path_title = 'FTP Path Information';
|
||||||
$lang->ftp_installed_realpath = 'Absolute Path of Rhymix';
|
$lang->ftp_installed_realpath = 'Absolute Path of Rhymix';
|
||||||
$lang->msg_ftp_installed_ftp_realpath = 'Absolute FTP Path of Rhymix installed';
|
$lang->msg_ftp_installed_ftp_realpath = 'Absolute FTP Path of Rhymix installed';
|
||||||
|
$lang->msg_ftp_autodetected_ftp_realpath = 'Auto-detected path';
|
||||||
$lang->msg_php_warning_title = 'Warning unsafe PHP version';
|
$lang->msg_php_warning_title = 'Warning unsafe PHP version';
|
||||||
$lang->msg_php_warning_notice = 'The server is using a unsafe version of PHP, it is recommended to upgrade to the latest stable version.';
|
$lang->msg_php_warning_notice = 'The server is using a unsafe version of PHP, it is recommended to upgrade to the latest stable version.';
|
||||||
$lang->msg_php_warning_notice_explain = '<li>PHP version of this server can be exposed to serious security problems and attacks.</li><li>Latest version of Rhymix is not available.</li><li>You can not use extensions that are supported by the latest version of Rhymix.</li><li>Some extensions may not work properly. It can cause problems.</li>';
|
$lang->msg_php_warning_notice_explain = '<li>PHP version of this server can be exposed to serious security problems and attacks.</li><li>Latest version of Rhymix is not available.</li><li>You can not use extensions that are supported by the latest version of Rhymix.</li><li>Some extensions may not work properly. It can cause problems.</li>';
|
||||||
|
|
@ -198,6 +206,6 @@ $lang->sitelock_whitelist = 'IPs allowed to access';
|
||||||
$lang->sitelock_title = 'Sign Title';
|
$lang->sitelock_title = 'Sign Title';
|
||||||
$lang->sitelock_message = 'Sign Contents';
|
$lang->sitelock_message = 'Sign Contents';
|
||||||
$lang->sitelock_message_help = 'You can use HTML tags.';
|
$lang->sitelock_message_help = 'You can use HTML tags.';
|
||||||
$lang->sitelock_warning_whitelist = 'You should include the IP of the administrator here.<br />If the access is blocked, you can unbrick this by changing `\'use_sitelock\' => \'<strong>Y</strong>\'` to `\'use_sitelock\' => \'<strong>N</strong>\'` in \'./files/config/db.config.php.\'<br />The file of site lock design is at \'./common/tpl/sitelock.html.\'';
|
$lang->sitelock_warning_whitelist = 'You should include the IP of the administrator here.';
|
||||||
$lang->your_ip = 'Your IP';
|
$lang->your_ip = 'Your IP';
|
||||||
$lang->sitelock_in_use = 'Site lock in use';
|
$lang->sitelock_in_use = 'Site lock in use';
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
$lang->admin = '管理者';
|
$lang->admin = '管理者';
|
||||||
$lang->subtitle_primary = '基本';
|
$lang->subtitle_primary = '基本設定';
|
||||||
$lang->subtitle_advanced = '上級';
|
$lang->subtitle_security = 'セキュリティ設定';
|
||||||
$lang->subtitle_etc = 'その他';
|
$lang->subtitle_advanced = '上級設定';
|
||||||
|
$lang->subtitle_etc = 'その他設定';
|
||||||
$lang->current_state = '現況';
|
$lang->current_state = '現況';
|
||||||
$lang->latest_documents = '新着書き込み';
|
$lang->latest_documents = '新着書き込み';
|
||||||
$lang->latest_comments = '新着コメント';
|
$lang->latest_comments = '新着コメント';
|
||||||
|
|
@ -81,6 +82,7 @@ $lang->cmd_minify_all = '全てのファイルを圧縮';
|
||||||
$lang->cmd_minify_common = '共通のファイルを圧縮';
|
$lang->cmd_minify_common = '共通のファイルを圧縮';
|
||||||
$lang->cmd_minify_none = '圧縮されません';
|
$lang->cmd_minify_none = '圧縮されません';
|
||||||
$lang->about_minify_scripts = 'コアとすべてのモジュールに含まれたCSS、JSファイルを自動的に圧縮(minify)して配信します。';
|
$lang->about_minify_scripts = 'コアとすべてのモジュールに含まれたCSS、JSファイルを自動的に圧縮(minify)して配信します。';
|
||||||
|
$lang->use_gzip = 'gzip 圧縮';
|
||||||
$lang->delay_session = 'セッションの開始を遅延';
|
$lang->delay_session = 'セッションの開始を遅延';
|
||||||
$lang->about_delay_session = 'Varnishなどのプロキシキャッシュサーバ使用時のパフォーマンスを向上させるために、ログインしていないユーザーには、認証セッションを付与しません。<br>このオプションを選択した場合、訪問者数とヒット集計が正確でない場合があります。';
|
$lang->about_delay_session = 'Varnishなどのプロキシキャッシュサーバ使用時のパフォーマンスを向上させるために、ログインしていないユーザーには、認証セッションを付与しません。<br>このオプションを選択した場合、訪問者数とヒット集計が正確でない場合があります。';
|
||||||
$lang->sftp = 'SFTP使用';
|
$lang->sftp = 'SFTP使用';
|
||||||
|
|
@ -193,5 +195,5 @@ $lang->sitelock_whitelist = '接近許可IP';
|
||||||
$lang->sitelock_title = '案内文タイトル';
|
$lang->sitelock_title = '案内文タイトル';
|
||||||
$lang->sitelock_message = '案内文内容';
|
$lang->sitelock_message = '案内文内容';
|
||||||
$lang->sitelock_message_help = 'HTMLタグを使用できます。';
|
$lang->sitelock_message_help = 'HTMLタグを使用できます。';
|
||||||
$lang->sitelock_warning_whitelist = 'ここに管理者のIPを必ず記入てください。<br />もし接近が遮断された場合、\'./files/config/db.config.php\' ファイルから `\'use_sitelock\' => \'<strong>Y</strong>\'`を `\'use_sitelock\' => \'<strong>N</strong>\'`へ変更すれば遮断が解除できます。<br />サイトロックの設計ファイルの場所は、\'./commo/tpl/sitelock.html\' です。';
|
$lang->sitelock_warning_whitelist = 'ここに管理者のIPを必ず記入てください。';
|
||||||
$lang->your_ip = '接続したIP';
|
$lang->your_ip = '接続したIP';
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
$lang->admin = '관리자';
|
$lang->admin = '관리자';
|
||||||
$lang->subtitle_primary = '기본';
|
$lang->subtitle_primary = '기본 설정';
|
||||||
$lang->subtitle_advanced = '고급';
|
$lang->subtitle_security = '보안 설정';
|
||||||
|
$lang->subtitle_advanced = '고급 설정';
|
||||||
$lang->subtitle_etc = '기타';
|
$lang->subtitle_etc = '기타';
|
||||||
$lang->current_state = '현황';
|
$lang->current_state = '현황';
|
||||||
$lang->latest_documents = '최근 글';
|
$lang->latest_documents = '최근 글';
|
||||||
|
|
@ -81,17 +82,20 @@ $lang->cmd_minify_all = '모든 파일을 압축';
|
||||||
$lang->cmd_minify_common = '공통 파일만 압축';
|
$lang->cmd_minify_common = '공통 파일만 압축';
|
||||||
$lang->cmd_minify_none = '압축하지 않음';
|
$lang->cmd_minify_none = '압축하지 않음';
|
||||||
$lang->about_minify_scripts = '코어와 모든 모듈에 포함된 CSS, JS 파일들을 자동으로 압축(minify)하여 전송합니다.';
|
$lang->about_minify_scripts = '코어와 모든 모듈에 포함된 CSS, JS 파일들을 자동으로 압축(minify)하여 전송합니다.';
|
||||||
|
$lang->use_gzip = 'gzip 압축';
|
||||||
$lang->delay_session = '세션 시작 지연';
|
$lang->delay_session = '세션 시작 지연';
|
||||||
$lang->about_delay_session = 'Varnish 등의 프록시 캐싱 서버 사용시 성능 개선을 위해, 로그인하지 않은 사용자에게는 인증 세션을 부여하지 않습니다.<br>이 옵션을 선택할 경우 방문자 수 및 조회수 집계가 정확하게 이루어지지 않을 수 있습니다.';
|
$lang->about_delay_session = 'Varnish 등의 프록시 캐싱 서버 사용시 성능 개선을 위해, 로그인하지 않은 사용자에게는 인증 세션을 부여하지 않습니다.<br>이 옵션을 선택할 경우 방문자 수 및 조회수 집계가 정확하게 이루어지지 않을 수 있습니다.';
|
||||||
|
$lang->msg_invalid_default_url = '기본 URL이 올바르지 않습니다.';
|
||||||
$lang->sftp = 'SFTP 사용';
|
$lang->sftp = 'SFTP 사용';
|
||||||
$lang->ftp_get_list = '목록 가져오기';
|
$lang->msg_ftp_not_connected = 'FTP 서버에 접속할 수 없습니다. 주소와 포트를 확인해 주십시오.';
|
||||||
$lang->ftp_remove_info = 'FTP 정보 삭제';
|
$lang->msg_ftp_invalid_auth_info = 'FTP 서버에 로그인할 수 없습니다. 아이디와 비밀번호를 확인해 주십시오.';
|
||||||
$lang->msg_find_xe_path_fail = 'Rhymix 설치 경로를 자동으로 찾지 못하였습니다. 수동 설정해주세요.';
|
$lang->msg_ftp_cannot_set_passive_mode = 'Passive 모드 설정에 실패하였습니다. 설정을 변경하여 다시 시도해 주십시오.';
|
||||||
$lang->msg_ftp_invalid_path = 'FTP 경로(Path)를 읽을 수 없습니다.';
|
$lang->msg_ftp_invalid_path = 'FTP 서버에서 입력하신 설치 경로를 찾을 수 없습니다.';
|
||||||
|
$lang->msg_ftp_sftp_error = 'SSH 서버에 접속한 후 SFTP 모드로 전환하는 데 실패했습니다.';
|
||||||
$lang->use_ftp_passive_mode = 'Passive 모드 사용';
|
$lang->use_ftp_passive_mode = 'Passive 모드 사용';
|
||||||
$lang->use_sftp_support = 'SFTP 사용';
|
$lang->use_sftp_support = 'SFTP 사용';
|
||||||
$lang->disable_sftp_support = 'SFTP를 사용하시려면 ssh2 PHP 모듈을 설치하셔야 합니다.';
|
$lang->disable_sftp_support = 'SFTP를 사용하려면 PHP에 ssh2 모듈이 설치되어 있어야 합니다.';
|
||||||
$lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.';
|
$lang->msg_self_restart_cache_engine = 'Memcached 또는 캐시 서비스를 재시작해 주세요.';
|
||||||
$lang->autoinstall = '쉬운 설치';
|
$lang->autoinstall = '쉬운 설치';
|
||||||
$lang->last_week = '지난주';
|
$lang->last_week = '지난주';
|
||||||
$lang->this_week = '이번주';
|
$lang->this_week = '이번주';
|
||||||
|
|
@ -110,8 +114,8 @@ $lang->corp = 'Crop(잘라내기)';
|
||||||
$lang->ratio = 'Ratio(비율 맞추기)';
|
$lang->ratio = 'Ratio(비율 맞추기)';
|
||||||
$lang->admin_ip_limit = '관리자 IP대역';
|
$lang->admin_ip_limit = '관리자 IP대역';
|
||||||
$lang->local_ip_address = '로컬 IP 주소';
|
$lang->local_ip_address = '로컬 IP 주소';
|
||||||
$lang->about_admin_ip_limit = '관리자 페이지로 접근가능한 IP대역을 지정합니다. 해당 IP에 대해서만 관리자 페이지로 접근이 가능하므로 주의 바랍니다. IP대역 정보는 /files/config/db.config.php 파일에 저장됩니다. 여러개의 항목은 줄을 바꾸어 입력하세요.';
|
$lang->about_admin_ip_limit = '관리자 페이지로 접근가능한 IP대역을 지정합니다. 해당 IP에 대해서만 관리자 페이지로 접근이 가능하므로 주의 바랍니다.';
|
||||||
$lang->detail_about_ftp_info = 'FTP 정보를 입력하면 쉬운 설치를 가능하도록 합니다. FTP 정보는 files/config/ftp.config.php 파일에 저장됩니다. 쉬운 설치가 불가능한 경우 PHP의 safe_mode를 On으로 변경해야 합니다.';
|
$lang->detail_about_ftp_info = 'safe_mode = on 상태에서 쉬운설치를 사용하려면 FTP 정보를 입력해야 합니다.';
|
||||||
$lang->allow_use_favicon = '파비콘 지정';
|
$lang->allow_use_favicon = '파비콘 지정';
|
||||||
$lang->about_use_favicon = '16 x 16 크기의<em>*.ico</em> 파일 업로드 권장.';
|
$lang->about_use_favicon = '16 x 16 크기의<em>*.ico</em> 파일 업로드 권장.';
|
||||||
$lang->allow_use_mobile_icon = '모바일 홈 화면 아이콘';
|
$lang->allow_use_mobile_icon = '모바일 홈 화면 아이콘';
|
||||||
|
|
@ -156,7 +160,7 @@ $lang->server_env = '서버 정보';
|
||||||
$lang->ftp_form_title = 'FTP 계정 정보 입력';
|
$lang->ftp_form_title = 'FTP 계정 정보 입력';
|
||||||
$lang->ftp = 'FTP';
|
$lang->ftp = 'FTP';
|
||||||
$lang->ftp_host = 'FTP 서버 주소';
|
$lang->ftp_host = 'FTP 서버 주소';
|
||||||
$lang->ftp_port = 'FTP port';
|
$lang->ftp_port = 'FTP 포트';
|
||||||
$lang->about_ftp_password = '비밀번호는 FTP 경로 확인을 위한 FTP 접속 시 필요하며 사용 후 저장하지 않습니다.';
|
$lang->about_ftp_password = '비밀번호는 FTP 경로 확인을 위한 FTP 접속 시 필요하며 사용 후 저장하지 않습니다.';
|
||||||
$lang->cmd_check_ftp_connect = 'FTP 접속 확인';
|
$lang->cmd_check_ftp_connect = 'FTP 접속 확인';
|
||||||
$lang->msg_safe_mode_ftp_needed = 'PHP의<strong>safe_mode=On</strong>일 경우 Rhymix의 정상적인 동작을 돕습니다.';
|
$lang->msg_safe_mode_ftp_needed = 'PHP의<strong>safe_mode=On</strong>일 경우 Rhymix의 정상적인 동작을 돕습니다.';
|
||||||
|
|
@ -167,8 +171,9 @@ $lang->msg_ftp_mkdir_fail = 'FTP를 이용한 디렉토리 생성 명령에 실
|
||||||
$lang->msg_ftp_chmod_fail = 'FTP를 이용한 디렉토리의 속성 변경에 실패했습니다. FTP 서버의 설정을 확인해주세요.';
|
$lang->msg_ftp_chmod_fail = 'FTP를 이용한 디렉토리의 속성 변경에 실패했습니다. FTP 서버의 설정을 확인해주세요.';
|
||||||
$lang->msg_ftp_connect_success = 'FTP 접속 및 인증에 성공했습니다.';
|
$lang->msg_ftp_connect_success = 'FTP 접속 및 인증에 성공했습니다.';
|
||||||
$lang->ftp_path_title = 'FTP 경로 정보 입력';
|
$lang->ftp_path_title = 'FTP 경로 정보 입력';
|
||||||
$lang->ftp_installed_realpath = '설치된 Rhymix의 절대경로';
|
$lang->ftp_installed_realpath = 'Rhymix 설치 경로';
|
||||||
$lang->msg_ftp_installed_ftp_realpath = '설치된 Rhymix의 FTP 경로';
|
$lang->msg_ftp_installed_ftp_realpath = 'Rhymix 설치 경로';
|
||||||
|
$lang->msg_ftp_autodetected_ftp_realpath = '자동 감지된 경로';
|
||||||
$lang->msg_php_warning_title = '안전하지 않은 PHP 버전 경고';
|
$lang->msg_php_warning_title = '안전하지 않은 PHP 버전 경고';
|
||||||
$lang->msg_php_warning_notice = '이 서버는 안전하지 않은 PHP 버전을 사용하고 있으며, PHP를 최신 안정 버전으로 업그레이드를 권장합니다.';
|
$lang->msg_php_warning_notice = '이 서버는 안전하지 않은 PHP 버전을 사용하고 있으며, PHP를 최신 안정 버전으로 업그레이드를 권장합니다.';
|
||||||
$lang->msg_php_warning_notice_explain = '<li>매우 심각한 PHP 보안 문제 및 공격에 노출될 수 있습니다.</li><li>Rhymix 최신 버전을 사용할 수 없습니다.</li><li>Rhymix 최신 버전 이상에서 지원하는 확장 기능을 사용할 수 없습니다.</li><li>일부 확장 기능이 동작하지 않거나, 이로 인해 장애가 발생할 수 있습니다.</li>';
|
$lang->msg_php_warning_notice_explain = '<li>매우 심각한 PHP 보안 문제 및 공격에 노출될 수 있습니다.</li><li>Rhymix 최신 버전을 사용할 수 없습니다.</li><li>Rhymix 최신 버전 이상에서 지원하는 확장 기능을 사용할 수 없습니다.</li><li>일부 확장 기능이 동작하지 않거나, 이로 인해 장애가 발생할 수 있습니다.</li>';
|
||||||
|
|
@ -198,7 +203,7 @@ $lang->sitelock_whitelist = '접근 허용 IP';
|
||||||
$lang->sitelock_title = '안내문 제목';
|
$lang->sitelock_title = '안내문 제목';
|
||||||
$lang->sitelock_message = '안내문 내용';
|
$lang->sitelock_message = '안내문 내용';
|
||||||
$lang->sitelock_message_help = 'HTML 태그를 사용할 수 있습니다.';
|
$lang->sitelock_message_help = 'HTML 태그를 사용할 수 있습니다.';
|
||||||
$lang->sitelock_warning_whitelist = '이곳에 관리자의 IP를 반드시 포함해야 합니다.<br />만약 접근이 차단된 경우 \'./files/config/db.config.php\' 파일에서 `\'use_sitelock\' => \'<strong>Y</strong>\'`를 `\'use_sitelock\' => \'<strong>N</strong>\'`으로 변경하여 차단을 해제할 수 있습니다.<br />사이트 잠금 디자인 파일의 위치는 \'./common/tpl/sitelock.html\' 입니다.';
|
$lang->sitelock_warning_whitelist = '사이트 잠금 사용시 관리자의 IP가 반드시 이 목록에 포함되어야 합니다.';
|
||||||
$lang->your_ip = '접속하신 IP';
|
$lang->your_ip = '접속하신 IP';
|
||||||
$lang->sitelock_in_use = '사이트 잠금을 사용중입니다.';
|
$lang->sitelock_in_use = '사이트 잠금을 사용중입니다.';
|
||||||
$lang->about_sitelock_in_use = '관리자 페이지에서 허용한 IP를 제외한 사용자는 접속할 수 없습니다.';
|
$lang->about_sitelock_in_use = '관리자 페이지에서 허용한 IP를 제외한 사용자는 접속할 수 없습니다.';
|
||||||
|
|
|
||||||
84
modules/admin/tpl/config_advanced.html
Normal file
84
modules/admin/tpl/config_advanced.html
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
<include target="config_header.html" />
|
||||||
|
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/admin/tpl/config_advanced/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||||
|
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||||
|
</div>
|
||||||
|
<section class="section">
|
||||||
|
<form action="./" method="post" class="x_form-horizontal">
|
||||||
|
<input type="hidden" name="module" value="admin" />
|
||||||
|
<input type="hidden" name="act" value="procAdminUpdateAdvanced" />
|
||||||
|
<input type="hidden" name="xe_validator_id" value="modules/admin/tpl/config_advanced/1" />
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label" for="default_url">{$lang->default_url} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_default_url" target="_blank">{$lang->help}</a></label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<input type="url" name="default_url" id="default_url" style="min-width:90%" value="{$default_url}"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label">{$lang->use_ssl} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_ssl" target="_blank">{$lang->help}</a></label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<!--@foreach($lang->ssl_options as $key => $val)-->
|
||||||
|
<label for="ssl_{$key}" class="x_inline"><input type="radio" name="use_ssl" id="ssl_{$key}" value="{$key}" checked="checked"|cond="$use_ssl==$key" /> {$val}</label>
|
||||||
|
<!--@endforeach-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label">{$lang->server_ports}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<label for="http_port" class="x_inline" style="margin-bottom:0;padding-top:0">HTTP: <input type="number" name="http_port" id="http_port" size="5" value="{$http_port}" /></label>
|
||||||
|
<label for="https_port" class="x_inline" style="margin-bottom:0;padding-top:0">HTTPS: <input type="number" name="https_port" id="https_port" size="5" value="{$https_port}" /></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label">{$lang->use_rewrite}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<label for="use_rewrite_y" class="x_inline"><input type="radio" name="use_rewrite" id="use_rewrite_y" value="Y" checked="checked"|cond="$use_rewrite" /> {$lang->cmd_yes}</label>
|
||||||
|
<label for="use_rewrite_n" class="x_inline"><input type="radio" name="use_rewrite" id="use_rewrite_n" value="N" checked="checked"|cond="!$use_rewrite" /> {$lang->cmd_no}</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label">{$lang->use_sso} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_sso" target="_blank">{$lang->help}</a></label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<label for="use_sso_y" class="x_inline"><input type="radio" name="use_sso" id="use_sso_y" value="Y" checked="checked"|cond="$use_sso" /> {$lang->cmd_yes}</label>
|
||||||
|
<label for="use_sso_n" class="x_inline"><input type="radio" name="use_sso" id="use_sso_n" value="N" checked="checked"|cond="!$use_sso" /> {$lang->cmd_no}</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label">{$lang->delay_session}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<label for="delay_session_y" class="x_inline"><input type="radio" name="delay_session" id="delay_session_y" value="Y" checked="checked"|cond="$delay_session" /> {$lang->cmd_yes}</label>
|
||||||
|
<label for="delay_session_n" class="x_inline"><input type="radio" name="delay_session" id="delay_session_n" value="N" checked="checked"|cond="!$delay_session" /> {$lang->cmd_no}</label>
|
||||||
|
<br />
|
||||||
|
<p class="x_help-block">{$lang->about_delay_session}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label">{$lang->use_db_session} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_db_session" target="_blank">{$lang->help}</a></label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<label for="use_db_session_y" class="x_inline"><input type="radio" name="use_db_session" id="use_db_session_y" value="Y" checked="checked"|cond="$use_db_session" /> {$lang->cmd_yes}</label>
|
||||||
|
<label for="use_db_session_n" class="x_inline"><input type="radio" name="use_db_session" id="use_db_session_n" value="N" checked="checked"|cond="!$use_db_session" /> {$lang->cmd_no}</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label">{$lang->minify_scripts}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<label for="minify_scripts_none" class="x_inline"><input type="radio" name="minify_scripts" id="minify_scripts_none" value="none" checked="checked"|cond="$minify_scripts=='none'" /> {$lang->cmd_minify_none}</label>
|
||||||
|
<label for="minify_scripts_common" class="x_inline"><input type="radio" name="minify_scripts" id="minify_scripts_common" value="common" checked="checked"|cond="$minify_scripts!='all' && $minify_scripts!='none'" /> {$lang->cmd_minify_common}</label>
|
||||||
|
<label for="minify_scripts_all" class="x_inline"><input type="radio" name="minify_scripts" id="minify_scripts_all" value="all" checked="checked"|cond="$minify_scripts=='all'" /> {$lang->cmd_minify_all}</label>
|
||||||
|
<br />
|
||||||
|
<p class="x_help-block">{$lang->about_minify_scripts}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label">{$lang->use_gzip}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<label for="use_gzip_y" class="x_inline"><input type="radio" name="use_gzip" id="use_gzip_y" value="Y" checked="checked"|cond="$use_gzip" /> {$lang->cmd_yes}</label>
|
||||||
|
<label for="use_gzip_n" class="x_inline"><input type="radio" name="use_gzip" id="use_gzip_n" value="N" checked="checked"|cond="!$use_gzip" /> {$lang->cmd_no}</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_clearfix btnArea">
|
||||||
|
<div class="x_pull-right">
|
||||||
|
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
|
@ -1,78 +1,68 @@
|
||||||
<load target="./js/config.js" usecdn="true" />
|
<load target="./js/config.js" />
|
||||||
<load target="../install/lang/lang.xml" usecdn="true" />
|
<load target="../../session/tpl/js/session.js" />
|
||||||
<load target="../../session/tpl/js/session.js" usecdn="true" />
|
|
||||||
<div class="x_page-header">
|
<div class="x_page-header">
|
||||||
<h1>{$lang->menu_gnb_sub['adminConfigurationFtp']} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_ftp" target="_blank">{$lang->help}</a></h1>
|
<h1>{$lang->menu_gnb_sub['adminConfigurationFtp']} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_ftp" target="_blank">{$lang->help}</a></h1>
|
||||||
</div>
|
</div>
|
||||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/admin/tpl/config_ftp/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/admin/tpl/config_ftp/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||||
</div>
|
</div>
|
||||||
<p class="x_help-block">{$lang->detail_about_ftp_info}</p>
|
<p>{$lang->detail_about_ftp_info}</p>
|
||||||
<form action="./" id="ftp_form" method="post" enctype="multipart/form-data" class="x_form-horizontal" ruleset="installFtpInfo">
|
<form action="./" id="ftp_form" method="post" class="x_form-horizontal" ruleset="installFtpInfo">
|
||||||
<input type="hidden" name="module" value="install" />
|
<input type="hidden" name="module" value="admin" />
|
||||||
<input type="hidden" name="act" value="procInstallAdminSaveFTPInfo" />
|
<input type="hidden" name="act" value="procAdminUpdateFTPInfo" />
|
||||||
<input type="hidden" name="success_return_url" value="{base64_decode($success_return_url)}" />
|
<input type="hidden" name="success_return_url" value="{$success_return_url}" />
|
||||||
<input type="hidden" name="xe_validator_id" value="modules/admin/tpl/config_ftp/1" />
|
<input type="hidden" name="xe_validator_id" value="modules/admin/tpl/config_ftp/1" />
|
||||||
<section class="section">
|
<section class="section">
|
||||||
<h1>{$lang->subtitle_primary}</h1>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label" for="ftp_user">{$lang->user_id}</label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<input type="text" name="ftp_user" id="ftp_user" value="{$ftp_info->ftp_user}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label" for="ftp_password">{$lang->password}</label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<input type="password" name="ftp_password" id="ftp_password" value="" />
|
|
||||||
<p class="x_help-block">{$lang->about_ftp_password}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="__xe_path" class="x_control-group" hidden>
|
|
||||||
<label class="x_control-label" for="ftp_root_path">{$lang->msg_ftp_installed_ftp_realpath}</label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<span class="x_input-append">
|
|
||||||
<input type="text" name="ftp_root_path" id="ftp_root_path" value="{$ftp_info->ftp_root_path}" />
|
|
||||||
<a href="#ftpSuggestion" onclick="getFTPList(); return false;" class="x_btn tgAnchor">{$lang->ftp_get_list}</a>
|
|
||||||
</span>
|
|
||||||
<div id="ftpSuggestion" class="x_thumbnail">
|
|
||||||
</div>
|
|
||||||
<p class="x_help-block" style="margin-top:10px">{$lang->msg_ftp_installed_realpath} : {_XE_PATH_}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="section collapsed" style="margin-bottom:0">
|
|
||||||
<h1>{$lang->subtitle_advanced}</h1>
|
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label class="x_control-label" for="ftp_host">{$lang->ftp_host}</label>
|
<label class="x_control-label" for="ftp_host">{$lang->ftp_host}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<input type="text" name="ftp_host" id="ftp_host" value="{$ftp_info->ftp_host ? $ftp_info->ftp_host : '127.0.0.1'}" /> Default : 127.0.0.1
|
<input type="text" name="ftp_host" id="ftp_host" value="{$ftp_info['host'] ?: 'localhost'}" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label class="x_control-label" for="ftp_port">{$lang->ftp_port}</label>
|
<label class="x_control-label" for="ftp_port">{$lang->ftp_port}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<input type="number" name="ftp_port" id="ftp_port" value="{$ftp_info->ftp_port ? $ftp_info->ftp_port : '21'}" /> Default : 21
|
<input type="number" name="ftp_port" id="ftp_port" value="{$ftp_info['port'] ?: '21'}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label" for="ftp_user">{$lang->user_id}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<input type="text" name="ftp_user" id="ftp_user" value="{$ftp_info['user']}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label" for="ftp_pass">{$lang->password}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<input type="password" name="ftp_pass" id="ftp_pass" value="" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label" for="ftp_path">{$lang->msg_ftp_installed_ftp_realpath}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<input type="text" name="ftp_path" id="ftp_path" style="min-width:90%" value="{$ftp_info['path'] ?: _XE_PATH_}" />
|
||||||
|
<br />
|
||||||
|
<p class="x_help-block">{$lang->msg_ftp_autodetected_ftp_realpath} : {_XE_PATH_}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<div class="x_control-label">{$lang->use_ftp_passive_mode}</div>
|
<div class="x_control-label">{$lang->use_ftp_passive_mode}</div>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<label class="x_inline" for="ftp_passive_y">
|
<label class="x_inline" for="ftp_pasv_y">
|
||||||
<input type="radio" name="ftp_pasv" id="ftp_passive_y" value="Y" checked="checked"|cond="$ftp_info->ftp_pasv == 'Y'" />
|
<input type="radio" name="ftp_pasv" id="ftp_pasv_y" value="Y" checked="checked"|cond="$ftp_info['pasv']" />
|
||||||
{$lang->cmd_yes}
|
{$lang->cmd_yes}
|
||||||
</label>
|
</label>
|
||||||
<label class="x_inline" for="ftp_passive_n">
|
<label class="x_inline" for="ftp_pasv_n">
|
||||||
<input type="radio" name="ftp_pasv" id="ftp_passive_n" value="N" checked="checked"|cond="$ftp_info->ftp_pasv != 'Y'" />
|
<input type="radio" name="ftp_pasv" id="ftp_pasv_n" value="N" checked="checked"|cond="!$ftp_info['pasv']" />
|
||||||
{$lang->cmd_no}
|
{$lang->cmd_no}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label class="x_control-label" for="sftp_n">{$lang->use_sftp_support}</label>
|
<label class="x_control-label">{$lang->use_sftp_support}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<label class="x_inline" for="sftp_y"><input type="radio" name="sftp" id="sftp_y" value="Y" checked="checked"|cond="$ftp_info->sftp == 'Y'" disabled|cond="!$sftp_support" />{$lang->cmd_yes}</label>
|
<label class="x_inline" for="ftp_sftp_y"><input type="radio" name="ftp_sftp" id="ftp_sftp_y" value="Y" checked="checked"|cond="$ftp_info['sftp']" disabled|cond="!$sftp_support" /> {$lang->cmd_yes}</label>
|
||||||
<label class="x_inline" for="sftp_n"><input type="radio" name="sftp" id="sftp_n" value="N" checked="checked"|cond="$ftp_info->sftp != 'Y'" /> {$lang->cmd_no}</label>
|
<label class="x_inline" for="ftp_sftp_n"><input type="radio" name="ftp_sftp" id="ftp_sftp_n" value="N" checked="checked"|cond="!$ftp_info['sftp']" /> {$lang->cmd_no}</label>
|
||||||
<p class="x_help-black" cond="!$sftp_support">{$lang->disable_sftp_support}</p>
|
<p class="x_help-black" cond="!$sftp_support">{$lang->disable_sftp_support}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -80,47 +70,4 @@
|
||||||
<div class="btnArea" style="margin-top:0">
|
<div class="btnArea" style="margin-top:0">
|
||||||
<input type="submit" value="{$lang->cmd_save}" class="x_btn x_btn-primary x_pull-right" />
|
<input type="submit" value="{$lang->cmd_save}" class="x_btn x_btn-primary x_pull-right" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<style>
|
|
||||||
#ftpSuggestion{padding:8px 15px;margin:2px 0;position:absolute;background:#fff;box-shadow:1px 1px 1px #eee;width:188px;z-index:99}
|
|
||||||
#ftpSuggestion ul{margin:0;padding:0;list-style:none}
|
|
||||||
#ftpSuggestion button{overflow:visible;padding:0;background:none;border:0;display:block;width:100%;text-align:left}
|
|
||||||
#ftpSuggestion button:hover,
|
|
||||||
#ftpSuggestion button:focus{font-weight:bold}
|
|
||||||
</style>
|
|
||||||
<script>
|
|
||||||
jQuery(function($){
|
|
||||||
$('#ftp_form').submit(function(){
|
|
||||||
if($(this).data('found')){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$('input[name="ftp_root_path"]').val('');
|
|
||||||
|
|
||||||
param = {
|
|
||||||
'ftp_user': $('#ftp_user').val(),
|
|
||||||
'ftp_password': $('#ftp_password').val(),
|
|
||||||
'ftp_host': $('#ftp_host').val(),
|
|
||||||
'ftp_port': $('#ftp_port').val(),
|
|
||||||
'ftp_pasv': $('input:radio[name="ftp_pasv"]:checked').val(),
|
|
||||||
'sftp': $('input:radio[name="sftp"]:checked').val()
|
|
||||||
}
|
|
||||||
|
|
||||||
$.exec_json('admin.getAdminFTPPath', param, function(data){
|
|
||||||
if(data.error) return;
|
|
||||||
|
|
||||||
if(!data.found_path){
|
|
||||||
alert('{$lang->msg_find_xe_path_fail}');
|
|
||||||
$('#__xe_path').show();
|
|
||||||
$('#ftp_form').data('found', true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$('input[name="ftp_root_path"]').val(data.found_path);
|
|
||||||
$('#ftp_form').data('found', true).submit();
|
|
||||||
});
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,11 @@
|
||||||
<load target="./js/config.js" usecdn="true" />
|
<include target="config_header.html" />
|
||||||
<load target="../install/lang/lang.xml" usecdn="true" />
|
|
||||||
<load target="../../session/tpl/js/session.js" usecdn="true" />
|
|
||||||
<div class="x_page-header">
|
|
||||||
<h1>{$lang->menu_gnb_sub['adminConfigurationGeneral']} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general" target="_blank">{$lang->help}</a></h1>
|
|
||||||
</div>
|
|
||||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/admin/tpl/config_general/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/admin/tpl/config_general/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||||
</div>
|
</div>
|
||||||
<section class="section">
|
<section class="section">
|
||||||
<h1>{$lang->subtitle_primary}</h1>
|
|
||||||
<form action="./" method="post" enctype="multipart/form-data" id="config_form" class="x_form-horizontal">
|
<form action="./" method="post" enctype="multipart/form-data" id="config_form" class="x_form-horizontal">
|
||||||
<input type="hidden" name="module" value="install" />
|
<input type="hidden" name="module" value="admin" />
|
||||||
<input type="hidden" name="act" value="procInstallAdminConfig" />
|
<input type="hidden" name="act" value="procAdminUpdateConfigGeneral" />
|
||||||
<input type="hidden" name="xe_validator_id" value="modules/admin/tpl/config_general/1" />
|
<input type="hidden" name="xe_validator_id" value="modules/admin/tpl/config_general/1" />
|
||||||
<div></div>
|
<div></div>
|
||||||
</form>
|
</form>
|
||||||
|
|
@ -19,7 +13,7 @@
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label class="x_control-label">{$lang->site_title} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_site_title" target="_blank">{$lang->help}</a></label>
|
<label class="x_control-label">{$lang->site_title} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_site_title" target="_blank">{$lang->help}</a></label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<input type="text" name="site_title" value="{$siteTitle}" />
|
<input type="text" name="site_title" value="{$site_title}" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
|
|
@ -28,34 +22,39 @@
|
||||||
<input class="module_search" type="text" name="index_module_srl" value="{$start_module->index_module_srl}" />
|
<input class="module_search" type="text" name="index_module_srl" value="{$start_module->index_module_srl}" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label" for="html_footer">{$lang->input_footer_script}</label>
|
||||||
|
<div class="x_controls" style="margin-right:14px">
|
||||||
|
<textarea name="html_footer" id="html_footer" rows="6" style="width:100%" placeholder="{$lang->detail_input_footer_script}" title="{$lang->detail_input_footer_script}">{$html_footer}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label for="default_lang" class="x_control-label">{$lang->default_lang}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<select name="default_lang" id="default_lang">
|
||||||
|
<option value="{$key}" loop="$enabled_lang=>$key" selected="selected"|cond="$key==$default_lang">{$supported_lang[$key]}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label class="x_control-label">{$lang->lang_select}</label>
|
<label class="x_control-label">{$lang->lang_select}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<label for="lang_{$key}" class="x_inline" loop="$langs=>$key,$val">
|
<label for="lang_{$key}" class="x_inline" loop="$supported_lang=>$key,$val">
|
||||||
<input type="checkbox" name="selected_lang[]" id="lang_{$key}" value="{$key}" disabled="disabled"|cond="$key==$selected_lang" checked="checked"|cond="isset($lang_selected[$key])" />
|
<input type="checkbox" name="enabled_lang[]" id="lang_{$key}" value="{$key}" disabled="disabled"|cond="$key==$default_lang" checked="checked"|cond="in_array($key, $enabled_lang)" />
|
||||||
{$val}
|
{$val}
|
||||||
<input type="hidden" name="selected_lang[]" id="lang_{$key}" value="{$key}" cond="$key==$selected_lang" />
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label for="change_lang_type" class="x_control-label">{$lang->default_lang}</label>
|
<label class="x_control-label" for="default_timezone">{$lang->timezone}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<select name="change_lang_type" id="change_lang_type">
|
<select name="default_timezone">
|
||||||
<option value="{$key}" selected="selected"|cond="$key==$selected_lang" loop="$lang_supported=>$key,$val">{$val}</option>
|
<option loop="$timezones => $key,$val" value="{$key}" selected="selected"|cond="$key==$selected_timezone">{$val}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label class="x_control-label" for="time_zone">{$lang->timezone}</label>
|
<label class="x_control-label">{$lang->use_mobile_view}</label>
|
||||||
<div class="x_controls">
|
|
||||||
<select name="time_zone" id="time_zone" style="width:auto">
|
|
||||||
<option value="{$key}" selected="selected"|cond="$time_zone==$key" loop="$time_zone_list=>$key,$val">{$val}</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label">{$lang->use_mobile_view} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_mobile_view" target="_blank">{$lang->help}</a></label>
|
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<label for="use_mobile_view_y" class="x_inline">
|
<label for="use_mobile_view_y" class="x_inline">
|
||||||
<input type="radio" name="use_mobile_view" id="use_mobile_view_y" value="Y" checked="checked"|cond="$use_mobile_view == 'Y'" />
|
<input type="radio" name="use_mobile_view" id="use_mobile_view_y" value="Y" checked="checked"|cond="$use_mobile_view == 'Y'" />
|
||||||
|
|
@ -80,12 +79,6 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label" for="htmlFooter">{$lang->input_footer_script}</label>
|
|
||||||
<div class="x_controls" style="margin-right:14px">
|
|
||||||
<textarea name="htmlFooter" id="htmlFooter" rows="4" cols="42" style="width:100%" placeholder="{$lang->detail_input_footer_script}" title="{$lang->detail_input_footer_script}">{$htmlFooter}</textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label class="x_control-label">{$lang->allow_use_favicon}</label>
|
<label class="x_control-label">{$lang->allow_use_favicon}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
|
|
@ -95,8 +88,8 @@
|
||||||
</p>
|
</p>
|
||||||
<label><input type="checkbox" name="is_delete_favicon" value="1" /> {$lang->cmd_delete}</label>
|
<label><input type="checkbox" name="is_delete_favicon" value="1" /> {$lang->cmd_delete}</label>
|
||||||
<form action="./" enctype="multipart/form-data" method="post" target="hiddenIframe" class="imageUpload" style="margin:0">
|
<form action="./" enctype="multipart/form-data" method="post" target="hiddenIframe" class="imageUpload" style="margin:0">
|
||||||
<input type="hidden" name="module" value="install">
|
<input type="hidden" name="module" value="admin">
|
||||||
<input type="hidden" name="act" value="procInstallAdminConfigIconUpload">
|
<input type="hidden" name="act" value="procAdminFaviconUpload">
|
||||||
<p>
|
<p>
|
||||||
<input type="file" name="favicon" id="favicon" title="Favicon"/>
|
<input type="file" name="favicon" id="favicon" title="Favicon"/>
|
||||||
<input class="x_btn" type="submit" value="{$lang->cmd_preview}" style="vertical-align:top">
|
<input class="x_btn" type="submit" value="{$lang->cmd_preview}" style="vertical-align:top">
|
||||||
|
|
@ -110,12 +103,12 @@
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<p id="mobiconPreview">
|
<p id="mobiconPreview">
|
||||||
<img src="{$mobicon_url}" alt="Mobile Home Icon" width="32" height="32" />
|
<img src="{$mobicon_url}" alt="Mobile Home Icon" width="32" height="32" />
|
||||||
<span>www</span>
|
<span>Rhymix</span>
|
||||||
</p>
|
</p>
|
||||||
<label><input type="checkbox" name="is_delete_mobicon" value="1" /> {$lang->cmd_delete}</label>
|
<label><input type="checkbox" name="is_delete_mobicon" value="1" /> {$lang->cmd_delete}</label>
|
||||||
<form action="./" enctype="multipart/form-data" method="post" target="hiddenIframe" class="imageUpload" style="margin:0">
|
<form action="./" enctype="multipart/form-data" method="post" target="hiddenIframe" class="imageUpload" style="margin:0">
|
||||||
<input type="hidden" name="module" value="install">
|
<input type="hidden" name="module" value="admin">
|
||||||
<input type="hidden" name="act" value="procInstallAdminConfigIconUpload">
|
<input type="hidden" name="act" value="procAdminFaviconUpload">
|
||||||
<p>
|
<p>
|
||||||
<input type="file" name="mobicon" id="mobicon" title="Mobile Home Icon"/>
|
<input type="file" name="mobicon" id="mobicon" title="Mobile Home Icon"/>
|
||||||
<input class="x_btn" type="submit" value="{$lang->cmd_preview}" style="vertical-align:top">
|
<input class="x_btn" type="submit" value="{$lang->cmd_preview}" style="vertical-align:top">
|
||||||
|
|
@ -132,174 +125,6 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
<section class="section">
|
|
||||||
<h1>embed Filter {$lang->subtitle_embed_whitelist} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_embed_filter" target="_blank">{$lang->help}</a></h1>
|
|
||||||
<form action="./" method="post" class="x_form-horizontal">
|
|
||||||
<input type="hidden" name="module" value="admin" />
|
|
||||||
<input type="hidden" name="act" value="procAdminUpdateEmbedWhitelist" />
|
|
||||||
<input type="hidden" name="xe_validator_id" value="modules/admin/tpl/config_general/1" />
|
|
||||||
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label" for="embed_white_iframe">iFrame <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_embed_filter_iframe" target="_blank">{$lang->help}</a></label>
|
|
||||||
<div class="x_controls" style="margin-right:14px">
|
|
||||||
<textarea name="embed_white_iframe" id="embed_white_iframe" rows="4" style="width:100%;">{$embed_white_iframe}</textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label" for="embed_white_object">object/embed</label>
|
|
||||||
<div class="x_controls" style="margin-right:14px">
|
|
||||||
<textarea name="embed_white_object" id="embed_white_object" rows="4" cols="42" style="width:100%;">{$embed_white_object}</textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="x_clearfix btnArea">
|
|
||||||
<div class="x_pull-right">
|
|
||||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
<section class="section collapsed">
|
|
||||||
<h1>{$lang->subtitle_advanced}</h1>
|
|
||||||
<form action="./" method="post" enctype="multipart/form-data" class="x_form-horizontal">
|
|
||||||
<input type="hidden" name="module" value="install" />
|
|
||||||
<input type="hidden" name="act" value="procInstallAdminSaveTimeZone" />
|
|
||||||
<input type="hidden" name="xe_validator_id" value="modules/admin/tpl/config_general/1" />
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label" for="admin_ip_list">{$lang->admin_ip_limit} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_admin_iplist" target="_blank">{$lang->help}</a></label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<textarea name="admin_ip_list" id="admin_ip_list" rows="4" cols="42" placeholder="{$IP}({$lang->local_ip_address})" style="margin-right:10px">{$admin_ip_list}</textarea>
|
|
||||||
<p class="x_help-block">{$lang->about_ipaddress_input}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label" for="default_url">{$lang->default_url} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_default_url" target="_blank">{$lang->help}</a></label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<input type="url" name="default_url" id="default_url" value="{$default_url}"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label">{$lang->use_ssl} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_ssl" target="_blank">{$lang->help}</a></label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<!--@foreach($lang->ssl_options as $key => $val)-->
|
|
||||||
<label for="ssl_{$key}" class="x_inline"><input type="radio" name="use_ssl" id="ssl_{$key}" value="{$key}" checked="checked"|cond="$use_ssl==$key" /> {$val}</label>
|
|
||||||
<!--@endforeach-->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label">{$lang->server_ports}</label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<label for="http_port" class="x_inline" style="margin-bottom:0;padding-top:0">HTTP: <input type="number" name="http_port" id="http_port" size="5" value="{$http_port}" /></label>
|
|
||||||
<label for="https_port" class="x_inline" style="margin-bottom:0;padding-top:0">HTTPS: <input type="number" name="https_port" id="https_port" size="5" value="{$https_port}" /></label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label">{$lang->use_rewrite}</label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<label for="use_rewrite_y" class="x_inline"><input type="radio" name="use_rewrite" id="use_rewrite_y" value="Y" checked="checked"|cond="$use_rewrite == 'Y'" /> {$lang->cmd_yes}</label>
|
|
||||||
<label for="use_rewrite_n" class="x_inline"><input type="radio" name="use_rewrite" id="use_rewrite_n" value="N" checked="checked"|cond="$use_rewrite != 'Y'" /> {$lang->cmd_no}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label">{$lang->use_sso} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_sso" target="_blank">{$lang->help}</a></label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<label for="sso_y" class="x_inline"><input type="radio" name="use_sso" id="sso_y" value="Y" checked="checked"|cond="$use_sso=='Y'" /> {$lang->cmd_yes}</label>
|
|
||||||
<label for="sso_n" class="x_inline"><input type="radio" name="use_sso" id="sso_n" value="N" checked="checked"|cond="$use_sso!='Y'" /> {$lang->cmd_no}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label">{$lang->use_db_session} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_db_session" target="_blank">{$lang->help}</a></label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<label for="use_db_session_y" class="x_inline"><input type="radio" name="use_db_session" id="use_db_session_y" value="Y" checked="checked"|cond="$use_db_session=='Y'" /> {$lang->cmd_yes}</label>
|
|
||||||
<label for="use_db_session_n" class="x_inline"><input type="radio" name="use_db_session" id="use_db_session_n" value="N" checked="checked"|cond="$use_db_session!='Y'" /> {$lang->cmd_no}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label">{$lang->qmail_compatibility} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_qmail" target="_blank">{$lang->help}</a></label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<label for="qmail_compatibility_y" class="x_inline"><input type="radio" name="qmail_compatibility" id="qmail_compatibility_y" value="Y" checked="checked"|cond="$qmail_compatibility=='Y'" /> {$lang->cmd_yes}</label>
|
|
||||||
<label for="qmail_compatibility_n" class="x_inline"><input type="radio" name="qmail_compatibility" id="qmail_compatibility_n" value="N" checked="checked"|cond="$qmail_compatibility!='Y'" /> {$lang->cmd_no}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label">{$lang->delay_session}</label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<label for="delay_session_y" class="x_inline"><input type="radio" name="delay_session" id="delay_session_y" value="Y" checked="checked"|cond="$delay_session=='Y'" /> {$lang->cmd_yes}</label>
|
|
||||||
<label for="delay_session_n" class="x_inline"><input type="radio" name="delay_session" id="delay_session_n" value="N" checked="checked"|cond="$delay_session!='Y'" /> {$lang->cmd_no}</label>
|
|
||||||
<br />
|
|
||||||
<p class="x_help-block">{$lang->about_delay_session}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label">{$lang->minify_scripts}</label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<label for="minify_scripts_none" class="x_inline"><input type="radio" name="minify_scripts" id="minify_scripts_none" value="none" checked="checked"|cond="$minify_scripts=='none'" /> {$lang->cmd_minify_none}</label>
|
|
||||||
<label for="minify_scripts_common" class="x_inline"><input type="radio" name="minify_scripts" id="minify_scripts_common" value="common" checked="checked"|cond="$minify_scripts!='all' && $minify_scripts!='none'" /> {$lang->cmd_minify_common}</label>
|
|
||||||
<label for="minify_scripts_all" class="x_inline"><input type="radio" name="minify_scripts" id="minify_scripts_all" value="all" checked="checked"|cond="$minify_scripts=='all'" /> {$lang->cmd_minify_all}</label>
|
|
||||||
<br />
|
|
||||||
<p class="x_help-block">{$lang->about_minify_scripts}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_clearfix btnArea">
|
|
||||||
<div class="x_pull-right">
|
|
||||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
<section class="section <!--@if($use_sitelock != 'Y')-->collapsed<!--@endif-->">
|
|
||||||
<h1>{$lang->subtitle_sitelock}</h1>
|
|
||||||
<form action="./" method="post" enctype="multipart/form-data" class="x_form-horizontal" ruleset="sitelock">
|
|
||||||
<input type="hidden" name="module" value="admin" />
|
|
||||||
<input type="hidden" name="act" value="procAdminUpdateSitelock" />
|
|
||||||
<input type="hidden" name="xe_validator_id" value="modules/admin/tpl/config_general/1" />
|
|
||||||
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label">{$lang->use_sitelock} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_sitelock" target="_blank">{$lang->help}</a></label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<label for="use_sitelock_y" class="x_inline"><input type="radio" name="use_sitelock" id="use_sitelock_y" value="Y" checked="checked"|cond="$use_sitelock=='Y'" /> {$lang->cmd_yes}</label>
|
|
||||||
<label for="use_sitelock_n" class="x_inline"><input type="radio" name="use_sitelock" id="use_sitelock_n" value="N" checked="checked"|cond="$use_sitelock!='Y'" /> {$lang->cmd_no}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label" for="sitelock_whitelist">{$lang->sitelock_whitelist} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_sitelock_whitelist" target="_blank">{$lang->help}</a></label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<textarea name="sitelock_whitelist" id="sitelock_whitelist" rows="4" cols="42" placeholder="{$IP}({$lang->local_ip_address})" style="margin-right:10px">{$sitelock_whitelist}</textarea>
|
|
||||||
<span class="x_help-block">{$lang->sitelock_warning_whitelist}</span>
|
|
||||||
<span class="x_help-block">{$lang->your_ip} : {$remote_addr}</span>
|
|
||||||
<br />
|
|
||||||
<p class="x_help-block">{$lang->about_ipaddress_input}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label" for="sitelock_title">{$lang->sitelock_title}</label>
|
|
||||||
<div class="x_controls">
|
|
||||||
<input type="text" name="sitelock_title" id="sitelock_title" value="{$sitelock_title}"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="x_control-group">
|
|
||||||
<label class="x_control-label" for="sitelock_message">{$lang->sitelock_message}</label>
|
|
||||||
<div class="x_controls" style="margin-right:14px">
|
|
||||||
<textarea name="sitelock_message" id="sitelock_message" rows="4" cols="42" style="width:100%;">{$sitelock_message}</textarea>
|
|
||||||
<span class="x_help-block">{$lang->sitelock_message_help}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="x_clearfix btnArea">
|
|
||||||
<div class="x_pull-right">
|
|
||||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<iframe name="hiddenIframe" src="about:blank" hidden></iframe>
|
<iframe name="hiddenIframe" src="about:blank" hidden></iframe>
|
||||||
<script>
|
<script>
|
||||||
function afterUploadConfigImage(name, fileName, tmpFileName)
|
function afterUploadConfigImage(name, fileName, tmpFileName)
|
||||||
|
|
|
||||||
11
modules/admin/tpl/config_header.html
Normal file
11
modules/admin/tpl/config_header.html
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<load target="./js/config.js" />
|
||||||
|
<load target="../../session/tpl/js/session.js" />
|
||||||
|
<div class="x_page-header">
|
||||||
|
<h1>{$lang->menu_gnb_sub['adminConfigurationGeneral']} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general" target="_blank">{$lang->help}</a></h1>
|
||||||
|
</div>
|
||||||
|
<ul class="x_nav x_nav-tabs">
|
||||||
|
<li class="x_active"|cond="$act == 'dispAdminConfigGeneral'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigGeneral')}">{$lang->subtitle_primary}</a></li>
|
||||||
|
<li class="x_active"|cond="$act == 'dispAdminConfigSecurity'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigSecurity')}">{$lang->subtitle_security}</a></li>
|
||||||
|
<li class="x_active"|cond="$act == 'dispAdminConfigAdvanced'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigAdvanced')}">{$lang->subtitle_advanced}</a></li>
|
||||||
|
<li class="x_active"|cond="$act == 'dispAdminConfigSitelock'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigSitelock')}">{$lang->subtitle_sitelock}</a></li>
|
||||||
|
</ul>
|
||||||
35
modules/admin/tpl/config_security.html
Normal file
35
modules/admin/tpl/config_security.html
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
<include target="config_header.html" />
|
||||||
|
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/admin/tpl/config_security/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||||
|
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||||
|
</div>
|
||||||
|
<section class="section">
|
||||||
|
<form action="./" method="post" class="x_form-horizontal">
|
||||||
|
<input type="hidden" name="module" value="admin" />
|
||||||
|
<input type="hidden" name="act" value="procAdminUpdateSecurity" />
|
||||||
|
<input type="hidden" name="xe_validator_id" value="modules/admin/tpl/config_security/1" />
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label" for="embedfilter_iframe">iframe</label>
|
||||||
|
<div class="x_controls" style="margin-right:14px">
|
||||||
|
<textarea name="embedfilter_iframe" id="embedfilter_iframe" rows="8" style="width:100%;">{$embedfilter_iframe}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label" for="embedfilter_object">object/embed</label>
|
||||||
|
<div class="x_controls" style="margin-right:14px">
|
||||||
|
<textarea name="embedfilter_object" id="embedfilter_object" rows="8" style="width:100%;">{$embedfilter_object}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label" for="admin_allowed_ip">{$lang->admin_ip_limit} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_admin_iplist" target="_blank">{$lang->help}</a></label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<textarea name="admin_allowed_ip" id="admin_allowed_ip" rows="4" cols="42" placeholder="{$remote_addr} ({$lang->local_ip_address})" style="margin-right:10px">{$admin_allowed_ip}</textarea>
|
||||||
|
<p class="x_help-block">{$lang->about_ipaddress_input}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_clearfix btnArea">
|
||||||
|
<div class="x_pull-right">
|
||||||
|
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
47
modules/admin/tpl/config_sitelock.html
Normal file
47
modules/admin/tpl/config_sitelock.html
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
<include target="config_header.html" />
|
||||||
|
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/admin/tpl/config_sitelock/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||||
|
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||||
|
</div>
|
||||||
|
<section class="section">
|
||||||
|
<form action="./" method="post" class="x_form-horizontal" ruleset="sitelock">
|
||||||
|
<input type="hidden" name="module" value="admin" />
|
||||||
|
<input type="hidden" name="act" value="procAdminUpdateSitelock" />
|
||||||
|
<input type="hidden" name="xe_validator_id" value="modules/admin/tpl/config_sitelock/1" />
|
||||||
|
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label">{$lang->use_sitelock} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_sitelock" target="_blank">{$lang->help}</a></label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<label for="sitelock_locked_y" class="x_inline"><input type="radio" name="sitelock_locked" id="sitelock_locked_y" value="Y" checked="checked"|cond="$sitelock_locked" /> {$lang->cmd_yes}</label>
|
||||||
|
<label for="sitelock_locked_y" class="x_inline"><input type="radio" name="sitelock_locked" id="sitelock_locked_n" value="N" checked="checked"|cond="!$sitelock_locked" /> {$lang->cmd_no}</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label" for="sitelock_allowed_ip">{$lang->sitelock_whitelist} <a class="x_icon-question-sign" href="./common/manual/admin/#UMAN_config_general_sitelock_whitelist" target="_blank">{$lang->help}</a></label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<textarea name="sitelock_allowed_ip" id="sitelock_allowed_ip" rows="4" cols="42" placeholder="{$remote_addr} ({$lang->local_ip_address})" style="margin-right:10px">{$sitelock_allowed_ip}</textarea>
|
||||||
|
<span class="x_help-block">{$lang->sitelock_warning_whitelist}</span>
|
||||||
|
<span class="x_help-block">{$lang->your_ip} : {$remote_addr}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label" for="sitelock_title">{$lang->sitelock_title}</label>
|
||||||
|
<div class="x_controls">
|
||||||
|
<input type="text" name="sitelock_title" id="sitelock_title" value="{$sitelock_title}"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="x_control-group">
|
||||||
|
<label class="x_control-label" for="sitelock_message">{$lang->sitelock_message}</label>
|
||||||
|
<div class="x_controls" style="margin-right:14px">
|
||||||
|
<textarea name="sitelock_message" id="sitelock_message" rows="6" style="width:100%;">{$sitelock_message}</textarea>
|
||||||
|
<span class="x_help-block">{$lang->sitelock_message_help}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="x_clearfix btnArea">
|
||||||
|
<div class="x_pull-right">
|
||||||
|
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
<form action="./" method="post" class="message info x_clearfix" cond="!$isLicenseAgreement">
|
<form action="./" method="post" class="message info x_clearfix" cond="!$isLicenseAgreement">
|
||||||
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', 'admin')}" />
|
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', 'admin')}" />
|
||||||
<input type="hidden" name="module" value="install" />
|
<input type="hidden" name="module" value="install" />
|
||||||
<input type="hidden" name="act" value="procInstallLicenseAggrement" />
|
<input type="hidden" name="act" value="procInstallLicenseAgreement" />
|
||||||
<input type="hidden" name="license_agreement" value="Y" />
|
<input type="hidden" name="license_agreement" value="Y" />
|
||||||
<input type="hidden" name="XE_VALIDATOR_ID" value="modules/admin/tpl/index/1">
|
<input type="hidden" name="XE_VALIDATOR_ID" value="modules/admin/tpl/index/1">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,90 +16,6 @@ function viewSiteSearch(){
|
||||||
jQuery(".site_keyword_search").css("display","");
|
jQuery(".site_keyword_search").css("display","");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFTPList(pwd)
|
|
||||||
{
|
|
||||||
var form = jQuery("#ftp_form").get(0);
|
|
||||||
if(typeof(pwd) != 'undefined')
|
|
||||||
{
|
|
||||||
form.ftp_root_path.value = pwd;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(!form.ftp_root_path.value && typeof(form.sftp) != 'undefined' && form.sftp.checked)
|
|
||||||
{
|
|
||||||
form.ftp_root_path.value = xe_root;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
form.ftp_root_path.value = "/";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var params = [];
|
|
||||||
//ftp_pasv not used
|
|
||||||
params.ftp_user = jQuery("#ftp_user").val();
|
|
||||||
params.ftp_password =jQuery("#ftp_password").val();
|
|
||||||
params.ftp_host = jQuery("#ftp_host").val();
|
|
||||||
params.ftp_port = jQuery("#ftp_port").val();
|
|
||||||
params.ftp_root_path = jQuery("#ftp_root_path").val();
|
|
||||||
params.sftp = jQuery("input[name=sftp]:checked").val();
|
|
||||||
|
|
||||||
exec_xml('admin', 'getAdminFTPList', params, completeGetFtpInfo, ['list', 'error', 'message'], params, form);
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeFTPInfo()
|
|
||||||
{
|
|
||||||
var params = {};
|
|
||||||
exec_xml('install', 'procInstallAdminRemoveFTPInfo', params, filterAlertMessage, ['error', 'message'], params);
|
|
||||||
}
|
|
||||||
|
|
||||||
function completeGetFtpInfo(ret_obj)
|
|
||||||
{
|
|
||||||
if(ret_obj.error !== 0)
|
|
||||||
{
|
|
||||||
alert(ret_obj.error);
|
|
||||||
alert(ret_obj.message);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var e = jQuery("#ftpSuggestion").empty();
|
|
||||||
|
|
||||||
var list = "";
|
|
||||||
if(!jQuery.isArray(ret_obj.list.item))
|
|
||||||
{
|
|
||||||
ret_obj.list.item = [ret_obj.list.item];
|
|
||||||
}
|
|
||||||
|
|
||||||
pwd = jQuery("#ftp_form").get(0).ftp_root_path.value;
|
|
||||||
if(pwd != "/")
|
|
||||||
{
|
|
||||||
arr = pwd.split("/");
|
|
||||||
arr.pop();
|
|
||||||
arr.pop();
|
|
||||||
arr.push("");
|
|
||||||
target = arr.join("/");
|
|
||||||
list = list + "<li><button type='button' onclick=\"getFTPList('"+target+"')\">../</button></li>";
|
|
||||||
}
|
|
||||||
|
|
||||||
for(var i=0;i<ret_obj.list.item.length;i++)
|
|
||||||
{
|
|
||||||
var v = ret_obj.list.item[i];
|
|
||||||
if(v == "../")
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if( v == "./")
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
list = list + "<li><button type='button' onclick=\"getFTPList('"+pwd+v+"')\">"+v+"</button></li>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
list = "<ul>"+list+"</ul>";
|
|
||||||
e.append(jQuery(list));
|
|
||||||
}
|
|
||||||
|
|
||||||
var icon = null;
|
var icon = null;
|
||||||
function deleteIcon(iconname){
|
function deleteIcon(iconname){
|
||||||
var params = [];
|
var params = [];
|
||||||
|
|
|
||||||
|
|
@ -403,54 +403,51 @@ class commentItem extends Object
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRegdate($format = 'Y.m.d H:i:s', $conversion = TRUE)
|
function getRegdate($format = 'Y.m.d H:i:s', $conversion = true)
|
||||||
{
|
{
|
||||||
return zdate($this->get('regdate'), $format, $conversion);
|
return zdate($this->get('regdate'), $format, $conversion);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRegdateTime()
|
function getRegdateTime()
|
||||||
{
|
{
|
||||||
$regdate = $this->get('regdate');
|
return ztime($this->get('regdate'));
|
||||||
$year = substr($regdate, 0, 4);
|
|
||||||
$month = substr($regdate, 4, 2);
|
|
||||||
$day = substr($regdate, 6, 2);
|
|
||||||
$hour = substr($regdate, 8, 2);
|
|
||||||
$min = substr($regdate, 10, 2);
|
|
||||||
$sec = substr($regdate, 12, 2);
|
|
||||||
return mktime($hour, $min, $sec, $month, $day, $year);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRegdateGM()
|
function getRegdateGM()
|
||||||
{
|
{
|
||||||
return $this->getRegdate('D, d M Y H:i:s', FALSE) . ' ' . $GLOBALS['_time_zone'];
|
return gmdate('r', ztime($this->get('regdate')));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUpdate($format = 'Y.m.d H:i:s', $conversion = TRUE)
|
function getRegdateDT()
|
||||||
|
{
|
||||||
|
return zdate($this->get('regdate'), 'c', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUpdate($format = 'Y.m.d H:i:s', $conversion = true)
|
||||||
{
|
{
|
||||||
return zdate($this->get('last_update'), $format, $conversion);
|
return zdate($this->get('last_update'), $format, $conversion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getUpdateTime()
|
||||||
|
{
|
||||||
|
return ztime($this->get('last_update'));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUpdateGM()
|
||||||
|
{
|
||||||
|
return gmdate('r', ztime($this->get('last_update')));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUpdateDT()
|
||||||
|
{
|
||||||
|
return zdate($this->get('last_update'), 'c', false);
|
||||||
|
}
|
||||||
|
|
||||||
function getPermanentUrl()
|
function getPermanentUrl()
|
||||||
{
|
{
|
||||||
return getFullUrl('', 'document_srl', $this->get('document_srl')) . '#comment_' . $this->get('comment_srl');
|
return getFullUrl('', 'document_srl', $this->get('document_srl')) . '#comment_' . $this->get('comment_srl');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUpdateTime()
|
|
||||||
{
|
|
||||||
$year = substr($this->get('last_update'), 0, 4);
|
|
||||||
$month = substr($this->get('last_update'), 4, 2);
|
|
||||||
$day = substr($this->get('last_update'), 6, 2);
|
|
||||||
$hour = substr($this->get('last_update'), 8, 2);
|
|
||||||
$min = substr($this->get('last_update'), 10, 2);
|
|
||||||
$sec = substr($this->get('last_update'), 12, 2);
|
|
||||||
return mktime($hour, $min, $sec, $month, $day, $year);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getUpdateGM()
|
|
||||||
{
|
|
||||||
return gmdate("D, d M Y H:i:s", $this->getUpdateTime());
|
|
||||||
}
|
|
||||||
|
|
||||||
function hasUploadedFiles()
|
function hasUploadedFiles()
|
||||||
{
|
{
|
||||||
if(($this->isSecret() && !$this->isAccessible()) && !$this->isGranted())
|
if(($this->isSecret() && !$this->isAccessible()) && !$this->isGranted())
|
||||||
|
|
|
||||||
|
|
@ -208,9 +208,8 @@ class document extends ModuleObject
|
||||||
// 2009. 03. 09 Add a column(lang_code) to the documnets table
|
// 2009. 03. 09 Add a column(lang_code) to the documnets table
|
||||||
if(!$oDB->isColumnExists("documents","lang_code"))
|
if(!$oDB->isColumnExists("documents","lang_code"))
|
||||||
{
|
{
|
||||||
$db_info = Context::getDBInfo();
|
$oDB->addColumn('documents',"lang_code","varchar",10, config('locale.default_lang'));
|
||||||
$oDB->addColumn('documents',"lang_code","varchar",10, $db_info->lang_code);
|
$obj->lang_code = config('locale.default_lang');
|
||||||
$obj->lang_code = $db_info->lang_type;
|
|
||||||
executeQuery('document.updateDocumentsLangCode', $obj);
|
executeQuery('document.updateDocumentsLangCode', $obj);
|
||||||
}
|
}
|
||||||
// 2009. 03. 11 Check the index in the document_extra_vars table
|
// 2009. 03. 11 Check the index in the document_extra_vars table
|
||||||
|
|
|
||||||
|
|
@ -580,57 +580,44 @@ class documentItem extends Object
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRegdate($format = 'Y.m.d H:i:s', $conversion = TRUE)
|
function getRegdate($format = 'Y.m.d H:i:s', $conversion = true)
|
||||||
{
|
{
|
||||||
return zdate($this->get('regdate'), $format, $conversion);
|
return zdate($this->get('regdate'), $format, $conversion);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRegdateTime()
|
function getRegdateTime()
|
||||||
{
|
{
|
||||||
$regdate = $this->get('regdate');
|
return ztime($this->get('regdate'));
|
||||||
$year = substr($regdate,0,4);
|
|
||||||
$month = substr($regdate,4,2);
|
|
||||||
$day = substr($regdate,6,2);
|
|
||||||
$hour = substr($regdate,8,2);
|
|
||||||
$min = substr($regdate,10,2);
|
|
||||||
$sec = substr($regdate,12,2);
|
|
||||||
return mktime($hour,$min,$sec,$month,$day,$year);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRegdateGM()
|
function getRegdateGM()
|
||||||
{
|
{
|
||||||
return $this->getRegdate('D, d M Y H:i:s', FALSE).' '.$GLOBALS['_time_zone'];
|
return gmdate('r', ztime($this->get('regdate')));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRegdateDT()
|
function getRegdateDT()
|
||||||
{
|
{
|
||||||
return $this->getRegdate('Y-m-d', FALSE).'T'.$this->getRegdate('H:i:s', FALSE).substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3,2);
|
return zdate($this->get('regdate'), 'c', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUpdate($format = 'Y.m.d H:i:s', $conversion = TRUE)
|
function getUpdate($format = 'Y.m.d H:i:s', $conversion = true)
|
||||||
{
|
{
|
||||||
return zdate($this->get('last_update'), $format, $conversion);
|
return zdate($this->get('last_update'), $format, $conversion);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUpdateTime()
|
function getUpdateTime()
|
||||||
{
|
{
|
||||||
$year = substr($this->get('last_update'),0,4);
|
return ztime($this->get('last_update'));
|
||||||
$month = substr($this->get('last_update'),4,2);
|
|
||||||
$day = substr($this->get('last_update'),6,2);
|
|
||||||
$hour = substr($this->get('last_update'),8,2);
|
|
||||||
$min = substr($this->get('last_update'),10,2);
|
|
||||||
$sec = substr($this->get('last_update'),12,2);
|
|
||||||
return mktime($hour,$min,$sec,$month,$day,$year);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUpdateGM()
|
function getUpdateGM()
|
||||||
{
|
{
|
||||||
return gmdate("D, d M Y H:i:s", $this->getUpdateTime());
|
return gmdate('r', ztime($this->get('last_update')));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUpdateDT()
|
function getUpdateDT()
|
||||||
{
|
{
|
||||||
return $this->getUpdate('Y-m-d', FALSE).'T'.$this->getUpdate('H:i:s', FALSE).substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3,2);
|
return zdate($this->get('last_update'), 'c', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPermanentUrl()
|
function getPermanentUrl()
|
||||||
|
|
|
||||||
|
|
@ -107,8 +107,7 @@ class importerAdminController extends importer
|
||||||
|
|
||||||
/* DBMS가 CUBRID인 경우 MySQL과 동일한 방법으로는 문서 및 댓글에 대한 사용자 정보를 동기화 할 수 없으므로 예외 처리 합니다.
|
/* DBMS가 CUBRID인 경우 MySQL과 동일한 방법으로는 문서 및 댓글에 대한 사용자 정보를 동기화 할 수 없으므로 예외 처리 합니다.
|
||||||
CUBRID를 사용하지 않는 경우에만 보편적인 기존 질의문을 사용합니다. */
|
CUBRID를 사용하지 않는 경우에만 보편적인 기존 질의문을 사용합니다. */
|
||||||
$db_info = Context::getDBInfo ();
|
if(config('db.master.type') !== 'cubrid')
|
||||||
if($db_info->db_type != "cubrid")
|
|
||||||
{
|
{
|
||||||
$output = executeQuery('importer.updateDocumentSync'.$postFix);
|
$output = executeQuery('importer.updateDocumentSync'.$postFix);
|
||||||
$output = executeQuery('importer.updateCommentSync'.$postFix);
|
$output = executeQuery('importer.updateCommentSync'.$postFix);
|
||||||
|
|
|
||||||
|
|
@ -3,25 +3,18 @@
|
||||||
<grants />
|
<grants />
|
||||||
<permissions />
|
<permissions />
|
||||||
<actions>
|
<actions>
|
||||||
<action name="dispInstallIntroduce" type="view" index="true" />
|
<action name="dispInstallIndex" type="view" index="true" />
|
||||||
<action name="dispInstallLicenseAgreement" type="view" />
|
|
||||||
<action name="dispInstallCheckEnv" type="view" />
|
<action name="dispInstallCheckEnv" type="view" />
|
||||||
<action name="dispInstallSelectDB" type="view" />
|
<action name="dispInstallDBConfig" type="view" />
|
||||||
<action name="dispInstallDBForm" type="view" />
|
<action name="dispInstallOtherConfig" type="view" />
|
||||||
<action name="dispInstallManagerForm" type="view" />
|
<action name="procDBConfig" type="controller" />
|
||||||
<action name="procDBSetting" type="controller" />
|
|
||||||
<action name="procInstall" type="controller" ruleset="install" />
|
<action name="procInstall" type="controller" ruleset="install" />
|
||||||
<action name="procInstallLicenseAggrement" type="controller" />
|
<action name="procInstallLicenseAgreement" type="controller" />
|
||||||
<action name="procInstallFTP" type="controller" />
|
<action name="procInstallFTP" type="controller" />
|
||||||
<action name="procInstallCheckFTP" type="controller" />
|
<action name="procInstallCheckFTP" type="controller" />
|
||||||
<action name="procInstallAdminInstall" type="controller" />
|
<action name="procInstallAdminInstall" type="controller" />
|
||||||
<action name="procInstallAdminUpdate" type="controller" />
|
<action name="procInstallAdminUpdate" type="controller" />
|
||||||
<action name="procInstallAdminSaveTimeZone" type="controller" />
|
|
||||||
<action name="procInstallAdminUpdateIndexModule" type="controller" />
|
<action name="procInstallAdminUpdateIndexModule" type="controller" />
|
||||||
<action name="procInstallAdminSaveFTPInfo" type="controller" ruleset="installFtpInfo" />
|
|
||||||
<action name="procInstallAdminRemoveFTPInfo" type="controller" />
|
|
||||||
<action name="procInstallAdminConfig" type="controller" />
|
|
||||||
<action name="procInstallAdminConfigIconUpload" type="controller" />
|
|
||||||
<action name="getInstallFTPList" type="model" />
|
<action name="getInstallFTPList" type="model" />
|
||||||
</actions>
|
</actions>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
||||||
|
|
@ -44,105 +44,6 @@ class installAdminController extends install
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Change settings
|
|
||||||
*/
|
|
||||||
function procInstallAdminSaveTimeZone()
|
|
||||||
{
|
|
||||||
$db_info = Context::getDBInfo();
|
|
||||||
|
|
||||||
$admin_ip_list = Context::get('admin_ip_list');
|
|
||||||
|
|
||||||
if($admin_ip_list)
|
|
||||||
{
|
|
||||||
$admin_ip_list = preg_replace("/[\r|\n|\r\n]+/",",",$admin_ip_list);
|
|
||||||
$admin_ip_list = preg_replace("/\s+/","",$admin_ip_list);
|
|
||||||
if(preg_match('/(<\?|<\?php|\?>)/xsm', $admin_ip_list))
|
|
||||||
{
|
|
||||||
$admin_ip_list = '';
|
|
||||||
}
|
|
||||||
$admin_ip_list .= ',127.0.0.1,' . $_SERVER['REMOTE_ADDR'];
|
|
||||||
$admin_ip_list = explode(',',trim($admin_ip_list, ','));
|
|
||||||
$admin_ip_list = array_unique($admin_ip_list);
|
|
||||||
if(!IpFilter::validate($admin_ip_list)) {
|
|
||||||
return new Object(-1, 'msg_invalid_ip');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$default_url = Context::get('default_url');
|
|
||||||
if($default_url && strncasecmp('http://', $default_url, 7) !== 0 && strncasecmp('https://', $default_url, 8) !== 0) $default_url = 'http://'.$default_url;
|
|
||||||
if($default_url && substr($default_url, -1) !== '/') $default_url = $default_url.'/';
|
|
||||||
|
|
||||||
/* convert NON Alphabet URL to punycode URL - Alphabet URL will not be changed */
|
|
||||||
$default_url = Context::encodeIdna($default_url);
|
|
||||||
|
|
||||||
$use_ssl = Context::get('use_ssl');
|
|
||||||
if(!$use_ssl) $use_ssl = 'none';
|
|
||||||
|
|
||||||
$http_port = Context::get('http_port');
|
|
||||||
$https_port = Context::get('https_port');
|
|
||||||
|
|
||||||
$use_rewrite = Context::get('use_rewrite');
|
|
||||||
if($use_rewrite!='Y') $use_rewrite = 'N';
|
|
||||||
|
|
||||||
$use_sso = Context::get('use_sso');
|
|
||||||
if($use_sso !='Y') $use_sso = 'N';
|
|
||||||
|
|
||||||
$use_db_session = Context::get('use_db_session');
|
|
||||||
if($use_db_session!='Y') $use_db_session = 'N';
|
|
||||||
|
|
||||||
$qmail_compatibility = Context::get('qmail_compatibility');
|
|
||||||
if($qmail_compatibility!='Y') $qmail_compatibility = 'N';
|
|
||||||
|
|
||||||
$delay_session = Context::get('delay_session');
|
|
||||||
if($delay_session!='Y') $delay_session = 'N';
|
|
||||||
unset($db_info->cache_friendly);
|
|
||||||
|
|
||||||
$minify_scripts = Context::get('minify_scripts');
|
|
||||||
if(!$minify_scripts) $minify_scripts = 'common';
|
|
||||||
|
|
||||||
$use_html5 = Context::get('use_html5');
|
|
||||||
if(!$use_html5) $use_html5 = 'N';
|
|
||||||
|
|
||||||
$db_info->default_url = $default_url;
|
|
||||||
$db_info->qmail_compatibility = $qmail_compatibility;
|
|
||||||
$db_info->minify_scripts = $minify_scripts;
|
|
||||||
$db_info->delay_session = $delay_session;
|
|
||||||
$db_info->use_db_session = $use_db_session;
|
|
||||||
$db_info->use_rewrite = $use_rewrite;
|
|
||||||
$db_info->use_sso = $use_sso;
|
|
||||||
$db_info->use_ssl = $use_ssl;
|
|
||||||
$db_info->use_html5 = $use_html5;
|
|
||||||
$db_info->admin_ip_list = $admin_ip_list;
|
|
||||||
|
|
||||||
if($http_port) $db_info->http_port = (int) $http_port;
|
|
||||||
else if($db_info->http_port) unset($db_info->http_port);
|
|
||||||
|
|
||||||
if($https_port) $db_info->https_port = (int) $https_port;
|
|
||||||
else if($db_info->https_port) unset($db_info->https_port);
|
|
||||||
|
|
||||||
unset($db_info->lang_type);
|
|
||||||
|
|
||||||
$oInstallController = getController('install');
|
|
||||||
if(!$oInstallController->makeConfigFile())
|
|
||||||
{
|
|
||||||
return new Object(-1, 'msg_invalid_request');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Context::setDBInfo($db_info);
|
|
||||||
if($default_url)
|
|
||||||
{
|
|
||||||
$site_args = new stdClass;
|
|
||||||
$site_args->site_srl = 0;
|
|
||||||
$site_args->domain = $default_url;
|
|
||||||
$oModuleController = getController('module');
|
|
||||||
$oModuleController->updateSite($site_args);
|
|
||||||
}
|
|
||||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function procInstallAdminUpdateIndexModule()
|
function procInstallAdminUpdateIndexModule()
|
||||||
{
|
{
|
||||||
if(!Context::get('index_module_srl') || !Context::get('menu_item_srl'))
|
if(!Context::get('index_module_srl') || !Context::get('menu_item_srl'))
|
||||||
|
|
@ -229,188 +130,6 @@ class installAdminController extends install
|
||||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigFtp');
|
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigFtp');
|
||||||
$this->setRedirectUrl($returnUrl);
|
$this->setRedirectUrl($returnUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
function procInstallAdminConfig()
|
|
||||||
{
|
|
||||||
$use_mobile_view = Context::get('use_mobile_view');
|
|
||||||
if($use_mobile_view!='Y') $use_mobile_view = 'N';
|
|
||||||
|
|
||||||
$time_zone = Context::get('time_zone');
|
|
||||||
|
|
||||||
$db_info = Context::getDBInfo();
|
|
||||||
$db_info->use_mobile_view = $use_mobile_view;
|
|
||||||
$db_info->time_zone = $time_zone;
|
|
||||||
|
|
||||||
unset($db_info->lang_type);
|
|
||||||
Context::setDBInfo($db_info);
|
|
||||||
$oInstallController = getController('install');
|
|
||||||
if(!$oInstallController->makeConfigFile())
|
|
||||||
{
|
|
||||||
return new Object(-1, 'msg_invalid_request');
|
|
||||||
}
|
|
||||||
|
|
||||||
$site_args = new stdClass();
|
|
||||||
$site_args->site_srl = 0;
|
|
||||||
$site_args->index_module_srl = Context::get('index_module_srl');//
|
|
||||||
$site_args->default_language = Context::get('change_lang_type');//
|
|
||||||
$oModuleController = getController('module');
|
|
||||||
$oModuleController->updateSite($site_args);
|
|
||||||
|
|
||||||
//언어 선택
|
|
||||||
$selected_lang = Context::get('selected_lang');
|
|
||||||
$this->saveLangSelected($selected_lang);
|
|
||||||
|
|
||||||
//save icon images
|
|
||||||
$deleteFavicon = Context::get('is_delete_favicon');
|
|
||||||
$deleteMobicon = Context::get('is_delete_mobicon');
|
|
||||||
|
|
||||||
$this->updateIcon('favicon.ico',$deleteFavicon);
|
|
||||||
$this->updateIcon('mobicon.png',$deleteMobicon);
|
|
||||||
|
|
||||||
//모듈 설정 저장(썸네일, 풋터스크립트)
|
|
||||||
$config = new stdClass();
|
|
||||||
$config->thumbnail_type = Context::get('thumbnail_type');
|
|
||||||
$config->htmlFooter = Context::get('htmlFooter');
|
|
||||||
$config->siteTitle = Context::get('site_title');
|
|
||||||
$this->setModulesConfig($config);
|
|
||||||
|
|
||||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function procInstallAdminConfigIconUpload() {
|
|
||||||
$this->setTemplatePath($this->module_path.'tpl');
|
|
||||||
$this->setTemplateFile("after_upload_config_image.html");
|
|
||||||
|
|
||||||
$favicon = Context::get('favicon');
|
|
||||||
$mobicon = Context::get('mobicon');
|
|
||||||
if(!$favicon && !$mobicon) {
|
|
||||||
Context::set('msg', Context::getLang("msg_invalid_format"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if($favicon) {
|
|
||||||
$name = 'favicon';
|
|
||||||
$tmpFileName = $this->saveIconTmp($favicon,'favicon.ico');
|
|
||||||
} else {
|
|
||||||
$name = 'mobicon';
|
|
||||||
$tmpFileName = $this->saveIconTmp($mobicon,'mobicon.png');
|
|
||||||
}
|
|
||||||
|
|
||||||
Context::set('name', $name);
|
|
||||||
Context::set('tmpFileName', $tmpFileName.'?'.$_SERVER['REQUEST_TIME']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Supported languages (was procInstallAdminSaveLangSelected)
|
|
||||||
*/
|
|
||||||
function saveLangSelected($selected_lang)
|
|
||||||
{
|
|
||||||
$langs = $selected_lang;
|
|
||||||
|
|
||||||
$lang_supported = Context::loadLangSupported();
|
|
||||||
$buff = null;
|
|
||||||
for($i=0;$i<count($langs);$i++)
|
|
||||||
{
|
|
||||||
$buff .= sprintf("%s,%s\n", $langs[$i], $lang_supported[$langs[$i]]);
|
|
||||||
|
|
||||||
}
|
|
||||||
FileHandler::writeFile(_XE_PATH_.'files/config/lang_selected.info', trim($buff));
|
|
||||||
//$this->setMessage('success_updated');
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 썸내일 보여주기 방식 변경.*/
|
|
||||||
function setModulesConfig($config)
|
|
||||||
{
|
|
||||||
$args = new stdClass();
|
|
||||||
|
|
||||||
if(!$config->thumbnail_type || $config->thumbnail_type != 'ratio' ) $args->thumbnail_type = 'crop';
|
|
||||||
else $args->thumbnail_type = 'ratio';
|
|
||||||
|
|
||||||
$oModuleController = getController('module');
|
|
||||||
$oModuleController->insertModuleConfig('document',$args);
|
|
||||||
|
|
||||||
unset($args);
|
|
||||||
|
|
||||||
$args = new stdClass;
|
|
||||||
$args->htmlFooter = $config->htmlFooter;
|
|
||||||
$args->siteTitle = $config->siteTitle;
|
|
||||||
$oModuleController->updateModuleConfig('module',$args);
|
|
||||||
|
|
||||||
return $output;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function saveIconTmp($icon, $iconname)
|
|
||||||
{
|
|
||||||
|
|
||||||
$site_info = Context::get('site_module_info');
|
|
||||||
$virtual_site = '';
|
|
||||||
if($site_info->site_srl)
|
|
||||||
{
|
|
||||||
$virtual_site = $site_info->site_srl . '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
$target_file = $icon['tmp_name'];
|
|
||||||
$type = $icon['type'];
|
|
||||||
$relative_filename = 'files/attach/xeicon/'.$virtual_site.'tmp/'.$iconname;
|
|
||||||
$target_filename = _XE_PATH_.$relative_filename;
|
|
||||||
|
|
||||||
list($width, $height, $type_no, $attrs) = @getimagesize($target_file);
|
|
||||||
if($iconname == 'favicon.ico')
|
|
||||||
{
|
|
||||||
if(!preg_match('/^.*(x-icon|\.icon)$/i',$type)) {
|
|
||||||
Context::set('msg', '*.ico '.Context::getLang('msg_possible_only_file'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if($iconname == 'mobicon.png')
|
|
||||||
{
|
|
||||||
if(!preg_match('/^.*(png).*$/',$type)) {
|
|
||||||
Context::set('msg', '*.png '.Context::getLang('msg_possible_only_file'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(!(($height == '57' && $width == '57') || ($height == '114' && $width == '114'))) {
|
|
||||||
Context::set('msg', Context::getLang('msg_invalid_format').' (size : 57x57, 114x114)');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Context::set('msg', Context::getLang('msg_invalid_format'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$fitHeight = $fitWidth = $height;
|
|
||||||
//FileHandler::createImageFile($target_file, $target_filename, $fitHeight, $fitWidth, $ext);
|
|
||||||
FileHandler::copyFile($target_file, $target_filename);
|
|
||||||
return $relative_filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function updateIcon($iconname, $deleteIcon = false) {
|
|
||||||
|
|
||||||
$site_info = Context::get('site_module_info');
|
|
||||||
$virtual_site = '';
|
|
||||||
if($site_info->site_srl)
|
|
||||||
{
|
|
||||||
$virtual_site = $site_info->site_srl . '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
$image_filepath = _XE_PATH_.'files/attach/xeicon/' . $virtual_site;
|
|
||||||
|
|
||||||
if($deleteIcon) {
|
|
||||||
FileHandler::removeFile($image_filepath.$iconname);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$tmpicon_filepath = $image_filepath.'tmp/'.$iconname;
|
|
||||||
$icon_filepath = $image_filepath.$iconname;
|
|
||||||
if(file_exists($tmpicon_filepath))
|
|
||||||
{
|
|
||||||
FileHandler::moveFile($tmpicon_filepath, $icon_filepath);
|
|
||||||
}
|
|
||||||
|
|
||||||
FileHandler::removeFile($tmpicon_filepath);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/* End of file install.admin.controller.php */
|
/* End of file install.admin.controller.php */
|
||||||
/* Location: ./modules/install/install.admin.controller.php */
|
/* Location: ./modules/install/install.admin.controller.php */
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@
|
||||||
*/
|
*/
|
||||||
class installController extends install
|
class installController extends install
|
||||||
{
|
{
|
||||||
var $db_tmp_config_file = '';
|
|
||||||
var $etc_tmp_config_file = '';
|
|
||||||
var $flagLicenseAgreement = './files/env/license_agreement';
|
var $flagLicenseAgreement = './files/env/license_agreement';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -16,12 +14,12 @@ class installController extends install
|
||||||
*/
|
*/
|
||||||
function init()
|
function init()
|
||||||
{
|
{
|
||||||
// Error occurs if already installed
|
// Stop if already installed.
|
||||||
if(Context::isInstalled())
|
if (Context::isInstalled())
|
||||||
{
|
{
|
||||||
return new Object(-1, 'msg_already_installed');
|
return new Object(-1, 'msg_already_installed');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db_tmp_config_file = _XE_PATH_.'files/config/tmpDB.config.php';
|
$this->db_tmp_config_file = _XE_PATH_.'files/config/tmpDB.config.php';
|
||||||
$this->etc_tmp_config_file = _XE_PATH_.'files/config/tmpEtc.config.php';
|
$this->etc_tmp_config_file = _XE_PATH_.'files/config/tmpEtc.config.php';
|
||||||
}
|
}
|
||||||
|
|
@ -29,134 +27,204 @@ class installController extends install
|
||||||
/**
|
/**
|
||||||
* @brief division install step... DB Config temp file create
|
* @brief division install step... DB Config temp file create
|
||||||
*/
|
*/
|
||||||
function procDBSetting()
|
function procDBConfig()
|
||||||
{
|
{
|
||||||
// Get DB-related variables
|
// Get DB config variables.
|
||||||
$con_string = Context::gets('db_type','db_port','db_hostname','db_userid','db_password','db_database','db_table_prefix');
|
$config = Context::gets('db_type', 'db_host', 'db_port', 'db_user', 'db_pass', 'db_database', 'db_prefix');
|
||||||
$con_string->db_table_prefix = rtrim($con_string->db_table_prefix, '_');
|
|
||||||
|
// Create a temporary setting object.
|
||||||
$db_info = new stdClass();
|
Rhymix\Framework\Config::set('db.master', array(
|
||||||
$db_info->master_db = get_object_vars($con_string);
|
'type' => $config->db_type,
|
||||||
$db_info->slave_db = array($db_info->master_db);
|
'host' => $config->db_host,
|
||||||
$db_info->default_url = Context::getRequestUri();
|
'port' => $config->db_port,
|
||||||
$db_info->lang_type = Context::getLangType();
|
'user' => $config->db_user,
|
||||||
$db_info->use_mobile_view = 'Y';
|
'pass' => $config->db_pass,
|
||||||
|
'database' => $config->db_database,
|
||||||
// Set DB type and information
|
'prefix' => rtrim($config->db_prefix, '_') . '_',
|
||||||
Context::setDBInfo($db_info);
|
));
|
||||||
|
|
||||||
// Check if available to connect to the DB
|
// Check connection to the DB.
|
||||||
$oDB = &DB::getInstance();
|
$oDB = DB::getInstance();
|
||||||
$output = $oDB->getError();
|
$output = $oDB->getError();
|
||||||
if(!$output->toBool()) return $output;
|
if (!$output->toBool() || !$oDB->isConnected())
|
||||||
if(!$oDB->isConnected()) return $oDB->getError();
|
|
||||||
|
|
||||||
// Check if MySQL server supports InnoDB
|
|
||||||
if(stripos($con_string->db_type, 'innodb') !== false)
|
|
||||||
{
|
{
|
||||||
$innodb_supported = false;
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check MySQL server capabilities.
|
||||||
|
if(stripos($config->db_type, 'mysql') !== false)
|
||||||
|
{
|
||||||
|
// Check if InnoDB is supported.
|
||||||
$show_engines = $oDB->_fetch($oDB->_query('SHOW ENGINES'));
|
$show_engines = $oDB->_fetch($oDB->_query('SHOW ENGINES'));
|
||||||
foreach($show_engines as $engine_info)
|
foreach($show_engines as $engine_info)
|
||||||
{
|
{
|
||||||
if(strcasecmp($engine_info->Engine, 'InnoDB') === 0)
|
if ($engine_info->Engine === 'InnoDB')
|
||||||
{
|
{
|
||||||
$innodb_supported = true;
|
$config->db_type .= '_innodb';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If server does not support InnoDB, fall back to default storage engine (usually MyISAM)
|
// Check if utf8mb4 is supported.
|
||||||
if(!$innodb_supported)
|
$oDB->charset = $oDB->getBestSupportedCharset();
|
||||||
|
$config->db_charset = $oDB->charset;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if tables already exist.
|
||||||
|
$table_check = array('documents', 'comments', 'modules', 'sites');
|
||||||
|
foreach ($table_check as $table_name)
|
||||||
|
{
|
||||||
|
if ($oDB->isTableExists($table_name))
|
||||||
{
|
{
|
||||||
$con_string->db_type = str_ireplace('_innodb', '', $con_string->db_type);
|
return new Object(-1, 'msg_table_already_exists');
|
||||||
$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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a db temp config file
|
// Save DB config in session.
|
||||||
if(!$this->makeDBConfigFile()) return new Object(-1, 'msg_install_failed');
|
$_SESSION['db_config'] = $config;
|
||||||
|
|
||||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
|
// Continue the installation.
|
||||||
|
if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON')))
|
||||||
{
|
{
|
||||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'act', 'dispInstallManagerForm');
|
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'act', 'dispInstallOtherConfig');
|
||||||
header('location:'.$returnUrl);
|
$this->setRedirectUrl($returnUrl);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Install with received information
|
* @brief Install with received information
|
||||||
*/
|
*/
|
||||||
function procInstall()
|
function procInstall($install_config = null)
|
||||||
{
|
{
|
||||||
// Check if it is already installed
|
// Check if it is already installed
|
||||||
if(Context::isInstalled())
|
if (Context::isInstalled())
|
||||||
{
|
{
|
||||||
return new Object(-1, 'msg_already_installed');
|
return new Object(-1, 'msg_already_installed');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save rewrite and time zone settings
|
// Get install parameters.
|
||||||
if(!Context::get('install_config'))
|
$config = Rhymix\Framework\Config::getDefaults();
|
||||||
|
if ($install_config)
|
||||||
{
|
{
|
||||||
$config_info = Context::gets('use_rewrite','time_zone', 'use_ssl');
|
$install_config = (array)$install_config;
|
||||||
if($config_info->use_rewrite!='Y') $config_info->use_rewrite = 'N';
|
$config['db']['master']['type'] = str_replace('_innodb', '', $install_config['db_type']);
|
||||||
if(!$this->makeEtcConfigFile($config_info))
|
$config['db']['master']['host'] = $install_config['db_hostname'];
|
||||||
{
|
$config['db']['master']['port'] = $install_config['db_port'];
|
||||||
return new Object(-1, 'msg_install_failed');
|
$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
|
else
|
||||||
{
|
{
|
||||||
if(FileHandler::exists($this->db_tmp_config_file)) include $this->db_tmp_config_file;
|
$config['db']['master']['type'] = str_replace('_innodb', '', $_SESSION['db_config']->db_type);
|
||||||
if(FileHandler::exists($this->etc_tmp_config_file)) include $this->etc_tmp_config_file;
|
$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
|
// Fix the database table prefix.
|
||||||
Context::setDBInfo($db_info);
|
$config['db']['master']['prefix'] = rtrim($config['db']['master']['prefix'], '_');
|
||||||
// Create DB Instance
|
if ($config['db']['master']['prefix'] !== '')
|
||||||
$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']))
|
|
||||||
{
|
{
|
||||||
$oDB->charset = $oDB->getBestSupportedCharset();
|
$config['db']['master']['prefix'] .= '_';
|
||||||
$db_info->master_db['db_charset'] = $oDB->charset;
|
|
||||||
$db_info->slave_db[0]['db_charset'] = $oDB->charset;
|
|
||||||
Context::setDBInfo($db_info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Install all the modules
|
// Set the default language.
|
||||||
try {
|
$config['locale']['default_lang'] = Context::getLangType();
|
||||||
|
$config['locale']['enabled_lang'] = array($config['locale']['default_lang']);
|
||||||
|
|
||||||
|
// Set the default time zone.
|
||||||
|
if (strpos($time_zone, '/') !== false)
|
||||||
|
{
|
||||||
|
$config['locale']['default_timezone'] = $time_zone;
|
||||||
|
$user_timezone = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$user_timezone = intval(Rhymix\Framework\DateTime::getTimezoneOffsetByLegacyFormat($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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the internal time zone.
|
||||||
|
if ($config['locale']['default_timezone'] === 'Asia/Seoul')
|
||||||
|
{
|
||||||
|
$config['locale']['internal_timezone'] = 32400;
|
||||||
|
}
|
||||||
|
elseif ($user_timezone !== null)
|
||||||
|
{
|
||||||
|
$config['locale']['internal_timezone'] = $user_timezone * 3600;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$config['locale']['internal_timezone'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the default URL.
|
||||||
|
$config['url']['default'] = Context::getRequestUri();
|
||||||
|
|
||||||
|
// Load the new configuration.
|
||||||
|
Rhymix\Framework\Config::setAll($config);
|
||||||
|
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();
|
$oDB->begin();
|
||||||
$this->installDownloadedModule();
|
$this->installDownloadedModule();
|
||||||
$oDB->commit();
|
$oDB->commit();
|
||||||
} catch(Exception $e) {
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
$oDB->rollback();
|
$oDB->rollback();
|
||||||
return new Object(-1, $e->getMessage());
|
return new Object(-1, $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a config file
|
// Execute the install script.
|
||||||
if(!$this->makeConfigFile()) return new Object(-1, 'msg_install_failed');
|
|
||||||
|
|
||||||
// load script
|
|
||||||
$scripts = FileHandler::readDir(_XE_PATH_ . 'modules/install/script', '/(\.php)$/');
|
$scripts = FileHandler::readDir(_XE_PATH_ . 'modules/install/script', '/(\.php)$/');
|
||||||
if(count($scripts)>0)
|
if(count($scripts))
|
||||||
{
|
{
|
||||||
sort($scripts);
|
sort($scripts);
|
||||||
foreach($scripts as $script)
|
foreach($scripts as $script)
|
||||||
|
|
@ -165,48 +233,22 @@ class installController extends install
|
||||||
$output = include($script_path . $script);
|
$output = include($script_path . $script);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// save selected lang info
|
// Save the new configuration.
|
||||||
$oInstallAdminController = getAdminController('install');
|
Rhymix\Framework\Config::save();
|
||||||
$oInstallAdminController->saveLangSelected(array(Context::getLangType()));
|
$buff = '<?php' . "\n" . '$db_info = ' . Rhymix\Framework\Config::serialize(Context::getDBInfo()) . ';' . "\n";
|
||||||
|
FileHandler::writeFile(Context::getConfigFile(), $buff);
|
||||||
// Display a message that installation is completed
|
|
||||||
$this->setMessage('msg_install_completed');
|
// Unset temporary session variables.
|
||||||
|
|
||||||
unset($_SESSION['use_rewrite']);
|
unset($_SESSION['use_rewrite']);
|
||||||
|
unset($_SESSION['db_config']);
|
||||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
|
|
||||||
{
|
// Redirect to the home page.
|
||||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('');
|
$this->setMessage('msg_install_completed');
|
||||||
header('location:'.$returnUrl);
|
|
||||||
return new Object();
|
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : RX_BASEURL;
|
||||||
}
|
$this->setRedirectUrl($returnUrl);
|
||||||
}
|
return new Object();
|
||||||
|
|
||||||
/**
|
|
||||||
* @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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -436,7 +478,7 @@ class installController extends install
|
||||||
/**
|
/**
|
||||||
* @brief License agreement
|
* @brief License agreement
|
||||||
*/
|
*/
|
||||||
function procInstallLicenseAggrement()
|
function procInstallLicenseAgreement()
|
||||||
{
|
{
|
||||||
$vars = Context::getRequestVars();
|
$vars = Context::getRequestVars();
|
||||||
|
|
||||||
|
|
@ -575,133 +617,15 @@ class installController extends install
|
||||||
if(method_exists($oModule, 'moduleInstall')) $oModule->moduleInstall();
|
if(method_exists($oModule, 'moduleInstall')) $oModule->moduleInstall();
|
||||||
return new Object();
|
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[] = '<?php if(!defined("__XE__")) exit();';
|
|
||||||
$buff[] = '$db_info = (object)' . var_export(get_object_vars($db_info), TRUE) . ';';
|
|
||||||
|
|
||||||
return implode(PHP_EOL, $buff);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Create DB temp config file
|
* Placeholder for third-party apps that try to manipulate system configuration.
|
||||||
* Create the config file when all settings are completed
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function makeDBConfigFile()
|
public function makeConfigFile()
|
||||||
{
|
{
|
||||||
$db_tmp_config_file = $this->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 = '<?php if(!defined("__XE__")) exit();'."\n";
|
|
||||||
foreach($config_info as $key => $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><![CDATA[%s]]></%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 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n<methodCall>\r\n<params>\r\n";
|
|
||||||
foreach($auto_config as $k => $v)
|
|
||||||
{
|
|
||||||
if(!in_array($k,array('host','port','path'))) $body .= sprintf($fstr,$k,$v,$k);
|
|
||||||
}
|
|
||||||
$body .= "</params>\r\n</methodCall>";
|
|
||||||
|
|
||||||
$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('<error>', $line, 7) === 0)
|
|
||||||
{
|
|
||||||
fclose($fp);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fclose($fp);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* End of file install.controller.php */
|
/* End of file install.controller.php */
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,7 @@
|
||||||
*/
|
*/
|
||||||
class installView extends install
|
class installView extends install
|
||||||
{
|
{
|
||||||
public $install_enable = false;
|
public static $checkEnv = false;
|
||||||
|
|
||||||
public static $rewriteCheckFilePath = 'files/cache/tmpRewriteCheck.txt';
|
public static $rewriteCheckFilePath = 'files/cache/tmpRewriteCheck.txt';
|
||||||
public static $rewriteCheckString = '';
|
public static $rewriteCheckString = '';
|
||||||
|
|
||||||
|
|
@ -17,81 +16,56 @@ class installView extends install
|
||||||
*/
|
*/
|
||||||
function init()
|
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'));
|
Context::setBrowserTitle(Context::getLang('introduce_title'));
|
||||||
// Specify the template path
|
|
||||||
|
// Specify the template path.
|
||||||
$this->setTemplatePath($this->module_path.'tpl');
|
$this->setTemplatePath($this->module_path.'tpl');
|
||||||
// Error occurs if already installed
|
|
||||||
if(Context::isInstalled()) return $this->stop('msg_already_installed');
|
// Check the environment.
|
||||||
// Install a controller
|
|
||||||
$oInstallController = getController('install');
|
$oInstallController = getController('install');
|
||||||
$this->install_enable = $oInstallController->checkInstallEnv();
|
self::$checkEnv = $oInstallController->checkInstallEnv();
|
||||||
// If the environment is installable, execute installController::makeDefaultDirectory()
|
if (self::$checkEnv)
|
||||||
if($this->install_enable) $oInstallController->makeDefaultDirectory();
|
{
|
||||||
|
$oInstallController->makeDefaultDirectory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Display license messages
|
* @brief Index page
|
||||||
*/
|
*/
|
||||||
function dispInstallIntroduce()
|
function dispInstallIndex()
|
||||||
{
|
{
|
||||||
$install_config_file = FileHandler::getRealPath('./config/install.config.php');
|
// If there is an autoinstall config file, use it.
|
||||||
if(file_exists($install_config_file))
|
if (file_exists(RX_BASEDIR . 'config/install.config.php'))
|
||||||
{
|
{
|
||||||
/**
|
include 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 )
|
if (isset($install_config) && is_array($install_config))
|
||||||
$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))
|
|
||||||
{
|
{
|
||||||
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');
|
$oInstallController = getController('install');
|
||||||
$output = $oInstallController->procInstall();
|
$output = $oInstallController->procInstall($install_config);
|
||||||
if (!$output->toBool()) return $output;
|
if (!$output->toBool())
|
||||||
header("location: ./");
|
{
|
||||||
Context::close();
|
return $output;
|
||||||
exit;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->setRedirectUrl(RX_BASEURL);
|
||||||
|
return new Object();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context::set('l', Context::getLangType());
|
// Otherwise, display the license agreement screen.
|
||||||
return $this->dispInstallLicenseAgreement();
|
Context::set('lang_type', Context::getLangType());
|
||||||
//$this->setTemplateFile('introduce');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief License agreement
|
|
||||||
*/
|
|
||||||
function dispInstallLicenseAgreement()
|
|
||||||
{
|
|
||||||
$this->setTemplateFile('license_agreement');
|
$this->setTemplateFile('license_agreement');
|
||||||
|
|
||||||
$lang_type = Context::getLangType();
|
|
||||||
Context::set('lang_type', $lang_type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -99,111 +73,110 @@ class installView extends install
|
||||||
*/
|
*/
|
||||||
function dispInstallCheckEnv()
|
function dispInstallCheckEnv()
|
||||||
{
|
{
|
||||||
$oInstallController = getController('install');
|
// Create a temporary file for mod_rewrite check.
|
||||||
|
|
||||||
self::$rewriteCheckString = Password::createSecureSalt(32);
|
self::$rewriteCheckString = Password::createSecureSalt(32);
|
||||||
FileHandler::writeFile(_XE_PATH_ . self::$rewriteCheckFilePath, self::$rewriteCheckString);;
|
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');
|
$this->setTemplateFile('check_env');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Choose a DB
|
* @brief Configure the database
|
||||||
*/
|
*/
|
||||||
function dispInstallSelectDB()
|
function dispInstallDBConfig()
|
||||||
{
|
{
|
||||||
// Display check_env if it is not installable
|
// 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
|
// Delete mod_rewrite check file
|
||||||
FileHandler::removeFile(_XE_PATH_ . self::$rewriteCheckFilePath);
|
FileHandler::removeFile(_XE_PATH_ . self::$rewriteCheckFilePath);
|
||||||
|
|
||||||
// Save mod_rewrite check status
|
// Save mod_rewrite check status.
|
||||||
if(Context::get('rewrite') === 'Y')
|
if(Context::get('rewrite') === 'Y')
|
||||||
{
|
{
|
||||||
Context::set('use_rewrite', $_SESSION['use_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())
|
if(ini_get('safe_mode') && !Context::isFTPRegisted())
|
||||||
{
|
{
|
||||||
Context::set('progressMenu', '3');
|
Context::set('progressMenu', '3');
|
||||||
Context::set('server_ip_address', $_SERVER['SERVER_ADDR']);
|
Context::set('server_ip_address', $_SERVER['SERVER_ADDR']);
|
||||||
Context::set('server_ftp_user', get_current_user());
|
Context::set('server_ftp_user', get_current_user());
|
||||||
$this->setTemplateFile('ftp');
|
$this->setTemplateFile('ftp');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
*/
|
||||||
|
|
||||||
|
$defaultDatabase = 'mysqli';
|
||||||
|
$disableList = DB::getDisableList();
|
||||||
|
if(is_array($disableList))
|
||||||
{
|
{
|
||||||
$defaultDatabase = 'mysqli_innodb';
|
foreach($disableList as $key => $value)
|
||||||
$disableList = DB::getDisableList();
|
|
||||||
if(is_array($disableList))
|
|
||||||
{
|
{
|
||||||
foreach($disableList AS $key=>$value)
|
if($value->db_type == $defaultDatabase)
|
||||||
{
|
{
|
||||||
if($value->db_type == $defaultDatabase)
|
$defaultDatabase = 'mysql';
|
||||||
{
|
break;
|
||||||
$defaultDatabase = 'mysql';
|
|
||||||
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
|
* @brief Display a screen to enter DB and administrator's information
|
||||||
*/
|
*/
|
||||||
function dispInstallManagerForm()
|
function dispInstallOtherConfig()
|
||||||
{
|
{
|
||||||
// Display check_env if not installable
|
// Display check_env if not installable
|
||||||
if(!$this->install_enable)
|
if(!self::$checkEnv)
|
||||||
{
|
{
|
||||||
return $this->dispInstallCheckEnv();
|
return $this->dispInstallCheckEnv();
|
||||||
}
|
}
|
||||||
|
|
||||||
include _XE_PATH_.'files/config/tmpDB.config.php';
|
// Get list of time zones.
|
||||||
|
Context::set('timezones', Rhymix\Framework\DateTime::getTimezoneList());
|
||||||
Context::set('use_rewrite', $_SESSION['use_rewrite']);
|
|
||||||
|
// Automatically select a time zone for the user.
|
||||||
|
Context::set('selected_timezone', $this->detectUserTimeZone());
|
||||||
|
|
||||||
|
// Always use SSL if installing via SSL.
|
||||||
Context::set('use_ssl', RX_SSL ? 'always' : 'none');
|
Context::set('use_ssl', RX_SSL ? 'always' : 'none');
|
||||||
Context::set('time_zone', $GLOBALS['time_zone']);
|
$this->setTemplateFile('other_config');
|
||||||
Context::set('db_type', $db_info->db_type);
|
|
||||||
$this->setTemplateFile('admin_form');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check whether this server supports mod_rewrite
|
* Detect best time zone for the user.
|
||||||
*/
|
*/
|
||||||
function useRewriteModule()
|
function detectUserTimeZone()
|
||||||
{
|
{
|
||||||
if(function_exists('apache_get_modules') && in_array('mod_rewrite',apache_get_modules()))
|
switch (Context::getLangType())
|
||||||
{
|
{
|
||||||
return true;
|
case 'ko': return 'Asia/Seoul';
|
||||||
|
case 'en': return 'Europe/London';
|
||||||
|
case 'ja': return 'Asia/Tokyo';
|
||||||
|
case 'zh-CN': return 'Asia/Shanghai';
|
||||||
|
case 'zh-TW': return 'Asia/Taipei';
|
||||||
|
case 'de': return 'Europe/Berlin';
|
||||||
|
case 'es': return 'Europe/Madrid';
|
||||||
|
case 'fr': return 'Europe/Paris';
|
||||||
|
case 'mn': return 'Asia/Ulaanbaatar';
|
||||||
|
case 'ru': return 'Europe/Moscow';
|
||||||
|
case 'tr': return 'Europe/Istanbul';
|
||||||
|
case 'vi': return 'Asia/Ho_Chi_Minh';
|
||||||
|
default: return 'UTC';
|
||||||
}
|
}
|
||||||
|
|
||||||
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, '<?xml') !== 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* End of file install.view.php */
|
/* End of file install.view.php */
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,8 @@ $lang->cmd_install_refresh_page = 'Refresh';
|
||||||
$lang->cmd_install_next = 'Continue installation';
|
$lang->cmd_install_next = 'Continue installation';
|
||||||
$lang->cmd_ignore = 'Ignore';
|
$lang->cmd_ignore = 'Ignore';
|
||||||
$lang->cmd_recommended = 'Recommended';
|
$lang->cmd_recommended = 'Recommended';
|
||||||
$lang->db_desc['mysqli'] = 'Use MySQL as a database via the mysqli extension.<br />Use the MyISAM storage engine, which does not support transactions.';
|
$lang->db_desc['mysqli'] = 'Use MySQL as a database via the mysqli extension.';
|
||||||
$lang->db_desc['mysqli_innodb'] = 'Use MySQL as a database via the mysqli extension.<br />Use the InnoDB storage engine, which supports transactions and higher concurrency.';
|
$lang->db_desc['mysql'] = 'Use MySQL as a database via mysql_* functions.';
|
||||||
$lang->db_desc['mysql'] = 'Use MySQL as a database via PHP\'s mysql_* functions.<br />Use the MyISAM storage engine, which does not support transactions.';
|
|
||||||
$lang->db_desc['mysql_innodb'] = 'Use MySQL as a database via PHP\'s mysql_* functions.<br />Use the InnoDB storage engine, which supports transactions and higher concurrency.';
|
|
||||||
$lang->db_desc['cubrid'] = 'Use CUBRID as a database. See <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a> for more info';
|
$lang->db_desc['cubrid'] = 'Use CUBRID as a database. See <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a> for more info';
|
||||||
$lang->db_desc['mssql'] = 'Use Microsoft SQL Server as a database.';
|
$lang->db_desc['mssql'] = 'Use Microsoft SQL Server as a database.';
|
||||||
$lang->can_use_when_installed = 'Not installed on this server';
|
$lang->can_use_when_installed = 'Not installed on this server';
|
||||||
|
|
@ -84,6 +82,7 @@ $lang->ssl_options['optional'] = 'Optional';
|
||||||
$lang->ssl_options['always'] = 'Always';
|
$lang->ssl_options['always'] = 'Always';
|
||||||
$lang->about_database_file = 'Sqlite saves data in a file. Location of the database file should be unreachable by web<br/><span style="color:red">Data file should be inside the permission of 777.</span>';
|
$lang->about_database_file = 'Sqlite saves data in a file. Location of the database file should be unreachable by web<br/><span style="color:red">Data file should be inside the permission of 777.</span>';
|
||||||
$lang->success_installed = 'Installation has been completed.';
|
$lang->success_installed = 'Installation has been completed.';
|
||||||
|
$lang->msg_installing = 'Installing...';
|
||||||
$lang->msg_cannot_proc = 'Installation environment is not proper to proceed.';
|
$lang->msg_cannot_proc = 'Installation environment is not proper to proceed.';
|
||||||
$lang->msg_already_installed = 'RhymiX is already installed.';
|
$lang->msg_already_installed = 'RhymiX is already installed.';
|
||||||
$lang->msg_dbconnect_failed = 'An error has occurred while connecting to DB. Please check DB information again.';
|
$lang->msg_dbconnect_failed = 'An error has occurred while connecting to DB. Please check DB information again.';
|
||||||
|
|
@ -91,6 +90,7 @@ $lang->msg_table_is_exists = 'Table is already created in the DB. Config file is
|
||||||
$lang->msg_install_completed = 'Installation has been completed. Thank you for choosing RhymiX.';
|
$lang->msg_install_completed = 'Installation has been completed. Thank you for choosing RhymiX.';
|
||||||
$lang->msg_install_failed = 'An error has occurred while creating installation file.';
|
$lang->msg_install_failed = 'An error has occurred while creating installation file.';
|
||||||
$lang->msg_create_table_failed = 'Failed to create database tables.';
|
$lang->msg_create_table_failed = 'Failed to create database tables.';
|
||||||
|
$lang->msg_table_already_exists = 'Database tables already exist. Try using a different prefix.';
|
||||||
$lang->ftp_get_list = 'Get List';
|
$lang->ftp_get_list = 'Get List';
|
||||||
$lang->ftp_form_title = 'FTP Account Information';
|
$lang->ftp_form_title = 'FTP Account Information';
|
||||||
$lang->ftp = 'FTP';
|
$lang->ftp = 'FTP';
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,8 @@ $lang->install_permission_denied = 'La atribución de la ruta de instalacion no
|
||||||
$lang->cmd_install_refresh_page = 'Refrescar';
|
$lang->cmd_install_refresh_page = 'Refrescar';
|
||||||
$lang->cmd_install_next = 'Continuar la instalación';
|
$lang->cmd_install_next = 'Continuar la instalación';
|
||||||
$lang->cmd_recommended = 'Recomendado';
|
$lang->cmd_recommended = 'Recomendado';
|
||||||
$lang->db_desc['mysqli'] = 'Utilizando las funciones mysqli*() de PHP usar DB mysql.<br />La transacción es desabilitado ya que DB(Bases de Datos) está creado por myisam.';
|
$lang->db_desc['mysqli'] = 'Utilizando las funciones mysqli*() de PHP usar DB mysql.';
|
||||||
$lang->db_desc['mysqli_innodb'] = 'Utilizando innodb usar BD mysql.<br />La transacción es hablilitado para innodb';
|
$lang->db_desc['mysql'] = 'Utilizando las funciones mysql_*() de PHP usar DB mysql.';
|
||||||
$lang->db_desc['mysql'] = 'Utilizando las funciones mysql_*() de PHP usar DB mysql.<br />La transacción es desabilitado ya que DB(Bases de Datos) está creado por myisam.';
|
|
||||||
$lang->db_desc['mysql_innodb'] = 'Utilizando innodb usar BD mysql.<br />La transacción es hablilitado para innodb';
|
|
||||||
$lang->db_desc['cubrid'] = 'Usar BD CUBRID. <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
$lang->db_desc['cubrid'] = 'Usar BD CUBRID. <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
||||||
$lang->db_desc['mssql'] = 'Usar Microsoft SQL Server.';
|
$lang->db_desc['mssql'] = 'Usar Microsoft SQL Server.';
|
||||||
$lang->form_title = 'Ingresar BD & Información del Administrador;';
|
$lang->form_title = 'Ingresar BD & Información del Administrador;';
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,8 @@ $lang->install_permission_denied = 'La permission du chemin d\'installation n\'e
|
||||||
$lang->cmd_install_refresh_page = 'Rafraîchir';
|
$lang->cmd_install_refresh_page = 'Rafraîchir';
|
||||||
$lang->cmd_install_next = 'Continuer à installer';
|
$lang->cmd_install_next = 'Continuer à installer';
|
||||||
$lang->cmd_recommended = 'Recommandé';
|
$lang->cmd_recommended = 'Recommandé';
|
||||||
$lang->db_desc['mysqli'] = 'Utilisera fonction mysqli*() pour utiliser la base de données de mysql.<br />La transaction sera invalidé parce que le fichier de Base de Données est créé par myisam.';
|
$lang->db_desc['mysqli'] = 'Utilisera fonction mysqli_*() pour utiliser la base de données de MySQL.';
|
||||||
$lang->db_desc['mysqli_innodb'] = 'Utilisera innodb pour utiliser Base de Données de mysql.<br />La transaction sera validé pour innodb';
|
$lang->db_desc['mysql'] = 'Utilisera fonction mysql_*() pour utiliser la base de données de MySQL';
|
||||||
$lang->db_desc['mysql'] = 'Utilisera fonction mysql_*() pour utiliser la base de données de mysql.<br />La transaction sera invalidé parce que le fichier de Base de Données est créé par myisam.';
|
|
||||||
$lang->db_desc['mysql_innodb'] = 'Utilisera innodb pour utiliser Base de Données de mysql.<br />La transaction sera validé pour innodb';
|
|
||||||
$lang->db_desc['cubrid'] = 'Utiliser la Base de Données de CUBRID. <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
$lang->db_desc['cubrid'] = 'Utiliser la Base de Données de CUBRID. <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
||||||
$lang->db_desc['mssql'] = 'Utiliser la Base de Données de Microsoft SQL Server.';
|
$lang->db_desc['mssql'] = 'Utiliser la Base de Données de Microsoft SQL Server.';
|
||||||
$lang->can_use_when_installed = 'Pas installé sur ce serveur';
|
$lang->can_use_when_installed = 'Pas installé sur ce serveur';
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,8 @@ $lang->cmd_install_refresh_page = 'リフレッシュ';
|
||||||
$lang->cmd_install_next = 'インストールを続けます。';
|
$lang->cmd_install_next = 'インストールを続けます。';
|
||||||
$lang->cmd_ignore = 'FTP設定を省略する';
|
$lang->cmd_ignore = 'FTP設定を省略する';
|
||||||
$lang->cmd_recommended = '推奨';
|
$lang->cmd_recommended = '推奨';
|
||||||
$lang->db_desc['mysqli'] = 'mysqliモジュールを使用してMySQL DBに接続します。<br />MyISAMのエンジンを使用するので、トランザクションが行われず、データの損傷の危険があります。';
|
$lang->db_desc['mysqli'] = 'mysqliモジュールを使用してMySQL DBに接続します。';
|
||||||
$lang->db_desc['mysqli_innodb'] = 'mysqliモジュールを使用してMySQL DBに接続します。<br />InnoDBのエンジンは、トランザクションを支援してデータの損傷の危険が低く、同時処理能力が優れています。';
|
$lang->db_desc['mysql'] = 'mysql_*()関数を使用してMySQL DBに接続します。';
|
||||||
$lang->db_desc['mysql'] = 'PHPのmysql_*()関数を使用してMySQL DBに接続します。<br />MyISAMのエンジンを使用するので、トランザクションが行われず、データの損傷の危険があります。';
|
|
||||||
$lang->db_desc['mysql_innodb'] = 'PHPのmysql_*()関数を使用してMySQL DBに接続します。<br />InnoDBのエンジンは、トランザクションを支援してデータの損傷の危険が低く、同時処理能力が優れています。';
|
|
||||||
$lang->db_desc['cubrid'] = 'CUBRID DBを利用します。 <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
$lang->db_desc['cubrid'] = 'CUBRID DBを利用します。 <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
||||||
$lang->db_desc['mssql'] = 'Microsoft SQL Serverを利用します。';
|
$lang->db_desc['mssql'] = 'Microsoft SQL Serverを利用します。';
|
||||||
$lang->can_use_when_installed = 'このサーバーにインストールされていません';
|
$lang->can_use_when_installed = 'このサーバーにインストールされていません';
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,8 @@ $lang->cmd_install_refresh_page = '새로고침';
|
||||||
$lang->cmd_install_next = '설치를 진행합니다.';
|
$lang->cmd_install_next = '설치를 진행합니다.';
|
||||||
$lang->cmd_ignore = '무시';
|
$lang->cmd_ignore = '무시';
|
||||||
$lang->cmd_recommended = '권장';
|
$lang->cmd_recommended = '권장';
|
||||||
$lang->db_desc['mysqli'] = 'mysqli 모듈을 사용하여 MySQL DB에 접속합니다.<br />MyISAM 저장엔진을 사용하므로 트랜잭션이 이루어지지 않으며 데이터 손상의 위험이 있습니다.';
|
$lang->db_desc['mysqli'] = 'mysqli 모듈을 사용하여 MySQL DB에 접속합니다.';
|
||||||
$lang->db_desc['mysqli_innodb'] = 'mysqli 모듈을 사용하여 MySQL DB에 접속합니다.<br />InnoDB 저장엔진은 트랜잭션을 지원하여 데이터 손상의 위험이 낮으며, 동시 처리 능력이 뛰어납니다.';
|
$lang->db_desc['mysql'] = 'mysql_*() 함수를 사용하여 MySQL DB에 접속합니다.';
|
||||||
$lang->db_desc['mysql'] = 'PHP의 mysql_*() 함수를 사용하여 MySQL DB에 접속합니다.<br />MyISAM 저장엔진을 사용하므로 트랜잭션이 이루어지지 않으며 데이터 손상의 위험이 있습니다.';
|
|
||||||
$lang->db_desc['mysql_innodb'] = 'PHP의 mysql_*() 함수를 사용하여 MySQL DB에 접속합니다.<br />InnoDB 저장엔진은 트랜잭션을 지원하여 데이터 손상의 위험이 낮으며, 동시 처리 능력이 뛰어납니다.';
|
|
||||||
$lang->db_desc['cubrid'] = 'CUBRID DB를 이용합니다. <a href="http://www.cubrid.com/zbxe/?mid=bbs_developer_tutorial&category=47452" target="_blank">Manual</a>';
|
$lang->db_desc['cubrid'] = 'CUBRID DB를 이용합니다. <a href="http://www.cubrid.com/zbxe/?mid=bbs_developer_tutorial&category=47452" target="_blank">Manual</a>';
|
||||||
$lang->db_desc['mssql'] = 'Microsoft SQL Server를 이용합니다.';
|
$lang->db_desc['mssql'] = 'Microsoft SQL Server를 이용합니다.';
|
||||||
$lang->can_use_when_installed = '설치되어 있지 않음';
|
$lang->can_use_when_installed = '설치되어 있지 않음';
|
||||||
|
|
@ -85,12 +83,14 @@ $lang->ssl_options['always'] = '항상 사용';
|
||||||
$lang->about_database_file = 'Sqlite는 파일에 데이터를 저장합니다. 데이터베이스 파일의 위치를 웹에서 접근할 수 없는 곳으로 해야 합니다.<br/><span style="color:red">데이터 파일은 777퍼미션 설정된 곳으로 지정해주세요.</span>';
|
$lang->about_database_file = 'Sqlite는 파일에 데이터를 저장합니다. 데이터베이스 파일의 위치를 웹에서 접근할 수 없는 곳으로 해야 합니다.<br/><span style="color:red">데이터 파일은 777퍼미션 설정된 곳으로 지정해주세요.</span>';
|
||||||
$lang->success_installed = '설치가 되었습니다.';
|
$lang->success_installed = '설치가 되었습니다.';
|
||||||
$lang->msg_cannot_proc = '설치 환경이 갖춰지지 않아 요청을 실행할 수가 없습니다.';
|
$lang->msg_cannot_proc = '설치 환경이 갖춰지지 않아 요청을 실행할 수가 없습니다.';
|
||||||
|
$lang->msg_installing = '설치 중입니다...';
|
||||||
$lang->msg_already_installed = '이미 설치가 되어 있습니다.';
|
$lang->msg_already_installed = '이미 설치가 되어 있습니다.';
|
||||||
$lang->msg_dbconnect_failed = 'DB접속 오류가 발생하였습니다. DB정보를 다시 확인해주세요.';
|
$lang->msg_dbconnect_failed = 'DB접속 오류가 발생하였습니다. DB정보를 다시 확인해주세요.';
|
||||||
$lang->msg_table_is_exists = '이미 DB에 테이블이 생성되어 있습니다. config 파일을 재생성하였습니다.';
|
$lang->msg_table_is_exists = '이미 DB에 테이블이 생성되어 있습니다. config 파일을 재생성하였습니다.';
|
||||||
$lang->msg_install_completed = '설치가 완료되었습니다. 감사합니다.';
|
$lang->msg_install_completed = '설치가 완료되었습니다. 감사합니다.';
|
||||||
$lang->msg_install_failed = '설치 파일 생성 시에 오류가 발생하였습니다.';
|
$lang->msg_install_failed = '설치 파일 생성 시에 오류가 발생하였습니다.';
|
||||||
$lang->msg_create_table_failed = 'DB 테이블 생성에 실패했습니다.';
|
$lang->msg_create_table_failed = 'DB 테이블 생성에 실패했습니다.';
|
||||||
|
$lang->msg_table_already_exists = 'DB 테이블이 이미 존재합니다. 다른 사이트에서 사용중인 DB라면 테이블 접두사를 바꾸어 보십시오.';
|
||||||
$lang->ftp_get_list = '목록 가져오기';
|
$lang->ftp_get_list = '목록 가져오기';
|
||||||
$lang->ftp_form_title = 'FTP 계정 정보 입력';
|
$lang->ftp_form_title = 'FTP 계정 정보 입력';
|
||||||
$lang->ftp = 'FTP';
|
$lang->ftp = 'FTP';
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,8 @@ $lang->install_permission_denied = 'Права доступа пути не ус
|
||||||
$lang->cmd_install_refresh_page = 'обновление';
|
$lang->cmd_install_refresh_page = 'обновление';
|
||||||
$lang->cmd_install_next = 'Продолжить установку';
|
$lang->cmd_install_next = 'Продолжить установку';
|
||||||
$lang->cmd_recommended = 'рекомендуемые';
|
$lang->cmd_recommended = 'рекомендуемые';
|
||||||
$lang->db_desc['mysqli'] = 'Используем mysqli*() функцию, чтобы использовать базу данных mysql.<br />Транзакция отключена из-за того, что файл базы данных создан посредством myisam.';
|
$lang->db_desc['mysqli'] = 'Используем mysqli_*() функцию, чтобы использовать базу данных mysql.';
|
||||||
$lang->db_desc['mysqli_innodb'] = 'Используем innodb чтобы использовать базу данных mysql.<br />Транзакция включена для innodb';
|
$lang->db_desc['mysql'] = 'Используем mysql_*() функцию, чтобы использовать базу данных mysql.';
|
||||||
$lang->db_desc['mysql'] = 'Используем mysql_*() функцию, чтобы использовать базу данных mysql.<br />Транзакция отключена из-за того, что файл базы данных создан посредством myisam.';
|
|
||||||
$lang->db_desc['mysql_innodb'] = 'Используем innodb чтобы использовать базу данных mysql.<br />Транзакция включена для innodb';
|
|
||||||
$lang->db_desc['cubrid'] = 'Используем CUBRID DB. <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
$lang->db_desc['cubrid'] = 'Используем CUBRID DB. <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
||||||
$lang->db_desc['mssql'] = 'Используем Microsoft SQL Server DB.';
|
$lang->db_desc['mssql'] = 'Используем Microsoft SQL Server DB.';
|
||||||
$lang->form_title = 'Пожалуйста, введите дазу данных & Административная Информация';
|
$lang->form_title = 'Пожалуйста, введите дазу данных & Административная Информация';
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,8 @@ $lang->cmd_install_refresh_page = 'Gerekli koşulları tamamladım.';
|
||||||
$lang->cmd_install_next = 'Kuruluma Devam Et';
|
$lang->cmd_install_next = 'Kuruluma Devam Et';
|
||||||
$lang->cmd_ignore = 'Önemseme';
|
$lang->cmd_ignore = 'Önemseme';
|
||||||
$lang->cmd_recommended = 'Tavsiye edilen';
|
$lang->cmd_recommended = 'Tavsiye edilen';
|
||||||
$lang->db_desc['mysqli'] = 'PHP\'de mysqli*() özellikleri için MySQL\'ü veritabanı olarak kullanınız.<br />İşlemler, veritabanı dosyası myisam \'da oluşturulduğu zaman işlenmeyecektir.';
|
$lang->db_desc['mysqli'] = 'PHP\'de mysqli_*() özellikleri için MySQL\'ü veritabanı olarak kullanınız.';
|
||||||
$lang->db_desc['mysqli_innodb'] = 'innodb ile MySQL\'ü veritabanı olrak kullanınız.<br />İşlemler, innodb ile işlenecektir';
|
$lang->db_desc['mysql'] = 'PHP\'de mysql_*() özellikleri için MySQL\'ü veritabanı olarak kullanınız.';
|
||||||
$lang->db_desc['mysql'] = 'PHP\'de mysql_*() özellikleri için MySQL\'ü veritabanı olarak kullanınız.<br />İşlemler, veritabanı dosyası myisam \'da oluşturulduğu zaman işlenmeyecektir.';
|
|
||||||
$lang->db_desc['mysql_innodb'] = 'innodb ile MySQL\'ü veritabanı olrak kullanınız.<br />İşlemler, innodb ile işlenecektir';
|
|
||||||
$lang->db_desc['cubrid'] = 'CUBRID\'ü veritabanı olarak kullanın. Daha fazla bilgi için <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manuel</a>i inceleyiniz';
|
$lang->db_desc['cubrid'] = 'CUBRID\'ü veritabanı olarak kullanın. Daha fazla bilgi için <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manuel</a>i inceleyiniz';
|
||||||
$lang->db_desc['mssql'] = 'Microsoft SQL Server\'ü veritabanı olarak kullanın';
|
$lang->db_desc['mssql'] = 'Microsoft SQL Server\'ü veritabanı olarak kullanın';
|
||||||
$lang->form_title = 'Veritabanı & Yönetici Bilgisi';
|
$lang->form_title = 'Veritabanı & Yönetici Bilgisi';
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,8 @@ $lang->cmd_install_refresh_page = 'Tôi đã thay đổi để phù hợp với
|
||||||
$lang->cmd_install_next = 'Tiếp tục cài đặt';
|
$lang->cmd_install_next = 'Tiếp tục cài đặt';
|
||||||
$lang->cmd_ignore = 'Bỏ qua';
|
$lang->cmd_ignore = 'Bỏ qua';
|
||||||
$lang->cmd_recommended = 'Đê';
|
$lang->cmd_recommended = 'Đê';
|
||||||
$lang->db_desc['mysqli'] = 'Dùng chức năng <b>mysqli*()</b> để sử dụng MySql Database.<br />Giao dịch được vô hiệu hóa bởi File Database được tạo ra bởi myisam.';
|
$lang->db_desc['mysqli'] = 'Dùng chức năng <b>mysqli_*()</b> để sử dụng MySql Database.';
|
||||||
$lang->db_desc['mysqli_innodb'] = 'Dùng chức năng <b>innodb</b> để sử dụng MySql Database.<br />Giao dịch được kích hoạt cho innodb';
|
$lang->db_desc['mysql'] = 'Dùng chức năng <b>mysql_*()</b> để sử dụng MySql Database.';
|
||||||
$lang->db_desc['mysql'] = 'Dùng chức năng <b>mysql_*()</b> để sử dụng MySql Database.<br />Giao dịch được vô hiệu hóa bởi File Database được tạo ra bởi myisam.';
|
|
||||||
$lang->db_desc['mysql_innodb'] = 'Dùng chức năng <b>innodb</b> để sử dụng MySql Database.<br />Giao dịch được kích hoạt cho innodb';
|
|
||||||
$lang->db_desc['cubrid'] = 'Sử dụng <b>CUBRID</b> Database. <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Hướng dẫn</a>';
|
$lang->db_desc['cubrid'] = 'Sử dụng <b>CUBRID</b> Database. <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Hướng dẫn</a>';
|
||||||
$lang->form_title = 'Hãy nhập thông tin Database và thông tin Administrator';
|
$lang->form_title = 'Hãy nhập thông tin Database và thông tin Administrator';
|
||||||
$lang->db_title = 'Xin hãy nhập thông tin Database';
|
$lang->db_title = 'Xin hãy nhập thông tin Database';
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,8 @@ $lang->cmd_install_refresh_page = '刷新屏幕';
|
||||||
$lang->cmd_install_next = '开始安装';
|
$lang->cmd_install_next = '开始安装';
|
||||||
$lang->cmd_ignore = '忽略';
|
$lang->cmd_ignore = '忽略';
|
||||||
$lang->cmd_recommended = '推荐';
|
$lang->cmd_recommended = '推荐';
|
||||||
$lang->db_desc['mysqli'] = '利用php的 mysqli*()函数使用mysql DB。<br />DB数据是以myisam生成,因此不能实现transaction。';
|
$lang->db_desc['mysqli'] = '利用php的 mysqli*()函数使用mysql DB。';
|
||||||
$lang->db_desc['mysqli_innodb'] = '利用innodb使用mysql DB。<br />innodb可以使用transaction。';
|
$lang->db_desc['mysql'] = '利用php的 mysql_*()函数使用mysql DB。';
|
||||||
$lang->db_desc['mysql'] = '利用php的 mysql_*()函数使用mysql DB。<br />DB数据是以myisam生成,因此不能实现transaction。';
|
|
||||||
$lang->db_desc['mysql_innodb'] = '利用innodb使用mysql DB。<br />innodb可以使用transaction。';
|
|
||||||
$lang->db_desc['cubrid'] = '使用CUBRID DB。 <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
$lang->db_desc['cubrid'] = '使用CUBRID DB。 <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
||||||
$lang->db_desc['mssql'] = '使用 Microsoft SQL Server。';
|
$lang->db_desc['mssql'] = '使用 Microsoft SQL Server。';
|
||||||
$lang->can_use_when_installed = '不是这个服务器上安装';
|
$lang->can_use_when_installed = '不是这个服务器上安装';
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,8 @@ $lang->cmd_install_refresh_page = '刷新屏幕';
|
||||||
$lang->cmd_install_next = '開始進行安裝';
|
$lang->cmd_install_next = '開始進行安裝';
|
||||||
$lang->cmd_ignore = '忽略';
|
$lang->cmd_ignore = '忽略';
|
||||||
$lang->cmd_recommended = '推薦';
|
$lang->cmd_recommended = '推薦';
|
||||||
$lang->db_desc['mysqli'] = '利用 PHP 的『mysqli*()』函數使用 MySQL 資料庫。<br />利用『myisam』建立資料庫檔案,因此不能實現transaction。';
|
$lang->db_desc['mysqli'] = '利用 PHP 的『mysqli*()』函數使用 MySQL 資料庫。';
|
||||||
$lang->db_desc['mysqli_innodb'] = '利用『innodb』使用 Mysql 資料庫。<br />innodb可以使用 transaction。';
|
$lang->db_desc['mysql'] = '利用 PHP 的『mysql_*()』函數使用 MySQL 資料庫。';
|
||||||
$lang->db_desc['mysql'] = '利用 PHP 的『mysql_*()』函數使用 MySQL 資料庫。<br />利用『myisam』建立資料庫檔案,因此不能實現transaction。';
|
|
||||||
$lang->db_desc['mysql_innodb'] = '利用『innodb』使用 Mysql 資料庫。<br />innodb可以使用 transaction。';
|
|
||||||
$lang->db_desc['cubrid'] = '使用 CUBRID DB。 <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
$lang->db_desc['cubrid'] = '使用 CUBRID DB。 <a href="http://www.cubrid.org/wiki_tutorials/entry/cubrid-installation-instructions" target="_blank">Manual</a>';
|
||||||
$lang->db_desc['mssql'] = '使用 Microsoft SQL Server。';
|
$lang->db_desc['mssql'] = '使用 Microsoft SQL Server。';
|
||||||
$lang->can_use_when_installed = '不是這個服務器上安裝';
|
$lang->can_use_when_installed = '不是這個服務器上安裝';
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,5 @@
|
||||||
<field name="password2" required="true" length="1:60" equalto="password" />
|
<field name="password2" required="true" length="1:60" equalto="password" />
|
||||||
<field name="nick_name" required="true" length="2:20" />
|
<field name="nick_name" required="true" length="2:20" />
|
||||||
<field name="user_id" required="true" length="2:20" rule="userid" />
|
<field name="user_id" required="true" length="2:20" rule="userid" />
|
||||||
<field name="time_zone" required="true" />
|
|
||||||
</fields>
|
</fields>
|
||||||
</ruleset>
|
</ruleset>
|
||||||
|
|
|
||||||
|
|
@ -269,7 +269,7 @@ $obj->email_address = $logged_info->email_address;
|
||||||
|
|
||||||
$obj->module_srl = $module_srl;
|
$obj->module_srl = $module_srl;
|
||||||
Context::set('version', __XE_VERSION__);
|
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);
|
$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');
|
$document_srl = $output->get('document_srl');
|
||||||
|
|
||||||
unset($obj->document_srl);
|
unset($obj->document_srl);
|
||||||
$obj->title = 'Welcome mobile Rhymix';
|
$obj->title = 'Welcome to Mobile Rhymix';
|
||||||
$output = $oDocumentController->insertDocument($obj, true);
|
$output = $oDocumentController->insertDocument($obj, true);
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
<tr id="mod_rewrite_no_support" style="display:none">
|
<tr id="mod_rewrite_no_support" style="display:none">
|
||||||
<td colspan="2" class="error_description">
|
<td colspan="2" class="error_description">
|
||||||
{$lang->disable_rewrite}
|
{$lang->disable_rewrite}
|
||||||
<block cond="$use_nginx == 'Y'"><br />{$lang->about_nginx_rewrite}</block>
|
<block cond="$use_nginx"><br />{$lang->about_nginx_rewrite}</block>
|
||||||
<br /><strong>{$lang->disable_rewrite_can_proceed}</strong>
|
<br /><strong>{$lang->disable_rewrite_can_proceed}</strong>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
<a href="{getUrl('', 'act','dispInstallLicenseAgreement')}" class="button grey">« {$lang->cmd_back}</a>
|
<a href="{getUrl('', 'act','dispInstallLicenseAgreement')}" class="button grey">« {$lang->cmd_back}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="align-right">
|
<div class="align-right">
|
||||||
<a cond="$install_enable" class="button" id="task-checklist-confirm" href="{getUrl('','act','dispInstallSelectDB')}">{$lang->cmd_next} »</a>
|
<a cond="$install_enable" class="button" id="task-checklist-confirm" href="{getUrl('','act','dispInstallDBConfig')}">{$lang->cmd_next} »</a>
|
||||||
<a cond="!$install_enable" class="button" id="task-checklist-fix" href="{getUrl('','act',$act)}">{$lang->cmd_install_refresh_page} »</a>
|
<a cond="!$install_enable" class="button" id="task-checklist-fix" href="{getUrl('','act',$act)}">{$lang->cmd_install_refresh_page} »</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" value="{$error_return_url}" name="error_return_url">
|
<input type="hidden" value="{$error_return_url}" name="error_return_url">
|
||||||
<input type="hidden" name="module" value="{$module}" />
|
<input type="hidden" name="module" value="{$module}" />
|
||||||
<input type="hidden" name="act" value="procDBSetting" />
|
<input type="hidden" name="act" value="procDBConfig" />
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label for="db_type" class="x_control-label">{$lang->db_type}</label>
|
<label for="db_type" class="x_control-label">{$lang->db_type}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
<block loop="DB::getEnableList() => $key,$val">
|
<block loop="DB::getEnableList() => $key,$val">
|
||||||
<option value="{$val->db_type}" selected="selected"|cond="$val->db_type==$defaultDatabase" />
|
<option value="{$val->db_type}" selected="selected"|cond="$val->db_type==$defaultDatabase" />
|
||||||
{$val->db_type}
|
{$val->db_type}
|
||||||
<block cond="$val->db_type==$defaultDatabase && stripos($val->db_type, 'innodb') !== false">({$lang->cmd_recommended})</block>
|
<block cond="$val->db_type == $defaultDatabase">({$lang->cmd_recommended})</block>
|
||||||
</option>
|
</option>
|
||||||
</block>
|
</block>
|
||||||
<block loop="DB::getDisableList() => $key,$val">
|
<block loop="DB::getDisableList() => $key,$val">
|
||||||
|
|
@ -27,28 +27,28 @@
|
||||||
</div>
|
</div>
|
||||||
<p loop="DB::getEnableList() => $key,$val" class="install_help db_type db_type_{$val->db_type}">{$lang->db_desc[$val->db_type]}</p>
|
<p loop="DB::getEnableList() => $key,$val" class="install_help db_type db_type_{$val->db_type}">{$lang->db_desc[$val->db_type]}</p>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label for="dbHostName" class="x_control-label">{$lang->db_hostname}</label>
|
<label for="db_host" class="x_control-label">{$lang->db_hostname}</label>
|
||||||
<div class="x_controls"><input name="db_hostname" value="localhost" type="text" id="dbHostName" required /></div>
|
<div class="x_controls"><input name="db_host" value="localhost" type="text" id="db_host" required /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label for="dbPort" class="x_control-label">{$lang->db_port}</label>
|
<label for="db_port" class="x_control-label">{$lang->db_port}</label>
|
||||||
<div class="x_controls"><input name="db_port" value="3306" type="text" id="dbPort" required /></div>
|
<div class="x_controls"><input name="db_port" value="3306" type="text" id="db_port" required /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label for="dbId" class="x_control-label">{$lang->db_userid}</label>
|
<label for="db_user" class="x_control-label">{$lang->db_userid}</label>
|
||||||
<div class="x_controls"><input name="db_userid" type="text" id="dbId" class="focus" required /></div>
|
<div class="x_controls"><input name="db_user" type="text" id="db_user" class="focus" required /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label for="dbPw" class="x_control-label">{$lang->db_password}</label>
|
<label for="db_pass" class="x_control-label">{$lang->db_password}</label>
|
||||||
<div class="x_controls"><input name="db_password" type="password" id="dbPw" required /></div>
|
<div class="x_controls"><input name="db_pass" type="password" id="db_pass" required /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label for="dbName" class="x_control-label">{$lang->db_name}</label>
|
<label for="db_database" class="x_control-label">{$lang->db_name}</label>
|
||||||
<div class="x_controls"><input name="db_database" type="text" id="dbName" required /></div>
|
<div class="x_controls"><input name="db_database" type="text" id="db_database" required /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label for="dbPrefix" class="x_control-label">{$lang->db_table_prefix}</label>
|
<label for="db_prefix" class="x_control-label">{$lang->db_table_prefix}</label>
|
||||||
<div class="x_controls"><input name="db_table_prefix" type="text" id="dbPrefix" value="rx" required /></div>
|
<div class="x_controls"><input name="db_prefix" type="text" id="db_prefix" value="rx" required /></div>
|
||||||
</div>
|
</div>
|
||||||
<p class="install_help">
|
<p class="install_help">
|
||||||
{$lang->db_info_desc}<br />{$lang->db_prefix_desc}
|
{$lang->db_info_desc}<br />{$lang->db_prefix_desc}
|
||||||
|
|
@ -37,4 +37,11 @@ jQuery(function($){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if($("#task-complete-install").size()) {
|
||||||
|
$("#task-complete-install").click(function() {
|
||||||
|
$("#task-complete-install").text($("#task-complete-install").data("installing"));
|
||||||
|
$("#task-complete-install").prop("disabled", true);
|
||||||
|
$(window).on("beforeunload", function() { return ""; });
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="act" value="procInstallLicenseAggrement">
|
<input type="hidden" name="act" value="procInstallLicenseAgreement">
|
||||||
<input type="hidden" name="module" value="install">
|
<input type="hidden" name="module" value="install">
|
||||||
<div class="content-license">
|
<div class="content-license">
|
||||||
<include target="license_text.ko.html" cond="$lang_type === 'ko'" />
|
<include target="license_text.ko.html" cond="$lang_type === 'ko'" />
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<!--<a href="{getUrl('', 'act','')}" class="button grey">« {$lang->cmd_back}</a>-->
|
<!--<a href="{getUrl('', 'act','')}" class="button grey">« {$lang->cmd_back}</a>-->
|
||||||
</div>
|
</div>
|
||||||
<div class="align-right">
|
<div class="align-right">
|
||||||
<button type="submit" id="task-license-aggrement" value="">{$lang->cmd_next} »</button>
|
<button type="submit" id="task-license-agreement" value="">{$lang->cmd_next} »</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="act" value="procInstall" />
|
<input type="hidden" name="act" value="procInstall" />
|
||||||
<input type="hidden" name="use_rewrite" value="{$use_rewrite}" />
|
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label for="aMail" class="x_control-label">{$lang->email_address}</label>
|
<label for="aMail" class="x_control-label">{$lang->email_address}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
|
|
@ -43,7 +42,7 @@
|
||||||
<label for="time_zone" class="x_control-label">{$lang->time_zone}</label>
|
<label for="time_zone" class="x_control-label">{$lang->time_zone}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<select name="time_zone" style="width:100%">
|
<select name="time_zone" style="width:100%">
|
||||||
<option loop="$time_zone => $key,$val" id="{$key}" value="{$key}" selected="selected"|cond="$key==date('O')">{$val}</option>
|
<option loop="$timezones => $key,$val" value="{$key}" selected="selected"|cond="$key==$selected_timezone">{$val}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -61,10 +60,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="buttons">
|
<div id="buttons">
|
||||||
<div class="align-left">
|
<div class="align-left">
|
||||||
<a href="{getUrl('', 'act','dispInstallSelectDB')}" class="button grey">« {$lang->cmd_back}</a>
|
<a href="{getUrl('', 'act','dispInstallDBConfig')}" class="button grey">« {$lang->cmd_back}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="align-right">
|
<div class="align-right">
|
||||||
<button type="submit" id="task-done" value="">{$lang->cmd_complete} »</button>
|
<button type="submit" id="task-complete-install" value="" data-installing="{$lang->msg_installing}">{$lang->cmd_complete} »</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li class="active"|cond="($act==''||$act=='dispInstallLicenseAgreement')">{$lang->install_progress_menu['license_agreement']}</li>
|
<li class="active"|cond="($act==''||$act=='dispInstallLicenseAgreement')">{$lang->install_progress_menu['license_agreement']}</li>
|
||||||
<li class="active"|cond="$act=='dispInstallCheckEnv'">{$lang->install_progress_menu['condition']}</li>
|
<li class="active"|cond="$act=='dispInstallCheckEnv'">{$lang->install_progress_menu['condition']}</li>
|
||||||
<li cond="ini_get('safe_mode')" class="active"|cond="$act=='dispInstallSelectDB' && $progressMenu == '3'">{$lang->install_progress_menu['ftp']}</li>
|
<li cond="ini_get('safe_mode')" class="active"|cond="false && $act=='dispInstallSelectDB' && $progressMenu == '3'">{$lang->install_progress_menu['ftp']}</li>
|
||||||
<li class="active"|cond="$act=='dispInstallSelectDB' && $progressMenu == '4'">{$lang->install_progress_menu['dbInfo']}</li>
|
<li class="active"|cond="$act=='dispInstallDBConfig' && $progressMenu == '4'">{$lang->install_progress_menu['dbInfo']}</li>
|
||||||
<li class="active"|cond="$act=='dispInstallManagerForm'">{$lang->install_progress_menu['adminInfo']}</li>
|
<li class="active"|cond="$act=='dispInstallAdminConfig'">{$lang->install_progress_menu['adminInfo']}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ $lang->msg_success_authed = 'Your account has been successfully activated and lo
|
||||||
$lang->msg_success_confirmed = 'Your account has been activated successfully.';
|
$lang->msg_success_confirmed = 'Your account has been activated successfully.';
|
||||||
$lang->msg_new_member = 'Add Member';
|
$lang->msg_new_member = 'Add Member';
|
||||||
$lang->msg_rechecked_password = 'Re-checked password';
|
$lang->msg_rechecked_password = 'Re-checked password';
|
||||||
$lang->msg_update_member = 'Inquiry/Modify User Info';
|
$lang->msg_update_member = 'View and Modify User Info';
|
||||||
$lang->msg_leave_member = 'Delete Account';
|
$lang->msg_leave_member = 'Delete Account';
|
||||||
$lang->msg_group_is_null = 'There is no group.';
|
$lang->msg_group_is_null = 'There is no group.';
|
||||||
$lang->msg_not_delete_default = 'Default items cannot be deleted';
|
$lang->msg_not_delete_default = 'Default items cannot be deleted';
|
||||||
|
|
|
||||||
|
|
@ -296,10 +296,8 @@ class memberAdminModel extends member
|
||||||
*/
|
*/
|
||||||
function getMemberAdminIPCheck()
|
function getMemberAdminIPCheck()
|
||||||
{
|
{
|
||||||
$db_info = Context::getDBInfo();
|
$admin_ip_list = config('admin.allow');
|
||||||
$admin_ip_list = $db_info->admin_ip_list;
|
|
||||||
if(!$admin_ip_list) return true;
|
if(!$admin_ip_list) return true;
|
||||||
if(!is_array($admin_ip_list)) $admin_ip_list = explode(',',$admin_ip_list);
|
|
||||||
if(!count($admin_ip_list) || IpFilter::filter($admin_ip_list)) return true;
|
if(!count($admin_ip_list) || IpFilter::filter($admin_ip_list)) return true;
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1156,7 +1156,7 @@ class memberController extends member
|
||||||
return $this->stop('msg_invalid_auth_key');
|
return $this->stop('msg_invalid_auth_key');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
|
if(ztime($output->data->regdate) < time() - 86400)
|
||||||
{
|
{
|
||||||
executeQuery('member.deleteAuthMail', $args);
|
executeQuery('member.deleteAuthMail', $args);
|
||||||
return $this->stop('msg_invalid_auth_key');
|
return $this->stop('msg_invalid_auth_key');
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,7 @@ class memberModel extends member
|
||||||
return FileHandler::readFile($agreement_file);
|
return FileHandler::readFile($agreement_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db_info = Context::getDBInfo();
|
$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . config('locale.default_lang') . '.txt';
|
||||||
$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $db_info->lang_type . '.txt';
|
|
||||||
if(is_readable($agreement_file))
|
if(is_readable($agreement_file))
|
||||||
{
|
{
|
||||||
return FileHandler::readFile($agreement_file);
|
return FileHandler::readFile($agreement_file);
|
||||||
|
|
@ -295,8 +294,7 @@ class memberModel extends member
|
||||||
|
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
|
|
||||||
$db_info = Context::getDBInfo ();
|
if(config('db.master.type') == 'cubrid')
|
||||||
if($db_info->master_db['db_type'] == "cubrid")
|
|
||||||
{
|
{
|
||||||
$args->email_address = strtolower($email_address);
|
$args->email_address = strtolower($email_address);
|
||||||
$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
|
$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
|
||||||
|
|
|
||||||
|
|
@ -1608,7 +1608,6 @@ class menuAdminController extends menu
|
||||||
$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
|
$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
|
||||||
if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
|
if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
|
||||||
if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
|
if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
|
||||||
$dbInfo = Context::getDBInfo();
|
|
||||||
|
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
$args->menu_item_srl = (!$requestArgs->menu_item_srl) ? getNextSequence() : $requestArgs->menu_item_srl;
|
$args->menu_item_srl = (!$requestArgs->menu_item_srl) ? getNextSequence() : $requestArgs->menu_item_srl;
|
||||||
|
|
@ -1618,11 +1617,11 @@ class menuAdminController extends menu
|
||||||
//if now page is https...
|
//if now page is https...
|
||||||
if(strpos($url, 'https') !== false)
|
if(strpos($url, 'https') !== false)
|
||||||
{
|
{
|
||||||
$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
|
$args->url = str_replace('https'.substr(Context::getDefaultUrl(), 4), '', $url);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$args->url = str_replace($dbInfo->default_url, '', $url);
|
$args->url = str_replace(Context::getDefaultUrl(), '', $url);
|
||||||
}
|
}
|
||||||
$args->open_window = 'N';
|
$args->open_window = 'N';
|
||||||
$args->expand = 'N';
|
$args->expand = 'N';
|
||||||
|
|
|
||||||
|
|
@ -868,9 +868,8 @@ class moduleAdminController extends module
|
||||||
$langMap[$val->lang_code][$val->name] = $val->value;
|
$langMap[$val->lang_code][$val->name] = $val->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
$lang_supported = Context::get('lang_supported');
|
$lang_supported = Context::loadLangSelected();
|
||||||
$dbInfo = Context::getDBInfo();
|
$defaultLang = config('locale.default_lang');
|
||||||
$defaultLang = $dbInfo->lang_type;
|
|
||||||
|
|
||||||
if(!is_array($langMap[$defaultLang]))
|
if(!is_array($langMap[$defaultLang]))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ class module extends ModuleObject
|
||||||
$output = $oDB->executeQuery('module.getSite', $args);
|
$output = $oDB->executeQuery('module.getSite', $args);
|
||||||
if(!$output->data || !$output->data->index_module_srl)
|
if(!$output->data || !$output->data->index_module_srl)
|
||||||
{
|
{
|
||||||
$db_info = Context::getDBInfo();
|
|
||||||
$domain = Context::getDefaultUrl();
|
$domain = Context::getDefaultUrl();
|
||||||
$url_info = parse_url($domain);
|
$url_info = parse_url($domain);
|
||||||
$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
|
$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
|
||||||
|
|
@ -38,7 +37,7 @@ class module extends ModuleObject
|
||||||
$site_args->site_srl = 0;
|
$site_args->site_srl = 0;
|
||||||
$site_args->index_module_srl = 0;
|
$site_args->index_module_srl = 0;
|
||||||
$site_args->domain = $domain;
|
$site_args->domain = $domain;
|
||||||
$site_args->default_language = $db_info->lang_type;
|
$site_args->default_language = config('locale.default_lang');
|
||||||
|
|
||||||
$output = executeQuery('module.insertSite', $site_args);
|
$output = executeQuery('module.insertSite', $site_args);
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
|
@ -328,14 +327,13 @@ class module extends ModuleObject
|
||||||
{
|
{
|
||||||
// Basic mid, language Wanted
|
// Basic mid, language Wanted
|
||||||
$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
|
$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
|
||||||
$db_info = Context::getDBInfo();
|
|
||||||
$domain = Context::getDefaultUrl();
|
$domain = Context::getDefaultUrl();
|
||||||
$url_info = parse_url($domain);
|
$url_info = parse_url($domain);
|
||||||
$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
|
$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
|
||||||
$site_args->site_srl = 0;
|
$site_args->site_srl = 0;
|
||||||
$site_args->index_module_srl = $mid_output->data->module_srl;
|
$site_args->index_module_srl = $mid_output->data->module_srl;
|
||||||
$site_args->domain = $domain;
|
$site_args->domain = $domain;
|
||||||
$site_args->default_language = $db_info->lang_type;
|
$site_args->default_language = config('locale.default_lang');
|
||||||
|
|
||||||
$output = executeQuery('module.insertSite', $site_args);
|
$output = executeQuery('module.insertSite', $site_args);
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ class moduleController extends module
|
||||||
if(!in_array($type,array('model','controller','view','api','mobile'))) return false;
|
if(!in_array($type,array('model','controller','view','api','mobile'))) return false;
|
||||||
if(in_array($parent_module, array('module','addon','widget','layout'))) return false;
|
if(in_array($parent_module, array('module','addon','widget','layout'))) return false;
|
||||||
|
|
||||||
$cache_file = './files/config/module_extend.php';
|
$cache_file = './files/cache/common/module_extend.php';
|
||||||
FileHandler::removeFile($cache_file);
|
FileHandler::removeFile($cache_file);
|
||||||
|
|
||||||
$args = new stdClass;
|
$args = new stdClass;
|
||||||
|
|
@ -189,7 +189,7 @@ class moduleController extends module
|
||||||
*/
|
*/
|
||||||
function deleteModuleExtend($parent_module, $extend_module, $type, $kind='')
|
function deleteModuleExtend($parent_module, $extend_module, $type, $kind='')
|
||||||
{
|
{
|
||||||
$cache_file = './files/config/module_extend.php';
|
$cache_file = './files/cache/common/module_extend.php';
|
||||||
FileHandler::removeFile($cache_file);
|
FileHandler::removeFile($cache_file);
|
||||||
|
|
||||||
$args = new stdClass;
|
$args = new stdClass;
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,6 @@ class moduleModel extends module
|
||||||
|
|
||||||
// Get mid, language
|
// Get mid, language
|
||||||
$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
|
$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
|
||||||
$db_info = Context::getDBInfo();
|
|
||||||
$domain = Context::getDefaultUrl();
|
$domain = Context::getDefaultUrl();
|
||||||
$url_info = parse_url($domain);
|
$url_info = parse_url($domain);
|
||||||
$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
|
$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
|
||||||
|
|
@ -180,7 +179,7 @@ class moduleModel extends module
|
||||||
$site_args->site_srl = 0;
|
$site_args->site_srl = 0;
|
||||||
$site_args->index_module_srl = $mid_output->data->module_srl;
|
$site_args->index_module_srl = $mid_output->data->module_srl;
|
||||||
$site_args->domain = $domain;
|
$site_args->domain = $domain;
|
||||||
$site_args->default_language = $db_info->lang_type;
|
$site_args->default_language = config('locale.default_lang');
|
||||||
|
|
||||||
if($output->data && !$output->data->index_module_srl)
|
if($output->data && !$output->data->index_module_srl)
|
||||||
{
|
{
|
||||||
|
|
@ -714,7 +713,7 @@ class moduleModel extends module
|
||||||
*/
|
*/
|
||||||
function loadModuleExtends()
|
function loadModuleExtends()
|
||||||
{
|
{
|
||||||
$cache_file = './files/config/module_extend.php';
|
$cache_file = './files/cache/common/module_extend.php';
|
||||||
$cache_file = FileHandler::getRealPath($cache_file);
|
$cache_file = FileHandler::getRealPath($cache_file);
|
||||||
|
|
||||||
if(!isset($GLOBALS['__MODULE_EXTEND__']))
|
if(!isset($GLOBALS['__MODULE_EXTEND__']))
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ $I->amOnPage('/index.php?l=ko');
|
||||||
$I->setCookie('l', 'ko');
|
$I->setCookie('l', 'ko');
|
||||||
$I->seeElement('//div[@id="progress"]/ul/li[1][@class="active"]');
|
$I->seeElement('//div[@id="progress"]/ul/li[1][@class="active"]');
|
||||||
$I->seeElement('input[name="license_agreement"]');
|
$I->seeElement('input[name="license_agreement"]');
|
||||||
$I->submitForm('#body', ['act' => 'procInstallLicenseAggrement', 'license_agreement' => 'Y']);
|
$I->submitForm('#body', ['act' => 'procInstallLicenseAgreement', 'license_agreement' => 'Y']);
|
||||||
|
|
||||||
// Step 2 : Environment Check
|
// Step 2 : Environment Check
|
||||||
$I->seeInCurrentUrl('act=dispInstallCheckEnv');
|
$I->seeInCurrentUrl('act=dispInstallCheckEnv');
|
||||||
|
|
@ -43,27 +43,26 @@ $I->seeElement('#task-checklist-confirm');
|
||||||
$I->click('#task-checklist-confirm');
|
$I->click('#task-checklist-confirm');
|
||||||
|
|
||||||
// Step 3 : DB Setup
|
// Step 3 : DB Setup
|
||||||
$I->seeInCurrentUrl('act=dispInstallSelectDB');
|
$I->seeInCurrentUrl('act=dispInstallDBConfig');
|
||||||
$I->seeElement('select[name="db_type"]');
|
$I->seeElement('select[name="db_type"]');
|
||||||
$I->submitForm('#body', [
|
$I->submitForm('#body', [
|
||||||
'act' => 'procDBSetting',
|
'act' => 'procDBConfig',
|
||||||
'db_type' => 'mysqli_innodb',
|
'db_type' => 'mysqli_innodb',
|
||||||
'db_hostname' => $dbinfo['host'],
|
'db_host' => $dbinfo['host'],
|
||||||
'db_port' => $dbinfo['port'],
|
'db_port' => $dbinfo['port'],
|
||||||
'db_userid' => $dbinfo['user'],
|
'db_user' => $dbinfo['user'],
|
||||||
'db_password' => $dbinfo['password'],
|
'db_pass' => $dbinfo['password'],
|
||||||
'db_database' => $dbinfo['dbname'],
|
'db_database' => $dbinfo['dbname'],
|
||||||
'db_table_prefix' => 'rx'
|
'db_prefix' => 'rx'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Step 4 : Create Admin Account
|
// Step 4 : Create Admin Account
|
||||||
$I->seeInCurrentUrl('act=dispInstallManagerForm');
|
$I->seeInCurrentUrl('act=dispInstallOtherConfig');
|
||||||
$I->seeElement('select[name="time_zone"]');
|
$I->seeElement('select[name="time_zone"]');
|
||||||
$I->fillField('#aMail', 'admin@admin.net');
|
$I->fillField('#aMail', 'admin@admin.net');
|
||||||
$I->submitForm('#body', [
|
$I->submitForm('#body', [
|
||||||
'act' => 'procInstall',
|
'act' => 'procInstall',
|
||||||
'time_zone' => '+0900',
|
'time_zone' => '+0900',
|
||||||
'db_type' => 'mysqli_innodb',
|
|
||||||
'email_address' => 'admin@admin.net',
|
'email_address' => 'admin@admin.net',
|
||||||
'password' => 'admin',
|
'password' => 'admin',
|
||||||
'password2' => 'admin',
|
'password2' => 'admin',
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,9 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
HTMLDisplayHandler::$reservedCSS = '/xxx$/';
|
HTMLDisplayHandler::$reservedCSS = '/xxx$/';
|
||||||
HTMLDisplayHandler::$reservedJS = '/xxx$/';
|
HTMLDisplayHandler::$reservedJS = '/xxx$/';
|
||||||
$db_info = Context::getDBInfo() ?: new stdClass;
|
FrontEndFileHandler::$minify = 'none';
|
||||||
$db_info->minify_scripts = 'none';
|
|
||||||
Context::setDBInfo($db_info);
|
|
||||||
|
|
||||||
$this->specify("js(head)", function() use($db_info) {
|
$this->specify("js(head)", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('./common/js/js_app.js', 'head'));
|
$handler->loadFile(array('./common/js/js_app.js', 'head'));
|
||||||
$handler->loadFile(array('./common/js/common.js', 'body'));
|
$handler->loadFile(array('./common/js/common.js', 'body'));
|
||||||
|
|
@ -30,14 +28,14 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($handler->getJsFileList(), $expected);
|
$this->assertEquals($handler->getJsFileList(), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("js(body)", function() use($db_info) {
|
$this->specify("js(body)", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('./common/js/xml_js_filter.js', 'head'));
|
$handler->loadFile(array('./common/js/xml_js_filter.js', 'head'));
|
||||||
$expected = array();
|
$expected = array();
|
||||||
$this->assertEquals($handler->getJsFileList('body'), $expected);
|
$this->assertEquals($handler->getJsFileList('body'), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("css", function() use($db_info) {
|
$this->specify("css", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('./common/css/xe.css'));
|
$handler->loadFile(array('./common/css/xe.css'));
|
||||||
$handler->loadFile(array('./common/css/mobile.css'));
|
$handler->loadFile(array('./common/css/mobile.css'));
|
||||||
|
|
@ -46,7 +44,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($handler->getCssFileList(), $expected);
|
$this->assertEquals($handler->getCssFileList(), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("order (duplicate)", function() use($db_info) {
|
$this->specify("order (duplicate)", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('./common/js/js_app.js', 'head', '', -100000));
|
$handler->loadFile(array('./common/js/js_app.js', 'head', '', -100000));
|
||||||
$handler->loadFile(array('./common/js/common.js', 'head', '', -100000));
|
$handler->loadFile(array('./common/js/common.js', 'head', '', -100000));
|
||||||
|
|
@ -63,7 +61,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($handler->getJsFileList(), $expected);
|
$this->assertEquals($handler->getJsFileList(), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("order (redefine)", function() use($db_info) {
|
$this->specify("order (redefine)", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('./common/js/xml_handler.js', 'head', '', 1));
|
$handler->loadFile(array('./common/js/xml_handler.js', 'head', '', 1));
|
||||||
$handler->loadFile(array('./common/js/js_app.js', 'head', '', -100000));
|
$handler->loadFile(array('./common/js/js_app.js', 'head', '', -100000));
|
||||||
|
|
@ -76,7 +74,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($handler->getJsFileList(), $expected);
|
$this->assertEquals($handler->getJsFileList(), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("unload", function() use($db_info) {
|
$this->specify("unload", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('./common/js/js_app.js', 'head', '', -100000));
|
$handler->loadFile(array('./common/js/js_app.js', 'head', '', -100000));
|
||||||
$handler->loadFile(array('./common/js/common.js', 'head', '', -100000));
|
$handler->loadFile(array('./common/js/common.js', 'head', '', -100000));
|
||||||
|
|
@ -89,7 +87,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($handler->getJsFileList(), $expected);
|
$this->assertEquals($handler->getJsFileList(), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("target IE(js)", function() use($db_info) {
|
$this->specify("target IE(js)", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('./common/js/js_app.js', 'head', 'ie6'));
|
$handler->loadFile(array('./common/js/js_app.js', 'head', 'ie6'));
|
||||||
$handler->loadFile(array('./common/js/js_app.js', 'head', 'ie7'));
|
$handler->loadFile(array('./common/js/js_app.js', 'head', 'ie7'));
|
||||||
|
|
@ -100,7 +98,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($handler->getJsFileList(), $expected);
|
$this->assertEquals($handler->getJsFileList(), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("external file - schemaless", function() use($db_info) {
|
$this->specify("external file - schemaless", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('http://external.host/js/script.js'));
|
$handler->loadFile(array('http://external.host/js/script.js'));
|
||||||
$handler->loadFile(array('https://external.host/js/script.js'));
|
$handler->loadFile(array('https://external.host/js/script.js'));
|
||||||
|
|
@ -114,7 +112,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($handler->getJsFileList(), $expected);
|
$this->assertEquals($handler->getJsFileList(), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("external file - schemaless", function() use($db_info) {
|
$this->specify("external file - schemaless", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('//external.host/js/script.js'));
|
$handler->loadFile(array('//external.host/js/script.js'));
|
||||||
$handler->loadFile(array('///external.host/js/script.js'));
|
$handler->loadFile(array('///external.host/js/script.js'));
|
||||||
|
|
@ -123,7 +121,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($handler->getJsFileList(), $expected);
|
$this->assertEquals($handler->getJsFileList(), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("target IE(css)", function() use($db_info) {
|
$this->specify("target IE(css)", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('./common/css/common.css', null, 'ie6'));
|
$handler->loadFile(array('./common/css/common.css', null, 'ie6'));
|
||||||
$handler->loadFile(array('./common/css/common.css', null, 'ie7'));
|
$handler->loadFile(array('./common/css/common.css', null, 'ie7'));
|
||||||
|
|
@ -135,7 +133,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($handler->getCssFileList(), $expected);
|
$this->assertEquals($handler->getCssFileList(), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("media", function() use($db_info) {
|
$this->specify("media", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('./common/css/common.css', 'all'));
|
$handler->loadFile(array('./common/css/common.css', 'all'));
|
||||||
$handler->loadFile(array('./common/css/common.css', 'screen'));
|
$handler->loadFile(array('./common/css/common.css', 'screen'));
|
||||||
|
|
@ -147,11 +145,9 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($handler->getCssFileList(), $expected);
|
$this->assertEquals($handler->getCssFileList(), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$db_info->minify_scripts = 'all';
|
FrontEndFileHandler::$minify = 'all';
|
||||||
Context::setDBInfo($db_info);
|
|
||||||
FrontEndFileHandler::$minify = null;
|
|
||||||
|
|
||||||
$this->specify("minify", function() use($db_info) {
|
$this->specify("minify", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('./common/css/xe.css'));
|
$handler->loadFile(array('./common/css/xe.css'));
|
||||||
$handler->loadFile(array('./common/css/mobile.css'));
|
$handler->loadFile(array('./common/css/mobile.css'));
|
||||||
|
|
@ -163,7 +159,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($result, $expected);
|
$this->assertEquals($result, $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("external file", function() use($db_info) {
|
$this->specify("external file", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('http://external.host/css/style1.css'));
|
$handler->loadFile(array('http://external.host/css/style1.css'));
|
||||||
$handler->loadFile(array('https://external.host/css/style2.css'));
|
$handler->loadFile(array('https://external.host/css/style2.css'));
|
||||||
|
|
@ -173,7 +169,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
|
||||||
$this->assertEquals($handler->getCssFileList(), $expected);
|
$this->assertEquals($handler->getCssFileList(), $expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->specify("external file - schemaless", function() use($db_info) {
|
$this->specify("external file - schemaless", function() {
|
||||||
$handler = new FrontEndFileHandler();
|
$handler = new FrontEndFileHandler();
|
||||||
$handler->loadFile(array('//external.host/css/style.css'));
|
$handler->loadFile(array('//external.host/css/style.css'));
|
||||||
$handler->loadFile(array('///external.host/css2/style2.css'));
|
$handler->loadFile(array('///external.host/css2/style2.css'));
|
||||||
|
|
|
||||||
26
tests/Unit/framework/ConfigTest.php
Normal file
26
tests/Unit/framework/ConfigTest.php
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class ConfigTest extends \Codeception\TestCase\Test
|
||||||
|
{
|
||||||
|
public function testConfig()
|
||||||
|
{
|
||||||
|
if (!file_exists(RX_BASEDIR . 'files/config/config.php'))
|
||||||
|
{
|
||||||
|
mkdir(RX_BASEDIR . 'files/config', 0755, true);
|
||||||
|
copy(RX_BASEDIR . 'common/defaults/config.php', RX_BASEDIR . 'files/config/config.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
Rhymix\Framework\Config::init();
|
||||||
|
$this->assertTrue(version_compare(Rhymix\Framework\Config::get('config_version'), '2.0', '>='));
|
||||||
|
$this->assertTrue(is_array(Rhymix\Framework\Config::get('db.master')));
|
||||||
|
$this->assertNotEmpty(Rhymix\Framework\Config::get('db.master.host'));
|
||||||
|
|
||||||
|
Rhymix\Framework\Config::set('foo.bar', $rand = mt_rand());
|
||||||
|
$this->assertEquals(array('bar' => $rand), Rhymix\Framework\Config::get('foo'));
|
||||||
|
$this->assertEquals($rand, Rhymix\Framework\Config::get('foo.bar'));
|
||||||
|
|
||||||
|
$var = array('foo' => 'bar');
|
||||||
|
$serialized = "array(\n\t'foo' => 'bar',\n)";
|
||||||
|
$this->assertEquals($serialized, Rhymix\Framework\Config::serialize($var));
|
||||||
|
}
|
||||||
|
}
|
||||||
135
tests/Unit/framework/DateTimeTest.php
Normal file
135
tests/Unit/framework/DateTimeTest.php
Normal file
|
|
@ -0,0 +1,135 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class DateTimeTest extends \Codeception\TestCase\Test
|
||||||
|
{
|
||||||
|
public function _before()
|
||||||
|
{
|
||||||
|
// Add some dummy data to system configuration. Asia/Seoul offset is 32400.
|
||||||
|
Rhymix\Framework\Config::set('locale.default_timezone', 'Asia/Seoul');
|
||||||
|
Rhymix\Framework\Config::set('locale.internal_timezone', 10800);
|
||||||
|
|
||||||
|
// Set PHP time zone to the internal time zone.
|
||||||
|
$old_timezone = @date_default_timezone_get();
|
||||||
|
date_default_timezone_set('Etc/GMT-3');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function _after()
|
||||||
|
{
|
||||||
|
// Restore the old timezone.
|
||||||
|
date_default_timezone_set($old_timezone);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testZgap()
|
||||||
|
{
|
||||||
|
// Test zgap() when the current user's time zone is different from the system default.
|
||||||
|
$_SESSION['timezone'] = 'Etc/UTC';
|
||||||
|
$this->assertEquals(-10800, zgap());
|
||||||
|
|
||||||
|
// Test zgap() when the current user's time zone is the same as the system default.
|
||||||
|
unset($_SESSION['timezone']);
|
||||||
|
$this->assertEquals(21600, zgap());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testZtime()
|
||||||
|
{
|
||||||
|
$timestamp = 1454000000;
|
||||||
|
|
||||||
|
// Test ztime() when the internal time zone is different from the default time zone.
|
||||||
|
Rhymix\Framework\Config::set('locale.internal_timezone', 10800);
|
||||||
|
$this->assertEquals($timestamp, ztime('20160128195320'));
|
||||||
|
|
||||||
|
// Test ztime() when the internal time zone is the same as the default time zone.
|
||||||
|
Rhymix\Framework\Config::set('locale.internal_timezone', 32400);
|
||||||
|
$this->assertEquals($timestamp, ztime('20160129015320'));
|
||||||
|
|
||||||
|
// Restore the internal timezone.
|
||||||
|
Rhymix\Framework\Config::set('locale.internal_timezone', 10800);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testZdate()
|
||||||
|
{
|
||||||
|
$expected = '2016-01-29 01:53:20';
|
||||||
|
|
||||||
|
// Test zdate() when the internal time zone is different from the default time zone.
|
||||||
|
Rhymix\Framework\Config::set('locale.internal_timezone', 10800);
|
||||||
|
$this->assertEquals($expected, zdate('20160128195320'));
|
||||||
|
|
||||||
|
// Test zdate() when the internal time zone is the same as the default time zone.
|
||||||
|
Rhymix\Framework\Config::set('locale.internal_timezone', 32400);
|
||||||
|
$this->assertEquals($expected, zdate('20160129015320'));
|
||||||
|
|
||||||
|
// Restore the internal timezone.
|
||||||
|
Rhymix\Framework\Config::set('locale.internal_timezone', 10800);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetTimezoneForCurrentUser()
|
||||||
|
{
|
||||||
|
// Test when the current user's time zone is different from the system default.
|
||||||
|
$_SESSION['timezone'] = 'Pacific/Auckland';
|
||||||
|
$this->assertEquals('Pacific/Auckland', Rhymix\Framework\DateTime::getTimezoneForCurrentUser());
|
||||||
|
|
||||||
|
// Test when the current user's time zone is the same as the system default.
|
||||||
|
unset($_SESSION['timezone']);
|
||||||
|
$this->assertEquals('Asia/Seoul', Rhymix\Framework\DateTime::getTimezoneForCurrentUser());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testFormatTimestampForCurrentUser()
|
||||||
|
{
|
||||||
|
$timestamp_winter = 1454000000;
|
||||||
|
$timestamp_summer = $timestamp_winter - (86400 * 184);
|
||||||
|
|
||||||
|
// Test when the current user's time zone is in the Northern hemisphere with DST.
|
||||||
|
$_SESSION['timezone'] = 'America/Chicago';
|
||||||
|
$this->assertEquals('20160128 105320', Rhymix\Framework\DateTime::formatTimestampForCurrentUser('Ymd His', $timestamp_winter));
|
||||||
|
$this->assertEquals('20150728 115320', Rhymix\Framework\DateTime::formatTimestampForCurrentUser('Ymd His', $timestamp_summer));
|
||||||
|
|
||||||
|
// Test when the current user's time zone is in the Southern hemisphere with DST.
|
||||||
|
$_SESSION['timezone'] = 'Pacific/Auckland';
|
||||||
|
$this->assertEquals('20160129 055320', Rhymix\Framework\DateTime::formatTimestampForCurrentUser('Ymd His', $timestamp_winter));
|
||||||
|
$this->assertEquals('20150729 045320', Rhymix\Framework\DateTime::formatTimestampForCurrentUser('Ymd His', $timestamp_summer));
|
||||||
|
|
||||||
|
// Test when the current user's time zone is the same as the system default without DST.
|
||||||
|
unset($_SESSION['timezone']);
|
||||||
|
$this->assertEquals('20160129 015320', Rhymix\Framework\DateTime::formatTimestampForCurrentUser('Ymd His', $timestamp_winter));
|
||||||
|
$this->assertEquals('20150729 015320', Rhymix\Framework\DateTime::formatTimestampForCurrentUser('Ymd His', $timestamp_summer));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetTimezoneList()
|
||||||
|
{
|
||||||
|
$tzlist = Rhymix\Framework\DateTime::getTimezoneList();
|
||||||
|
$this->assertTrue(array_key_exists('Etc/UTC', $tzlist));
|
||||||
|
$this->assertEquals('Asia/Seoul (+09:00)', $tzlist['Asia/Seoul']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetTimezoneOffset()
|
||||||
|
{
|
||||||
|
$this->assertEquals(32400, Rhymix\Framework\DateTime::getTimezoneOffset('Asia/Seoul'));
|
||||||
|
$this->assertEquals(39600, Rhymix\Framework\DateTime::getTimezoneOffset('Australia/Sydney', strtotime('2016-01-01')));
|
||||||
|
$this->assertEquals(36000, Rhymix\Framework\DateTime::getTimezoneOffset('Australia/Sydney', strtotime('2015-07-01')));
|
||||||
|
$this->assertEquals(-18000, Rhymix\Framework\DateTime::getTimezoneOffset('America/New_York', strtotime('2016-01-01')));
|
||||||
|
$this->assertEquals(-14400, Rhymix\Framework\DateTime::getTimezoneOffset('America/New_York', strtotime('2015-07-01')));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetTimezoneOffsetFromInternal()
|
||||||
|
{
|
||||||
|
$this->assertEquals(21600, Rhymix\Framework\DateTime::getTimezoneOffsetFromInternal('Asia/Seoul'));
|
||||||
|
$this->assertEquals(28800, Rhymix\Framework\DateTime::getTimezoneOffsetFromInternal('Australia/Sydney', strtotime('2016-01-01')));
|
||||||
|
$this->assertEquals(25200, Rhymix\Framework\DateTime::getTimezoneOffsetFromInternal('Australia/Sydney', strtotime('2015-07-01')));
|
||||||
|
$this->assertEquals(-28800, Rhymix\Framework\DateTime::getTimezoneOffsetFromInternal('America/New_York', strtotime('2016-01-01')));
|
||||||
|
$this->assertEquals(-25200, Rhymix\Framework\DateTime::getTimezoneOffsetFromInternal('America/New_York', strtotime('2015-07-01')));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetTimezoneOffsetByLegacyFormat()
|
||||||
|
{
|
||||||
|
$this->assertEquals(32400, Rhymix\Framework\DateTime::getTimezoneOffsetByLegacyFormat('+0900'));
|
||||||
|
$this->assertEquals(-25200, Rhymix\Framework\DateTime::getTimezoneOffsetByLegacyFormat('-0700'));
|
||||||
|
$this->assertEquals(19800, Rhymix\Framework\DateTime::getTimezoneOffsetByLegacyFormat('+0530'));
|
||||||
|
$this->assertEquals(-38700, Rhymix\Framework\DateTime::getTimezoneOffsetByLegacyFormat('-1045'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetTimezoneNameByOffset()
|
||||||
|
{
|
||||||
|
$this->assertEquals('Etc/GMT-9', Rhymix\Framework\DateTime::getTimezoneNameByOffset(32400));
|
||||||
|
$this->assertEquals('Etc/GMT+5', Rhymix\Framework\DateTime::getTimezoneNameByOffset(-18000));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue