mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 23:03:25 +09:00
Merge branch 'develop' into pr/reorganize-admin-menu
This commit is contained in:
commit
6343538b2d
9 changed files with 78 additions and 23 deletions
|
|
@ -472,16 +472,16 @@ class Context
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Copy to old format for backward compatibility.
|
||||
self::$_instance->db_info = self::convertDBInfo($config);
|
||||
self::$_instance->allow_rewrite = self::$_instance->db_info->use_rewrite;
|
||||
self::set('_http_port', $db_info->http_port ?: null);
|
||||
self::set('_https_port', $db_info->https_port ?: null);
|
||||
self::set('_use_ssl', $db_info->use_ssl);
|
||||
$GLOBALS['_time_zone'] = $db_info->time_zone;
|
||||
self::set('_http_port', self::$_instance->db_info->http_port ?: null);
|
||||
self::set('_https_port', self::$_instance->db_info->https_port ?: null);
|
||||
self::set('_use_ssl', self::$_instance->db_info->use_ssl);
|
||||
$GLOBALS['_time_zone'] = self::$_instance->db_info->time_zone;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert Rhymix configuration to XE DBInfo format
|
||||
*
|
||||
|
|
@ -1453,7 +1453,7 @@ class Context
|
|||
// Set headers and constants for backward compatibility.
|
||||
header('HTTP/1.1 503 Service Unavailable');
|
||||
define('_XE_SITELOCK_', TRUE);
|
||||
define('_XE_SITELOCK_TITLE_', config('lock.title'));
|
||||
define('_XE_SITELOCK_TITLE_', config('lock.title') ?: self::getLang('admin.sitelock_in_use'));
|
||||
define('_XE_SITELOCK_MESSAGE_', config('lock.message'));
|
||||
unset($_SESSION['XE_VALIDATOR_RETURN_URL']);
|
||||
|
||||
|
|
@ -1464,10 +1464,11 @@ class Context
|
|||
}
|
||||
else
|
||||
{
|
||||
self::setBrowserTitle(self::getSiteTitle());
|
||||
$oMessageObject = getView('message');
|
||||
$oMessageObject->setHttpStatusCode(503);
|
||||
$oMessageObject->setError(-1);
|
||||
$oMessageObject->setMessage(config('lock.title'));
|
||||
$oMessageObject->setMessage(_XE_SITELOCK_TITLE_);
|
||||
$oMessageObject->dispMessage();
|
||||
$oModuleHandler = new ModuleHandler;
|
||||
$oModuleHandler->displayContent($oMessageObject);
|
||||
|
|
|
|||
|
|
@ -999,7 +999,7 @@ class DB
|
|||
*/
|
||||
function _getConnection($type = 'master', $indx = NULL)
|
||||
{
|
||||
if($type == 'master')
|
||||
if($type == 'master' || $this->transactionNestedLevel)
|
||||
{
|
||||
if(!$this->master_db['is_connected'])
|
||||
{
|
||||
|
|
@ -1014,11 +1014,20 @@ class DB
|
|||
$indx = $this->_getSlaveConnectionStringIndex($type);
|
||||
}
|
||||
|
||||
if($this->slave_db[$indx]['host'] == $this->master_db['host'] && $this->slave_db[$indx]['port'] == $this->master_db['port'])
|
||||
{
|
||||
if(!$this->master_db['is_connected'])
|
||||
{
|
||||
$this->_connect($type);
|
||||
}
|
||||
$this->connection = 'Master ' . $this->master_db['host'];
|
||||
return $this->master_db["resource"];
|
||||
}
|
||||
|
||||
if(!$this->slave_db[$indx]['is_connected'])
|
||||
{
|
||||
$this->_connect($type, $indx);
|
||||
}
|
||||
|
||||
$this->connection = 'Slave ' . $this->slave_db[$indx]['host'];
|
||||
return $this->slave_db[$indx]["resource"];
|
||||
}
|
||||
|
|
@ -1271,7 +1280,7 @@ class DB
|
|||
{
|
||||
$connection = &$this->slave_db[$indx];
|
||||
}
|
||||
|
||||
|
||||
$result = $this->__connect($connection);
|
||||
if($result === NULL || $result === FALSE)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,12 +60,17 @@ class DisplayHandler extends Handler
|
|||
|
||||
// call a trigger before display
|
||||
ModuleHandler::triggerCall('display', 'before', $output);
|
||||
|
||||
$original_output = $output;
|
||||
|
||||
// execute add-on
|
||||
$called_position = 'before_display_content';
|
||||
$oAddonController = getController('addon');
|
||||
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
|
||||
if(file_exists($addon_file)) include($addon_file);
|
||||
if($output === false || $output === null || $output instanceof Object)
|
||||
{
|
||||
$output = $original_output;
|
||||
}
|
||||
|
||||
if(method_exists($handler, "prepareToPrint"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -447,6 +447,18 @@ class ModuleObject extends Object
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// check return value of action
|
||||
if($output instanceof Object)
|
||||
{
|
||||
$this->setError($output->getError());
|
||||
$this->setMessage($output->getMessage());
|
||||
$original_output = clone $output;
|
||||
}
|
||||
else
|
||||
{
|
||||
$original_output = null;
|
||||
}
|
||||
|
||||
// trigger call
|
||||
$triggerOutput = ModuleHandler::triggerCall('moduleObject.proc', 'after', $this);
|
||||
if(!$triggerOutput->toBool())
|
||||
|
|
@ -462,16 +474,17 @@ class ModuleObject extends Object
|
|||
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
|
||||
if(FileHandler::exists($addon_file)) include($addon_file);
|
||||
|
||||
if(is_a($output, 'Object') || is_subclass_of($output, 'Object'))
|
||||
if($original_output instanceof Object && !$original_output->toBool())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
elseif($output instanceof Object && $output->getError())
|
||||
{
|
||||
$this->setError($output->getError());
|
||||
$this->setMessage($output->getMessage());
|
||||
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// execute api methods of the module if view action is and result is XMLRPC or JSON
|
||||
if($this->module_info->module_type == 'view' || $this->module_info->module_type == 'mobile')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ class ConfigParser
|
|||
}
|
||||
|
||||
// Convert miscellaneous configuration.
|
||||
$config['use_mobile_view'] = $db_info->use_mobile_view === 'Y' ? true : false;
|
||||
$config['use_mobile_view'] = $db_info->use_mobile_view === 'N' ? false : true;
|
||||
$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;
|
||||
|
|
|
|||
|
|
@ -505,8 +505,8 @@ class adminAdminController extends admin
|
|||
|
||||
// Site title and HTML footer
|
||||
$args = new stdClass;
|
||||
$args->siteTitle = escape($vars->site_title);
|
||||
$args->htmlFooter = escape($vars->html_footer);
|
||||
$args->siteTitle = $vars->site_title;
|
||||
$args->htmlFooter = $vars->html_footer;
|
||||
$oModuleController->updateModuleConfig('module', $args);
|
||||
|
||||
// Index module
|
||||
|
|
@ -626,14 +626,31 @@ class adminAdminController extends admin
|
|||
{
|
||||
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;
|
||||
$use_ssl = $vars->use_ssl ?: 'none';
|
||||
|
||||
// Check if all URL configuration is consistent
|
||||
if ($use_ssl === 'always' && !preg_match('@^https://@', $default_url))
|
||||
{
|
||||
return new Object(-1, 'msg_default_url_ssl_inconsistent');
|
||||
}
|
||||
if ($vars->http_port && preg_match('@^http://@', $default_url) && parse_url($default_url, PHP_URL_PORT) != $vars->http_port)
|
||||
{
|
||||
return new Object(-1, 'msg_default_url_http_port_inconsistent');
|
||||
}
|
||||
if ($vars->https_port && preg_match('@^https://@', $default_url) && parse_url($default_url, PHP_URL_PORT) != $vars->https_port)
|
||||
{
|
||||
return new Object(-1, 'msg_default_url_https_port_inconsistent');
|
||||
}
|
||||
|
||||
// Set all URL configuration
|
||||
Rhymix\Framework\Config::set('url.default', $default_url);
|
||||
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');
|
||||
Rhymix\Framework\Config::set('url.ssl', $use_ssl);
|
||||
|
||||
// Other settings
|
||||
Rhymix\Framework\Config::set('use_mobile_view', $vars->use_mobile_view === 'Y');
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@ $lang->use_gzip = 'gzip Compression';
|
|||
$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->msg_invalid_default_url = 'The default URL is invalid.';
|
||||
$lang->msg_default_url_ssl_inconsistent = 'In order to use SSL always, the default URL must also begin with https://';
|
||||
$lang->msg_default_url_http_port_inconsistent = 'In order to change the HTTP port, the default URL must also include the port number.';
|
||||
$lang->msg_default_url_https_port_inconsistent = 'In order to change the HTTPS port, the default URL must also include the port number.';
|
||||
$lang->sftp = 'Use SFTP';
|
||||
$lang->ftp_get_list = 'Get List';
|
||||
$lang->ftp_remove_info = 'Remove FTP Info.';
|
||||
|
|
|
|||
|
|
@ -86,6 +86,10 @@ $lang->about_minify_scripts = 'コアとすべてのモジュールに含まれ
|
|||
$lang->use_gzip = 'gzip 圧縮';
|
||||
$lang->delay_session = 'セッションの開始を遅延';
|
||||
$lang->about_delay_session = 'Varnishなどのプロキシキャッシュサーバ使用時のパフォーマンスを向上させるために、ログインしていないユーザーには、認証セッションを付与しません。<br>このオプションを選択した場合、訪問者数とヒット集計が正確でない場合があります。';
|
||||
$lang->msg_invalid_default_url = '基本URLが正しくありません。';
|
||||
$lang->msg_default_url_ssl_inconsistent = 'SSLを常に使用する場合、基本URLもhttps://で始まる必要があります。';
|
||||
$lang->msg_default_url_http_port_inconsistent = 'HTTPポートを変更する場合、基本URLも同じポートが含まれている必要があります。';
|
||||
$lang->msg_default_url_https_port_inconsistent = 'HTTPSポートを変更する場合、基本URLも同じポートが含まれている必要があります。';
|
||||
$lang->sftp = 'SFTP使用';
|
||||
$lang->ftp_get_list = 'ディレクトリを読み込む';
|
||||
$lang->ftp_remove_info = 'FTP情報削除';
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@ $lang->use_gzip = 'gzip 압축';
|
|||
$lang->delay_session = '세션 시작 지연';
|
||||
$lang->about_delay_session = 'Varnish 등의 프록시 캐싱 서버 사용시 성능 개선을 위해, 로그인하지 않은 사용자에게는 인증 세션을 부여하지 않습니다.<br>이 옵션을 선택할 경우 방문자 수 및 조회수 집계가 정확하게 이루어지지 않을 수 있습니다.';
|
||||
$lang->msg_invalid_default_url = '기본 URL이 올바르지 않습니다.';
|
||||
$lang->msg_default_url_ssl_inconsistent = 'SSL을 항상 사용하실 경우 기본 URL도 https://로 시작해야 합니다.';
|
||||
$lang->msg_default_url_http_port_inconsistent = 'HTTP 포트를 변경하실 경우 기본 URL에도 동일한 포트가 포함되어야 합니다.';
|
||||
$lang->msg_default_url_https_port_inconsistent = 'HTTPS 포트를 변경하실 경우 기본 URL에도 동일한 포트가 포함되어야 합니다.';
|
||||
$lang->sftp = 'SFTP 사용';
|
||||
$lang->msg_ftp_not_connected = 'FTP 서버에 접속할 수 없습니다. 주소와 포트를 확인해 주십시오.';
|
||||
$lang->msg_ftp_invalid_auth_info = 'FTP 서버에 로그인할 수 없습니다. 아이디와 비밀번호를 확인해 주십시오.';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue