diff --git a/README.md b/README.md index 4da57f407..d81b41b63 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![RhymiX](https://cloud.githubusercontent.com/assets/8565457/12227560/ba15b514-b871-11e5-802a-d5e88db2e393.png)](https://www.rhymix.org) +[![RhymiX](https://cloud.githubusercontent.com/assets/8565457/12807700/92e90982-cb54-11e5-806f-df28792ed9a3.png)](https://www.rhymix.org) RhymiX(라이믹스)는 누구든지 쉽고 자유롭게 독립적인 홈페이지를 만들어 자신을 표현하고 커뮤니티를 키워나갈 수 있도록 돕기 위한 CMS(content management system)입니다. diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index adbe0269a..56eeab0cc 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -235,6 +235,12 @@ class Context $this->_setJSONRequestArgument(); $this->_setRequestArgument(); $this->_setUploadedArgument(); + + if(isset($_POST['_rx_ajax_compat']) && $_POST['_rx_ajax_compat'] === 'XMLRPC') + { + self::$_instance->request_method = 'XMLRPC'; + self::$_instance->response_method = 'JSON'; + } $this->loadDBInfo(); if($this->db_info->use_sitelock == 'Y') diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php index a981765e5..15a71f809 100644 --- a/classes/display/DisplayHandler.class.php +++ b/classes/display/DisplayHandler.class.php @@ -40,7 +40,15 @@ class DisplayHandler extends Handler { $handler = new VirtualXMLDisplayHandler(); } - else if(Context::getRequestMethod() == 'XMLRPC') + elseif(Context::getRequestMethod() == 'JSON' || isset($_POST['_rx_ajax_compat'])) + { + $handler = new JSONDisplayHandler(); + } + elseif(Context::getRequestMethod() == 'JS_CALLBACK') + { + $handler = new JSCallbackDisplayHandler(); + } + elseif(Context::getRequestMethod() == 'XMLRPC') { $handler = new XMLDisplayHandler(); if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) @@ -48,14 +56,6 @@ class DisplayHandler extends Handler $this->gz_enabled = FALSE; } } - else if(Context::getRequestMethod() == 'JSON') - { - $handler = new JSONDisplayHandler(); - } - else if(Context::getRequestMethod() == 'JS_CALLBACK') - { - $handler = new JSCallbackDisplayHandler(); - } else { $handler = new HTMLDisplayHandler(); diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 9a0293ac1..9e3c7807c 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -1207,9 +1207,9 @@ class ModuleHandler extends Handler $oModuleModel = getModel('module'); $triggers = $oModuleModel->getTriggers($trigger_name, $called_position); - if(!$triggers || count($triggers) < 1) + if(!$triggers) { - return new Object(); + $triggers = array(); } //store before trigger call time @@ -1252,6 +1252,17 @@ class ModuleHandler extends Handler unset($oModule); } + $trigger_functions = $oModuleModel->getTriggerFunctions($trigger_name, $called_position); + foreach($trigger_functions as $item) + { + $item($obj); + + if(is_object($output) && method_exists($output, 'toBool') && !$output->toBool()) + { + return $output; + } + } + return new Object(); } diff --git a/classes/security/IpFilter.class.php b/classes/security/IpFilter.class.php index d03a5d30b..ea49b8195 100644 --- a/classes/security/IpFilter.class.php +++ b/classes/security/IpFilter.class.php @@ -6,87 +6,29 @@ class IpFilter public function filter($ip_list, $ip = NULL) { if(!$ip) $ip = $_SERVER['REMOTE_ADDR']; - $long_ip = ip2long($ip); - foreach($ip_list as $filter_ip) - { - $range = explode('-', $filter_ip); - if(!$range[1]) // single address type - { - $star_pos = strpos($filter_ip, '*'); - if($star_pos !== FALSE ) // wild card exist - { - if(strncmp($filter_ip, $ip, $star_pos)===0) return true; - } - else if(strcmp($filter_ip, $ip)===0) - { - return true; - } - } - else if(ip2long($range[0]) <= $long_ip && ip2long($range[1]) >= $long_ip) + foreach($ip_list as $filter) + { + if(Rhymix\Framework\IpFilter::inRange($ip, $filter)) { return true; } } return false; } - - /* public function filter2($ip_list, $ip) - { - $long_ip = ip2long($ip); - foreach($ip_list as $filter_ip) - { - $range = explode('-', $filter_ip); - if(!$range[1]) // single address type - { - $range[1] = str_replace('*', '255', $range[0]); - $range[0] = str_replace('*', '0', $range[0]); - } - - if(ip2long($range[0]) <= $long_ip && ip2long($range[1]) >= $long_ip) - { - return true; - } - } - - return false; - } */ - public function validate($ip_list = array()) { - /* 사용가능한 표현 - 192.168.2.10 - 4자리의 정확한 ip주소 - 192.168.*.* - 와일드카드(*)가 사용된 4자리의 ip주소, a클래스에는 와일드카드 사용불가, - 와일드카드 이후의 아이피주소 허용(단, filter()를 쓸 경우 와일드카드 이후 주소는 무시됨 - 192.168.1.1-192.168.1.10 - '-'로 구분된 정확한 4자리의 ip주소 2개 - */ - $regex = "/^ - (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?) - (?: - (?: - (?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3} - (?:-(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){1} - (?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3} - ) - | - (?: - (?:\.(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|\*)){3} - ) - ) - $/"; - $regex = str_replace(array("\r\n", "\n", "\r","\t"," "), '', $regex); - - foreach($ip_list as $i => $ip) + foreach($ip_list as $filter) { - preg_match($regex, $ip, $matches); - if(!count($matches)) return false; + if(!Rhymix\Framework\IpFilter::validateRange($filter)) + { + return false; + } } - return true; } } - /* End of file : IpFilter.class.php */ /* Location: ./classes/security/IpFilter.class.php */ diff --git a/common/constants.php b/common/constants.php index 683fa9489..d084ed0f4 100644 --- a/common/constants.php +++ b/common/constants.php @@ -51,6 +51,11 @@ else /** * RX_CLIENT_IP_VERSION and RX_CLIENT_IP contain information about the current visitor's IP address. */ +if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) +{ + include_once __DIR__ . '/framework/ipfilter.php'; + Rhymix\Framework\IpFilter::getCloudFlareRealIP(); +} if (isset($_SERVER['REMOTE_ADDR']) && preg_match('/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/', $_SERVER['REMOTE_ADDR'], $matches)) { define('RX_CLIENT_IP_VERSION', 4); diff --git a/common/css/xe.css b/common/css/xe.css index de39e72c3..2bdbb9740 100644 --- a/common/css/xe.css +++ b/common/css/xe.css @@ -72,7 +72,6 @@ a img { box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); background: #fff; min-width:80px; - outline:none; } #popup_menu_area ul { margin: 0; @@ -94,6 +93,7 @@ a img { #popup_menu_area a:active, #popup_menu_area a:focus { background: #eeeeee; + outline:none; } @media screen and (max-width: 400px) { #popup_menu_area { diff --git a/common/defaults/cloudflare.php b/common/defaults/cloudflare.php new file mode 100644 index 000000000..2a988035c --- /dev/null +++ b/common/defaults/cloudflare.php @@ -0,0 +1,28 @@ += $range_start && $ip <= $range_end); + } +} diff --git a/common/framework/lang.php b/common/framework/lang.php index be08f391c..58e89068d 100644 --- a/common/framework/lang.php +++ b/common/framework/lang.php @@ -197,25 +197,54 @@ class Lang // Convert XML to a PHP array. $lang = array(); - foreach ($xml->item as $item) + self::_toArray($xml, $lang, $language); + unset($xml); + + // Save the array as a cache file. + $buff = " $value) + { + if (is_array($value)) + { + foreach ($value as $subkey => $subvalue) + { + if (is_array($subvalue)) + { + foreach ($subvalue as $subsubkey => $subsubvalue) + { + $buff .= '$lang->' . $key . "['$subkey']['$subsubkey']" . ' = ' . var_export($subsubvalue, true) . ";\n"; + } + } + else + { + $buff .= '$lang->' . $key . "['$subkey']" . ' = ' . var_export($subvalue, true) . ";\n"; + } + } + } + else + { + $buff .= '$lang->' . $key . ' = ' . var_export($value, true) . ";\n"; + } + } + \FileHandler::writeFile($output_filename, $buff); + return $output_filename; + } + + /** + * XML to array conversion callback. + * + * @param array $items + * @return void + */ + protected static function _toArray($items, &$lang, $language) + { + foreach ($items as $item) { $name = strval($item['name']); if (count($item->item)) { $lang[$name] = array(); - foreach ($item->item as $subitem) - { - $subname = strval($subitem['name']); - foreach ($subitem->value as $value) - { - $attribs = $value->attributes('xml', true); - if (strval($attribs['lang']) === $language) - { - $lang[$name][$subname] = strval($value); - break; - } - } - } + self::_toArray($item->item, $lang[$name], $language); } else { @@ -230,26 +259,6 @@ class Lang } } } - unset($xml); - - // Save the array as a cache file. - $buff = " $value) - { - if (is_array($value)) - { - foreach ($value as $subkey => $subvalue) - { - $buff .= '$lang->' . $key . "['" . $subkey . "']" . ' = ' . var_export($subvalue, true) . ";\n"; - } - } - else - { - $buff .= '$lang->' . $key . ' = ' . var_export($value, true) . ";\n"; - } - } - \FileHandler::writeFile($output_filename, $buff); - return $output_filename; } /** @@ -304,7 +313,14 @@ class Lang // Search custom translations first. if (isset($this->_loaded_plugins['_custom_']->{$key})) { - return $this->_loaded_plugins['_custom_']->{$key}; + if (is_array($this->_loaded_plugins['_custom_']->{$key})) + { + return new \ArrayObject($this->_loaded_plugins['_custom_']->{$key}, 3); + } + else + { + return $this->_loaded_plugins['_custom_']->{$key}; + } } // Search other plugins. @@ -312,7 +328,14 @@ class Lang { if (isset($this->_loaded_plugins[$plugin_name]->{$key})) { - return $this->_loaded_plugins[$plugin_name]->{$key}; + if (is_array($this->_loaded_plugins[$plugin_name]->{$key})) + { + return new \ArrayObject($this->_loaded_plugins[$plugin_name]->{$key}, 3); + } + else + { + return $this->_loaded_plugins[$plugin_name]->{$key}; + } } } diff --git a/common/js/xml_handler.js b/common/js/xml_handler.js index 8ea72da58..942ac9654 100644 --- a/common/js/xml_handler.js +++ b/common/js/xml_handler.js @@ -27,6 +27,7 @@ params = params ? ($.isArray(params) ? arr2obj(params) : params) : {}; params.module = module; params.act = act; + params._rx_ajax_compat = 'XMLRPC'; // Fill in the XE vid. if (typeof(xeVid) != "undefined") params.vid = xeVid; @@ -115,9 +116,23 @@ // Define the error handler. var errorHandler = function(xhr, textStatus) { + + // If the server has returned XML anyway, convert to JSON and call the success handler. + if (textStatus === 'parsererror' && xhr.responseText && xhr.responseText.match(/homepage = $source_obj->get('homepage'); } // If the tile is empty, extract string from the contents. + $obj->title = htmlspecialchars($obj->title); settype($obj->title, "string"); if($obj->title == '') $obj->title = cut_str(strip_tags($obj->content),20,'...'); // If no tile extracted from the contents, leave it untitled. diff --git a/modules/editor/lang/en.php b/modules/editor/lang/en.php index f6789f5a1..75e711140 100644 --- a/modules/editor/lang/en.php +++ b/modules/editor/lang/en.php @@ -56,7 +56,22 @@ $lang->about_enable_autosave = 'You may decide whether the auto-save function wi $lang->edit['fontname'] = 'Font'; $lang->edit['fontsize'] = 'Size'; $lang->edit['use_paragraph'] = 'Paragraph Function'; +$lang->edit['fontlist']['arial'] = 'Arial, Helvetica, sans-serif'; +$lang->edit['fontlist']['tahoma'] = 'Tahoma, Geneva, sans-serif'; +$lang->edit['fontlist']['verdana'] = 'Verdana, Geneva, sans-serif'; +$lang->edit['fontlist']['sans-serif'] = 'Sans-serif'; +$lang->edit['fontlist']['georgia'] = 'Georgia, \'Times New Roman\', Times, serif'; +$lang->edit['fontlist']['palatinoLinotype'] = '\'Palatino Linotype\', \'Book Antiqua\', Palatino, serif'; +$lang->edit['fontlist']['timesNewRoman'] = '\'Times New Roman\', Times, serif'; +$lang->edit['fontlist']['serif'] = 'Serif'; +$lang->edit['fontlist']['courierNew'] = '\'Courier New\', Courier, monospace'; $lang->edit['header'] = 'Style'; +$lang->edit['header_list']['h1'] = 'Header 1'; +$lang->edit['header_list']['h2'] = 'Header 2'; +$lang->edit['header_list']['h3'] = 'Header 3'; +$lang->edit['header_list']['h4'] = 'Header 4'; +$lang->edit['header_list']['h5'] = 'Header 5'; +$lang->edit['header_list']['h6'] = 'Header 6'; $lang->edit['submit'] = 'Submit'; $lang->edit['fontcolor'] = 'Text Color'; $lang->edit['fontbgcolor'] = 'Background Color'; diff --git a/modules/editor/lang/es.php b/modules/editor/lang/es.php index 80c25d968..12d6c149d 100644 --- a/modules/editor/lang/es.php +++ b/modules/editor/lang/es.php @@ -35,6 +35,12 @@ $lang->edit['fontname'] = 'Fuente'; $lang->edit['fontsize'] = 'Tamaño'; $lang->edit['use_paragraph'] = 'Párrafo'; $lang->edit['header'] = 'Estilo'; +$lang->edit['header_list']['h1'] = 'Título 1'; +$lang->edit['header_list']['h2'] = 'Título 2'; +$lang->edit['header_list']['h3'] = 'Título 3'; +$lang->edit['header_list']['h4'] = 'Título 4'; +$lang->edit['header_list']['h5'] = 'Título 5'; +$lang->edit['header_list']['h6'] = 'Título 6'; $lang->edit['submit'] = 'Confirmar'; $lang->edit['help_fontcolor'] = 'Selecciona el color de las letras'; $lang->edit['help_fontbgcolor'] = 'Selecciona el color del fondo de la letras'; diff --git a/modules/editor/lang/fr.php b/modules/editor/lang/fr.php index f398fbf73..987139e9f 100644 --- a/modules/editor/lang/fr.php +++ b/modules/editor/lang/fr.php @@ -33,6 +33,12 @@ $lang->about_enable_autosave = 'Vous pouvez valider la fonction à Conserver Aut $lang->edit['fontname'] = 'Police de caractères'; $lang->edit['fontsize'] = 'Mesure'; $lang->edit['use_paragraph'] = 'Fonctions sur Paragraphe'; +$lang->edit['header_list']['h1'] = 'Titre 1'; +$lang->edit['header_list']['h2'] = 'Titre 2'; +$lang->edit['header_list']['h3'] = 'Titre 3'; +$lang->edit['header_list']['h4'] = 'Titre 4'; +$lang->edit['header_list']['h5'] = 'Titre 5'; +$lang->edit['header_list']['h6'] = 'Titre 6'; $lang->edit['submit'] = 'Soumettre'; $lang->edit['help_remove_format'] = 'Supprimer les balises dans l\'endroit sélectionné'; $lang->edit['help_strike_through'] = 'Représenter la ligne d\'annulation sur les lettres.'; diff --git a/modules/editor/lang/ja.php b/modules/editor/lang/ja.php index d6234e8f8..f4ae0102e 100644 --- a/modules/editor/lang/ja.php +++ b/modules/editor/lang/ja.php @@ -56,7 +56,16 @@ $lang->about_enable_autosave = '書き込みの際に自動保存機能をオン $lang->edit['fontname'] = 'フォント'; $lang->edit['fontsize'] = 'フォントサイズ'; $lang->edit['use_paragraph'] = '段落機能'; +$lang->edit['fontlist']['meiryo'] = '\'メイリオ\', \'Meiryo\', Arial, Helvetica, sans-serif'; +$lang->edit['fontlist']['hiragino'] = '\'ヒラギノ角ゴ Pro\', \'Hiragino Kaku Gothic Pro\', Arial, Helvetica, sans-serif'; +$lang->edit['fontlist']['ms_pgothic'] = '\'MS Pゴシック\', \'MS PGothic\', Arial, Helvetica, sans-serif'; $lang->edit['header'] = '書式'; +$lang->edit['header_list']['h1'] = '見出し1'; +$lang->edit['header_list']['h2'] = '見出し2'; +$lang->edit['header_list']['h3'] = '見出し3'; +$lang->edit['header_list']['h4'] = '見出し4'; +$lang->edit['header_list']['h5'] = '見出し5'; +$lang->edit['header_list']['h6'] = '見出し6'; $lang->edit['submit'] = '送信'; $lang->edit['fontcolor'] = 'テキストの色'; $lang->edit['fontbgcolor'] = 'テキストの背景色'; diff --git a/modules/editor/lang/ko.php b/modules/editor/lang/ko.php index 300708340..3df0e1144 100644 --- a/modules/editor/lang/ko.php +++ b/modules/editor/lang/ko.php @@ -56,7 +56,23 @@ $lang->about_enable_autosave = '글 작성 시 자동 저장 기능을 활성화 $lang->edit['fontname'] = '글꼴'; $lang->edit['fontsize'] = '크기'; $lang->edit['use_paragraph'] = '문단기능'; +$lang->edit['fontlist']['arial'] = 'Arial, Helvetica, sans-serif'; +$lang->edit['fontlist']['tahoma'] = 'Tahoma, Geneva, sans-serif'; +$lang->edit['fontlist']['verdana'] = 'Verdana, Geneva, sans-serif'; +$lang->edit['fontlist']['sans-serif'] = 'Sans-serif'; +$lang->edit['fontlist']['georgia'] = 'Georgia, \'Times New Roman\', Times, serif'; +$lang->edit['fontlist']['palatinoLinotype'] = '\'Palatino Linotype\', \'Book Antiqua\', Palatino, serif'; +$lang->edit['fontlist']['timesNewRoman'] = '\'Times New Roman\', Times, serif'; +$lang->edit['fontlist']['serif'] = 'Serif'; +$lang->edit['fontlist']['courierNew'] = '\'Courier New\', Courier, monospace'; +$lang->edit['fontlist']['lucidaConsole'] = '\'Lucida Console\', Monaco, monospace'; $lang->edit['header'] = '형식'; +$lang->edit['header_list']['h1'] = '제목 1'; +$lang->edit['header_list']['h2'] = '제목 2'; +$lang->edit['header_list']['h3'] = '제목 3'; +$lang->edit['header_list']['h4'] = '제목 4'; +$lang->edit['header_list']['h5'] = '제목 5'; +$lang->edit['header_list']['h6'] = '제목 6'; $lang->edit['submit'] = '확인'; $lang->edit['fontcolor'] = '글자 색'; $lang->edit['fontbgcolor'] = '글자 배경색'; diff --git a/modules/editor/lang/ru.php b/modules/editor/lang/ru.php index da3117485..28dd7e72e 100644 --- a/modules/editor/lang/ru.php +++ b/modules/editor/lang/ru.php @@ -48,6 +48,12 @@ $lang->edit['fontname'] = 'Шрифт'; $lang->edit['fontsize'] = 'Размер'; $lang->edit['use_paragraph'] = 'Функции параграфа'; $lang->edit['header'] = 'Стиль'; +$lang->edit['header_list']['h1'] = 'Заголовок 1'; +$lang->edit['header_list']['h2'] = 'Заголовок 2'; +$lang->edit['header_list']['h3'] = 'Заголовок 3'; +$lang->edit['header_list']['h4'] = 'Заголовок 4'; +$lang->edit['header_list']['h5'] = 'Заголовок 5'; +$lang->edit['header_list']['h6'] = 'Заголовок 6'; $lang->edit['submit'] = 'Принять'; $lang->edit['fontcolor'] = 'Цвет текста'; $lang->edit['fontbgcolor'] = 'Цвет Фона'; diff --git a/modules/editor/lang/tr.php b/modules/editor/lang/tr.php index 4ec920378..12e1eadaf 100644 --- a/modules/editor/lang/tr.php +++ b/modules/editor/lang/tr.php @@ -49,6 +49,12 @@ $lang->edit['fontname'] = 'Yazı Tipi'; $lang->edit['fontsize'] = 'Boyut'; $lang->edit['use_paragraph'] = 'Paragraf Özelliği'; $lang->edit['header'] = 'Tarz'; +$lang->edit['header_list']['h1'] = 'Konu 1'; +$lang->edit['header_list']['h2'] = 'Konu 2'; +$lang->edit['header_list']['h3'] = 'Konu 3'; +$lang->edit['header_list']['h4'] = 'Konu 4'; +$lang->edit['header_list']['h5'] = 'Konu 5'; +$lang->edit['header_list']['h6'] = 'Konu 6'; $lang->edit['submit'] = 'Gönder'; $lang->edit['fontcolor'] = 'Yazı Rengi'; $lang->edit['fontbgcolor'] = 'Arkaplan Rengi'; diff --git a/modules/editor/lang/vi.php b/modules/editor/lang/vi.php index 85edd9305..7b3c69df8 100644 --- a/modules/editor/lang/vi.php +++ b/modules/editor/lang/vi.php @@ -50,6 +50,12 @@ $lang->edit['fontname'] = 'Kiểu chữ'; $lang->edit['fontsize'] = 'Cỡ chữ'; $lang->edit['use_paragraph'] = 'Chức năng Paragraph'; $lang->edit['header'] = 'Tiêu đề lớn'; +$lang->edit['header_list']['h1'] = 'Cỡ 1'; +$lang->edit['header_list']['h2'] = 'Cỡ 2'; +$lang->edit['header_list']['h3'] = 'Cỡ 3'; +$lang->edit['header_list']['h4'] = 'Cỡ 4'; +$lang->edit['header_list']['h5'] = 'Cỡ 5'; +$lang->edit['header_list']['h6'] = 'Cỡ 6'; $lang->edit['submit'] = 'Gửi bài'; $lang->edit['fontcolor'] = 'Màu chữ'; $lang->edit['fontbgcolor'] = 'Màu nền'; diff --git a/modules/editor/lang/zh-CN.php b/modules/editor/lang/zh-CN.php index 73985139a..4ff949d03 100644 --- a/modules/editor/lang/zh-CN.php +++ b/modules/editor/lang/zh-CN.php @@ -51,6 +51,12 @@ $lang->edit['fontname'] = '字体'; $lang->edit['fontsize'] = '大小'; $lang->edit['use_paragraph'] = '段落功能'; $lang->edit['header'] = '样式'; +$lang->edit['header_list']['h1'] = '标题 1'; +$lang->edit['header_list']['h2'] = '标题 2'; +$lang->edit['header_list']['h3'] = '标题 3'; +$lang->edit['header_list']['h4'] = '标题 4'; +$lang->edit['header_list']['h5'] = '标题 5'; +$lang->edit['header_list']['h6'] = '标题 6'; $lang->edit['submit'] = '确认'; $lang->edit['fontcolor'] = '文本颜色'; $lang->edit['fontbgcolor'] = '背景颜色'; diff --git a/modules/editor/lang/zh-TW.php b/modules/editor/lang/zh-TW.php index 8964e2664..d9db8a058 100644 --- a/modules/editor/lang/zh-TW.php +++ b/modules/editor/lang/zh-TW.php @@ -51,6 +51,12 @@ $lang->edit['fontname'] = '字體'; $lang->edit['fontsize'] = '大小'; $lang->edit['use_paragraph'] = '段落功能'; $lang->edit['header'] = '樣式'; +$lang->edit['header_list']['h1'] = '標題 1'; +$lang->edit['header_list']['h2'] = '標題 2'; +$lang->edit['header_list']['h3'] = '標題 3'; +$lang->edit['header_list']['h4'] = '標題 4'; +$lang->edit['header_list']['h5'] = '標題 5'; +$lang->edit['header_list']['h6'] = '標題 6'; $lang->edit['submit'] = '確認'; $lang->edit['fontcolor'] = '文字顏色'; $lang->edit['fontbgcolor'] = '背景顏色'; diff --git a/modules/file/queries/getCoverImage.xml b/modules/file/queries/getCoverImage.xml index d84c92580..2ac757573 100644 --- a/modules/file/queries/getCoverImage.xml +++ b/modules/file/queries/getCoverImage.xml @@ -4,6 +4,6 @@ - + diff --git a/modules/integration_search/lang/en.php b/modules/integration_search/lang/en.php index 5347e5cbf..bdf9c0992 100644 --- a/modules/integration_search/lang/en.php +++ b/modules/integration_search/lang/en.php @@ -11,6 +11,14 @@ $lang->is_result_text = 'There are %d result(s) for \'% $lang->multimedia = 'Images/Video'; $lang->include_search_target = 'Search for selected modules'; $lang->exclude_search_target = 'Exclude selected modules from search'; +$lang->is_search_option['document']['title_content'] = 'Subject+Content'; +$lang->is_search_option['document']['title'] = 'Subject'; +$lang->is_search_option['document']['content'] = 'Content'; +$lang->is_search_option['document']['tag'] = 'Tags'; +$lang->is_search_option['trackback']['url'] = 'Target URL'; +$lang->is_search_option['trackback']['blog_name'] = 'Target Site Name'; +$lang->is_search_option['trackback']['title'] = 'Title'; +$lang->is_search_option['trackback']['excerpt'] = 'Excerpt'; $lang->is_sort_option['regdate'] = 'Registered Date'; $lang->is_sort_option['comment_count'] = 'Number of Comments'; $lang->is_sort_option['readed_count'] = 'Number of Hits'; diff --git a/modules/integration_search/lang/es.php b/modules/integration_search/lang/es.php index e1909d403..8ec0a5c2c 100644 --- a/modules/integration_search/lang/es.php +++ b/modules/integration_search/lang/es.php @@ -7,6 +7,14 @@ $lang->msg_no_keyword = 'Ingrese la palabra para la búsqueda'; $lang->is_result_text = '%d Resultados con la palabra \'%s\' '; $lang->include_search_target = 'Sólo en determinados '; $lang->exclude_search_target = 'Búsqueda para el destino de'; +$lang->is_search_option['document']['title_content'] = 'Título+Contenido'; +$lang->is_search_option['document']['title'] = 'Título'; +$lang->is_search_option['document']['content'] = 'Contenido'; +$lang->is_search_option['document']['tag'] = 'Etiqueta'; +$lang->is_search_option['trackback']['url'] = 'URL objetivo'; +$lang->is_search_option['trackback']['blog_name'] = 'Ojetivo del nombre de sitio'; +$lang->is_search_option['trackback']['title'] = 'Título'; +$lang->is_search_option['trackback']['excerpt'] = 'Contenido'; $lang->is_sort_option['regdate'] = 'Fecha del registro'; $lang->is_sort_option['comment_count'] = 'Número de commentarios'; $lang->is_sort_option['readed_count'] = 'Número de query'; diff --git a/modules/integration_search/lang/fr.php b/modules/integration_search/lang/fr.php index 2dadbe978..ad732391f 100644 --- a/modules/integration_search/lang/fr.php +++ b/modules/integration_search/lang/fr.php @@ -7,6 +7,14 @@ $lang->msg_no_keyword = 'Entrez le mot de clé à rechercher, S.V.P.'; $lang->is_result_text = 'Il y a %d résultat(s) pour \'%s\''; $lang->include_search_target = 'Seulement dans certaines cibles '; $lang->exclude_search_target = 'Recherche de la destination sélectionnée à partir de'; +$lang->is_search_option['document']['title_content'] = 'Titre+Contenu'; +$lang->is_search_option['document']['title'] = 'Titre'; +$lang->is_search_option['document']['content'] = 'Contenu'; +$lang->is_search_option['document']['tag'] = 'Balise'; +$lang->is_search_option['trackback']['url'] = 'URL objectif'; +$lang->is_search_option['trackback']['blog_name'] = 'Nom du Site objectif'; +$lang->is_search_option['trackback']['title'] = 'Titre'; +$lang->is_search_option['trackback']['excerpt'] = 'Contenu'; $lang->is_sort_option['regdate'] = 'Enrégistré'; $lang->is_sort_option['comment_count'] = 'Commentaires'; $lang->is_sort_option['readed_count'] = 'Vues'; diff --git a/modules/integration_search/lang/ja.php b/modules/integration_search/lang/ja.php index 9fa240541..6d591c65d 100644 --- a/modules/integration_search/lang/ja.php +++ b/modules/integration_search/lang/ja.php @@ -11,6 +11,14 @@ $lang->is_result_text = '\'%s\'に対する検索結果 $lang->multimedia = '画像/動画'; $lang->include_search_target = '選択された対象のみ'; $lang->exclude_search_target = '選択した対象を検索から除外'; +$lang->is_search_option['document']['title_content'] = 'タイトル+内容'; +$lang->is_search_option['document']['title'] = 'タイトル'; +$lang->is_search_option['document']['content'] = '内容'; +$lang->is_search_option['document']['tag'] = 'タグ'; +$lang->is_search_option['trackback']['url'] = '対象URL'; +$lang->is_search_option['trackback']['blog_name'] = '対象サイト(ブログ)名'; +$lang->is_search_option['trackback']['title'] = 'タイトル'; +$lang->is_search_option['trackback']['excerpt'] = '内容'; $lang->is_sort_option['regdate'] = '登録日'; $lang->is_sort_option['comment_count'] = 'コメント数'; $lang->is_sort_option['readed_count'] = '閲覧数'; diff --git a/modules/integration_search/lang/ko.php b/modules/integration_search/lang/ko.php index e3890db6e..65bf21697 100644 --- a/modules/integration_search/lang/ko.php +++ b/modules/integration_search/lang/ko.php @@ -11,6 +11,14 @@ $lang->is_result_text = '\'%s\'에 대한 검색결과 $lang->multimedia = '이미지/동영상'; $lang->include_search_target = '선택된 대상만 검색'; $lang->exclude_search_target = '선택된 대상을 검색에서 제외'; +$lang->is_search_option['document']['title_content'] = '제목+내용'; +$lang->is_search_option['document']['title'] = '제목'; +$lang->is_search_option['document']['content'] = '내용'; +$lang->is_search_option['document']['tag'] = '태그'; +$lang->is_search_option['trackback']['url'] = '대상 URL'; +$lang->is_search_option['trackback']['blog_name'] = '대상 사이트 이름'; +$lang->is_search_option['trackback']['title'] = '제목'; +$lang->is_search_option['trackback']['excerpt'] = '내용'; $lang->is_sort_option['regdate'] = '등록일'; $lang->is_sort_option['comment_count'] = '댓글 수'; $lang->is_sort_option['readed_count'] = '조회 수'; diff --git a/modules/integration_search/lang/ru.php b/modules/integration_search/lang/ru.php index ca9c862be..9b7e92ae3 100644 --- a/modules/integration_search/lang/ru.php +++ b/modules/integration_search/lang/ru.php @@ -9,6 +9,14 @@ $lang->is_result_text = '%d результатов для multimedia = 'Картинки/Видео'; $lang->include_search_target = 'Поиск только для выбранных модулей'; $lang->exclude_search_target = 'Исключить выбранные модули из поиска'; +$lang->is_search_option['document']['title_content'] = 'Заголовок+Содержание'; +$lang->is_search_option['document']['title'] = 'Тема'; +$lang->is_search_option['document']['content'] = 'Содержание'; +$lang->is_search_option['document']['tag'] = 'Теги'; +$lang->is_search_option['trackback']['url'] = 'URL'; +$lang->is_search_option['trackback']['blog_name'] = 'Имя сайта'; +$lang->is_search_option['trackback']['title'] = 'Заголовок'; +$lang->is_search_option['trackback']['excerpt'] = 'Содержание'; $lang->is_sort_option['regdate'] = 'Дата регистрации'; $lang->is_sort_option['comment_count'] = 'Кол-во комментариев'; $lang->is_sort_option['readed_count'] = 'Кол-во хитов'; diff --git a/modules/integration_search/lang/tr.php b/modules/integration_search/lang/tr.php index f4bb83750..3e58404ba 100644 --- a/modules/integration_search/lang/tr.php +++ b/modules/integration_search/lang/tr.php @@ -8,6 +8,14 @@ $lang->is_result_text = '\'%s\' için yaklaşık %dmultimedia = 'Resimler/ Görüntüler'; $lang->include_search_target = 'Seçili modüller içinde ara'; $lang->exclude_search_target = 'Seçili modülleri arama dışında tut'; +$lang->is_search_option['document']['title_content'] = 'Konu+İçerik'; +$lang->is_search_option['document']['title'] = 'Konu'; +$lang->is_search_option['document']['content'] = 'İçerik'; +$lang->is_search_option['document']['tag'] = 'Etiketler'; +$lang->is_search_option['trackback']['url'] = 'Hedef URL'; +$lang->is_search_option['trackback']['blog_name'] = 'Hedef Site İsmi'; +$lang->is_search_option['trackback']['title'] = 'Başlık'; +$lang->is_search_option['trackback']['excerpt'] = 'Alıntı'; $lang->is_sort_option['regdate'] = 'Kayıt Zamanı'; $lang->is_sort_option['comment_count'] = 'Yorum Sayısı'; $lang->is_sort_option['readed_count'] = 'Tıklanma Sayısı'; diff --git a/modules/integration_search/lang/vi.php b/modules/integration_search/lang/vi.php index dd394d03b..5d136b893 100644 --- a/modules/integration_search/lang/vi.php +++ b/modules/integration_search/lang/vi.php @@ -6,6 +6,14 @@ $lang->about_sample_code = 'Bạn có thể sử dụng chức năng tìm kiếm $lang->msg_no_keyword = 'Hãy nhập từ khóa để tìm kiếm!'; $lang->is_result_text = 'Tìm thấy %d kết quả cho \'%s\''; $lang->multimedia = 'Hình ảnh/ Video'; +$lang->is_search_option['document']['title_content'] = 'T.Đề+N.Dung'; +$lang->is_search_option['document']['title'] = 'Tiêu đề'; +$lang->is_search_option['document']['content'] = 'Nội dung'; +$lang->is_search_option['document']['tag'] = 'Tag'; +$lang->is_search_option['trackback']['url'] = 'URL'; +$lang->is_search_option['trackback']['blog_name'] = 'Tên Website'; +$lang->is_search_option['trackback']['title'] = 'Tiêu đề'; +$lang->is_search_option['trackback']['excerpt'] = 'Trích mô tả'; $lang->is_sort_option['regdate'] = 'Ngày gửi'; $lang->is_sort_option['comment_count'] = 'Số bình luận'; $lang->is_sort_option['readed_count'] = 'Lượt xem'; diff --git a/modules/integration_search/lang/zh-CN.php b/modules/integration_search/lang/zh-CN.php index b5b37e5d2..f41deadc6 100644 --- a/modules/integration_search/lang/zh-CN.php +++ b/modules/integration_search/lang/zh-CN.php @@ -11,6 +11,14 @@ $lang->is_result_text = '符合\'%s\'的搜索结果约有multimedia = '图片/视频'; $lang->include_search_target = '只搜索所选对象'; $lang->exclude_search_target = '所选对象从搜索中排除'; +$lang->is_search_option['document']['title_content'] = '标题+内容'; +$lang->is_search_option['document']['title'] = '标题'; +$lang->is_search_option['document']['content'] = '内容'; +$lang->is_search_option['document']['tag'] = '标签'; +$lang->is_search_option['trackback']['url'] = '对象URL'; +$lang->is_search_option['trackback']['blog_name'] = '对象网站名称'; +$lang->is_search_option['trackback']['title'] = '标题'; +$lang->is_search_option['trackback']['excerpt'] = '内容'; $lang->is_sort_option['regdate'] = '日期'; $lang->is_sort_option['comment_count'] = '评论'; $lang->is_sort_option['readed_count'] = '查看'; diff --git a/modules/integration_search/lang/zh-TW.php b/modules/integration_search/lang/zh-TW.php index 0cd1f55be..2729fbb5f 100644 --- a/modules/integration_search/lang/zh-TW.php +++ b/modules/integration_search/lang/zh-TW.php @@ -11,6 +11,14 @@ $lang->is_result_text = '符合\'%s\'的搜尋結果,約有multimedia = '圖片/影片'; $lang->include_search_target = '尋找所選模組'; $lang->exclude_search_target = '排除所選模組'; +$lang->is_search_option['document']['title_content'] = '標題+內容'; +$lang->is_search_option['document']['title'] = '標題'; +$lang->is_search_option['document']['content'] = '內容'; +$lang->is_search_option['document']['tag'] = '標籤'; +$lang->is_search_option['trackback']['url'] = '目標網址'; +$lang->is_search_option['trackback']['blog_name'] = '目標網站名稱'; +$lang->is_search_option['trackback']['title'] = '標題'; +$lang->is_search_option['trackback']['excerpt'] = '內容'; $lang->is_sort_option['regdate'] = '日期'; $lang->is_sort_option['comment_count'] = '評論'; $lang->is_sort_option['readed_count'] = '檢視'; diff --git a/modules/member/conf/module.xml b/modules/member/conf/module.xml index 4d8781f14..ab452dea1 100644 --- a/modules/member/conf/module.xml +++ b/modules/member/conf/module.xml @@ -21,6 +21,7 @@ + diff --git a/modules/member/lang/ko.php b/modules/member/lang/ko.php index 740c1aa22..4da8f0cee 100644 --- a/modules/member/lang/ko.php +++ b/modules/member/lang/ko.php @@ -114,6 +114,7 @@ $lang->cmd_trace_comment = '작성 댓글 추적'; $lang->cmd_view_scrapped_document = '스크랩 보기'; $lang->cmd_view_saved_document = '저장함 보기'; $lang->cmd_send_email = '메일 보내기'; +$lang->cmd_modify_nickname_log = '닉네임 변경 기록'; $lang->msg_email_not_exists = '이메일 주소가 존재하지 않습니다.'; $lang->msg_alreay_scrapped = '이미 스크랩된 게시물입니다.'; $lang->msg_cart_is_null = '대상을 선택해주세요.'; @@ -216,6 +217,7 @@ $lang->about_ssl_port = '기본 포트 이외의 보안접속(SSL) 포트를 사 $lang->about_reset_auth_mail = '현재등록된 이메일 주소는 %s입니다. 이메일 주소를 변경하고자 하는 경우 새로운 이메일 주소로 회원정보 갱신 후 인증메일을 재발송할 수 있습니다.'; $lang->about_resend_auth_mail = '인증 메일을 받지 못한 경우 다시 받을 수 있습니다.'; $lang->about_reset_auth_mail_submit = '이메일을 로그인 계정으로 사용할 경우 신규 메일주소로 로그인해야 합니다.'; +$lang->about_update_nickname_log = '닉네임 로그를 기록합니다. 이 옵션을 사용하게 되면, 닉네임변경이력을 남기도록 할 수 있습니다.'; $lang->no_article = '글이 없습니다.'; $lang->find_account_question = '비밀번호 찾기 질문/답변'; $lang->find_account_answer = '비밀번호 찾기 답변'; @@ -309,3 +311,5 @@ $lang->spammer_description = '

지정된 회원을 차단하고, 회원이 남 $lang->btn_spammer_delete_all = '모두 삭제'; $lang->spammer_move_to_trash = '휴지통으로 이동'; $lang->msg_spammer_complete = '완료되었습니다.'; +$lang->nick_name_before_changing = '닉네임 변경 전'; +$lang->nick_name_after_changing = '닉네임 변경 후'; diff --git a/modules/member/m.skins/default/css/member.css b/modules/member/m.skins/default/css/member.css index 432f926bd..7d1649adc 100644 --- a/modules/member/m.skins/default/css/member.css +++ b/modules/member/m.skins/default/css/member.css @@ -36,6 +36,14 @@ .lt{margin:0;padding:0;list-style:none;background:#f8f8f8;font-size:14px} .lt li{border-bottom:1px solid #ccc8be;overflow:hidden} .lt a{box-sizing: border-box;width:100%;display:inline-block;float:left;text-decoration:none;color:#000;padding:10px} +.lt span{ + display:inline-block; + padding:5px; +} +.lt span.before-color:after{ + content:"→"; + margin-left:10px; +} .lt .memberInfo{float:right;} .lt .notice{display:inline-block;background:#a06acd;font-weight:bold;color:#fff;font-size:12px;padding:1px;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px} .lt .title{display:block;margin:0 0 5px 0} diff --git a/modules/member/m.skins/default/member_nick.html b/modules/member/m.skins/default/member_nick.html new file mode 100644 index 000000000..749dc5cdd --- /dev/null +++ b/modules/member/m.skins/default/member_nick.html @@ -0,0 +1,18 @@ + +

+

{$member_title = $lang->cmd_modify_nickname_log}

+
    +
  • + {zdate($val->regdate, "Y-m-d")} + {$val->before_nick_name} + {$val->after_nick_name} +
  • +
+
+ + {$page} / {$page_navigation->last_page} + +
+
+ + \ No newline at end of file diff --git a/modules/member/member.admin.controller.php b/modules/member/member.admin.controller.php index c844f636d..ddfb69ba8 100644 --- a/modules/member/member.admin.controller.php +++ b/modules/member/member.admin.controller.php @@ -24,12 +24,12 @@ class memberAdminController extends member // if(Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request"); // Extract the necessary information in advance $logged_info = Context::get('logged_info'); - if($logged_info->is_admin !== 'Y' || !checkCSRF()) + if($logged_info->is_admin != 'Y' || !checkCSRF()) { return new Object(-1, 'msg_invalid_request'); } - $args = new stdClass; + $args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date'); $oMemberModel = &getModel ('member'); $config = $oMemberModel->getMemberConfig (); $getVars = array(); @@ -47,7 +47,7 @@ class memberAdminController extends member { $args->{$val} = Context::get($val); } - $args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing', 'allow_message', 'denied', 'is_admin', 'description', 'group_srl_list', 'limit_date'); + $args->member_srl = Context::get('member_srl'); if(Context::get('reset_password')) $args->password = Context::get('reset_password'); else unset($args->password); @@ -162,7 +162,8 @@ class memberAdminController extends member 'password_strength', 'password_hashing_algorithm', 'password_hashing_work_factor', - 'password_hashing_auto_upgrade' + 'password_hashing_auto_upgrade', + 'update_nickname_log' ); $oPassword = new Password(); diff --git a/modules/member/member.controller.php b/modules/member/member.controller.php index e2f1e2de7..090c2f522 100644 --- a/modules/member/member.controller.php +++ b/modules/member/member.controller.php @@ -1885,6 +1885,7 @@ class memberController extends member $this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document'); $this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document'); $this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document'); + $this->addMemberMenu( 'dispMemberModifyNicknameLog', 'cmd_modify_nickname_log'); } /** @@ -2273,6 +2274,18 @@ class memberController extends member $oDB->rollback(); return $output; } + else + { + if($args->nick_name != $orgMemberInfo->nick_name && $config->update_nick_log == 'Y') + { + $log_args = new stdClass(); + $log_args->member_srl = $args->member_srl; + $log_args->before_nick_name = $orgMemberInfo->nick_name; + $log_args->after_nick_name = $args->nick_name; + $log_args->user_id = $args->user_id; + $log_output = executeQuery('member.insertMemberModifyNickName', $log_args); + } + } if($args->group_srl_list) { @@ -2397,6 +2410,7 @@ class memberController extends member $oDB->rollback(); return $output; } + executeQuery('member.deleteMemberModifyNickNameLog', $args); // TODO: If the table is not an upgrade may fail. /* diff --git a/modules/member/member.model.php b/modules/member/member.model.php index 3a38c2f72..32a33692f 100644 --- a/modules/member/member.model.php +++ b/modules/member/member.model.php @@ -687,6 +687,7 @@ class memberModel extends member $column_title = $join_form_list[$i]->column_title; $default_value = $join_form_list[$i]->default_value; // Add language variable + if(!isset($lang->extend_vars)) $lang->extend_vars = array(); $lang->extend_vars[$column_name] = $column_title; // unserialize if the data type if checkbox, select and so on if(in_array($column_type, array('checkbox','select','radio'))) diff --git a/modules/member/member.view.php b/modules/member/member.view.php index 8a21d6e67..687dd1cc9 100644 --- a/modules/member/member.view.php +++ b/modules/member/member.view.php @@ -688,7 +688,40 @@ class memberView extends member $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile('spammer'); } - + + /** + * Member Nickname Log + * @return void + */ + function dispMemberModifyNicknameLog() + { + $member_srl = Context::get('member_srl'); + $logged_info = Context::get('logged_info'); + if(!$member_srl) + { + $member_srl = $logged_info->member_srl; + } + else + { + if($logged_info->is_admin != 'Y') + { + return new Object(-1, 'msg_not_permitted'); + } + } + + $args = new stdClass(); + $args->member_srl = $member_srl; + $args->page = Context::get('page'); + $output = executeQuery('member.getMemberModifyNickName', $args); + + Context::set('total_count', $output->page_navigation->total_count); + Context::set('total_page', $output->page_navigation->total_page); + Context::set('page', $output->page); + Context::set('nickname_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('member_nick'); + } } /* End of file member.view.php */ /* Location: ./modules/member/member.view.php */ diff --git a/modules/member/queries/deleteMemberModifyNickNameLog.xml b/modules/member/queries/deleteMemberModifyNickNameLog.xml new file mode 100644 index 000000000..dedadd13e --- /dev/null +++ b/modules/member/queries/deleteMemberModifyNickNameLog.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/modules/member/queries/getMemberModifyNickName.xml b/modules/member/queries/getMemberModifyNickName.xml new file mode 100644 index 000000000..3dea7f6bb --- /dev/null +++ b/modules/member/queries/getMemberModifyNickName.xml @@ -0,0 +1,17 @@ + + +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/member/queries/insertMemberModifyNickName.xml b/modules/member/queries/insertMemberModifyNickName.xml new file mode 100644 index 000000000..aa2fa9f52 --- /dev/null +++ b/modules/member/queries/insertMemberModifyNickName.xml @@ -0,0 +1,12 @@ + + +
+ + + + + + + + + diff --git a/modules/member/schemas/member_nickname_log.xml b/modules/member/schemas/member_nickname_log.xml new file mode 100644 index 000000000..ea44dc3f5 --- /dev/null +++ b/modules/member/schemas/member_nickname_log.xml @@ -0,0 +1,7 @@ +
+ + + + + +
diff --git a/modules/member/skins/default/member_nick.html b/modules/member/skins/default/member_nick.html new file mode 100644 index 000000000..ebbd53794 --- /dev/null +++ b/modules/member/skins/default/member_nick.html @@ -0,0 +1,35 @@ + +

{$member_title = $lang->cmd_modify_nickname_log}

+ + + + + + + + + + + + + + + + +
{$lang->date}{$lang->nick_name_before_changing}{$lang->nick_name_after_changing}
+ {zdate($val->regdate,"Y-m-d H:i:s")} + + {$val->before_nick_name} + + {$val->after_nick_name} +
+ + \ No newline at end of file diff --git a/modules/member/tpl/default_config.html b/modules/member/tpl/default_config.html index 114a2d592..48f303295 100644 --- a/modules/member/tpl/default_config.html +++ b/modules/member/tpl/default_config.html @@ -20,6 +20,14 @@

{$lang->about_enable_confirm}

+
+
{$lang->cmd_modify_nickname_log}
+
+ + +

{$lang->about_update_nickname_log}

+
+
{$lang->enable_find_account_question}
diff --git a/modules/module/module.controller.php b/modules/module/module.controller.php index 8a7f1e9d5..b23ca03e7 100644 --- a/modules/module/module.controller.php +++ b/modules/module/module.controller.php @@ -60,6 +60,19 @@ class moduleController extends module return $output; } + /** + * @brief Add trigger callback function + * + * @param string $trigger_name + * @param string $called_position + * @param callable $callback_function + */ + function addTriggerFunction($trigger_name, $called_position, $callback_function) + { + $GLOBALS['__trigger_functions__'][$trigger_name][$called_position][] = $callback_function; + return true; + } + /** * @brief Add module trigger * module trigger is to call a trigger to a target module diff --git a/modules/module/module.model.php b/modules/module/module.model.php index 5b8b27853..b04529b74 100644 --- a/modules/module/module.model.php +++ b/modules/module/module.model.php @@ -625,6 +625,21 @@ class moduleModel extends module } } + /** + * @brief Get trigger functions + */ + function getTriggerFunctions($trigger_name, $called_position) + { + if(isset($GLOBALS['__trigger_functions__'][$trigger_name][$called_position])) + { + return $GLOBALS['__trigger_functions__'][$trigger_name][$called_position]; + } + else + { + return array(); + } + } + /** * @brief Get a list of all triggers on the trigger_name */ diff --git a/tests/Unit/framework/IpFilterTest.php b/tests/Unit/framework/IpFilterTest.php new file mode 100644 index 000000000..13bb96318 --- /dev/null +++ b/tests/Unit/framework/IpFilterTest.php @@ -0,0 +1,77 @@ +assertTrue(Rhymix\Framework\IpFilter::inRange('10.0.127.191', '10.0.127.191')); + $this->assertFalse(Rhymix\Framework\IpFilter::inRange('10.1.131.177', '10.1.131.178')); + $this->assertTrue(Rhymix\Framework\IpFilter::inRange('127.0.0.1', '127.0.0.0/8')); + $this->assertFalse(Rhymix\Framework\IpFilter::inRange('172.34.0.0', '172.16.0.0/12')); + $this->assertTrue(Rhymix\Framework\IpFilter::inRange('192.168.18.214', '192.168.16.0/22')); + $this->assertFalse(Rhymix\Framework\IpFilter::inRange('192.168.18.214', '192.168.16.0/23')); + } + + public function testIPv6CIDR() + { + $this->assertTrue(Rhymix\Framework\IpFilter::inRange('::1', '::1/128')); + $this->assertFalse(Rhymix\Framework\IpFilter::inRange('::1', '::2')); + $this->assertTrue(Rhymix\Framework\IpFilter::inRange('2400:cb00::1234', '2400:cb00::/32')); + $this->assertFalse(Rhymix\Framework\IpFilter::inRange('2405:8100::1234', '2400:cb00::/32')); + } + + public function testIPv4Wildcard() + { + $this->assertTrue(Rhymix\Framework\IpFilter::inRange('192.168.134.241', '192.168.134.*')); + $this->assertTrue(Rhymix\Framework\IpFilter::inRange('192.168.134.241', '192.168.*.*')); + $this->assertFalse(Rhymix\Framework\IpFilter::inRange('192.168.134.241', '192.168.136.*')); + $this->assertFalse(Rhymix\Framework\IpFilter::inRange('192.168.134.241', '192.172.*.*')); + } + + public function testIPv4Hyphen() + { + $this->assertTrue(Rhymix\Framework\IpFilter::inRange('192.168.134.241', '192.168.134.0-192.168.134.255')); + $this->assertTrue(Rhymix\Framework\IpFilter::inRange('192.168.134.241', '192.168.128.16-192.168.145.0')); + $this->assertFalse(Rhymix\Framework\IpFilter::inRange('192.168.134.241', '192.168.134.242-192.168.244.7')); + $this->assertFalse(Rhymix\Framework\IpFilter::inRange('192.168.134.241', '192.168.100.255-192.168.133.19')); + } + + public function testValidator() + { + $this->assertTrue(Rhymix\Framework\IpFilter::validateRange('192.168.0.1')); + $this->assertTrue(Rhymix\Framework\IpFilter::validateRange('192.168.0.0/16')); + $this->assertTrue(Rhymix\Framework\IpFilter::validateRange('192.168.*.*')); + $this->assertTrue(Rhymix\Framework\IpFilter::validateRange('192.168.*')); + $this->assertTrue(Rhymix\Framework\IpFilter::validateRange('192.168.0.0-192.168.255.255')); + $this->assertTrue(Rhymix\Framework\IpFilter::validateRange('2400:cb00::/32')); + $this->assertFalse(Rhymix\Framework\IpFilter::validateRange('192.168.0.0~192.168.255.255')); + } + + public function testLegacy() + { + $this->assertTrue(\IpFilter::filter(array('192.168.134.241'), '192.168.134.241')); + $this->assertTrue(\IpFilter::filter(array('192.168.134.0-192.168.134.255'), '192.168.134.241')); + $this->assertTrue(\IpFilter::filter(array('127.0.0.1', '192.168.134.241'), '192.168.134.241')); + $this->assertTrue(\IpFilter::filter(array('192.168.134.*'), '192.168.134.241')); + $this->assertTrue(\IpFilter::filter(array('192.168.*'), '192.168.134.241')); + $this->assertFalse(\IpFilter::filter(array('127.0.0.1'), '192.168.134.241')); + } + + public function testCloudFlareRealIP() + { + $_SERVER['HTTP_CF_CONNECTING_IP'] = '192.168.134.241'; + + $_SERVER['REMOTE_ADDR'] = '192.168.10.1'; + $this->assertFalse(Rhymix\Framework\IpFilter::getCloudFlareRealIP()); + $this->assertEquals('192.168.10.1', $_SERVER['REMOTE_ADDR']); + + $_SERVER['REMOTE_ADDR'] = '108.162.192.121'; + $this->assertEquals('192.168.134.241', Rhymix\Framework\IpFilter::getCloudFlareRealIP()); + $this->assertEquals('192.168.134.241', $_SERVER['REMOTE_ADDR']); + + unset($_SERVER['HTTP_CF_CONNECTING_IP']); + $_SERVER['REMOTE_ADDR'] = '192.168.10.1'; + $this->assertFalse(Rhymix\Framework\IpFilter::getCloudFlareRealIP()); + $this->assertEquals('192.168.10.1', $_SERVER['REMOTE_ADDR']); + } +} diff --git a/tests/Unit/framework/LangTest.php b/tests/Unit/framework/LangTest.php new file mode 100644 index 000000000..d4059690b --- /dev/null +++ b/tests/Unit/framework/LangTest.php @@ -0,0 +1,34 @@ +assertTrue($ko instanceof Rhymix\Framework\Lang); + $this->assertTrue($en instanceof Rhymix\Framework\Lang); + $this->assertFalse($ko === $en); + + $ja = Rhymix\Framework\Lang::getInstance('ja'); + $jp = Rhymix\Framework\Lang::getInstance('jp'); + $this->assertTrue($ja === $jp); + + $this->assertEquals('도움말', $ko->get('common.help')); + $this->assertEquals('Help', $en->get('common.help')); + $this->assertEquals('도움말', $ko->help); + $this->assertEquals('Help', $en->help); + + $this->assertEquals('nonexistent', $ko->get('common.nonexistent')); + $this->assertEquals('nonexistent', $ko->get('common.nonexistent', 'foo', 'bar')); + + $this->assertEquals('help', $ja->help); + $ja->loadPlugin('common'); + $this->assertEquals('ヘルプ', $ja->help); + + $ko->foobartestlang = '%s님 안녕하세요?'; + $this->assertEquals('Travis님 안녕하세요?', $ko->foobartestlang('Travis')); + $en->foobartestlang = 'Hello, %s!'; + $this->assertEquals('Hello, Travis!', $en->get('foobartestlang', 'Travis')); + } +}