Merge pull request #10 from xpressengine/develop

Develop
This commit is contained in:
퍼니엑스이 2014-05-10 14:01:53 +09:00
commit 952f14fd24
25 changed files with 116 additions and 60 deletions

View file

@ -5,12 +5,10 @@ XpressEngine
[![License](http://img.shields.io/badge/license-GNU%20LGPL-brightgreen.svg)](http://www.gnu.org/licenses/gpl.html)
[![Latest release](http://img.shields.io/github/release/xpressengine/xe-core.svg)](https://github.com/xpressengine/xe-core/releases)
XpressEngine(XE)은 PHP로 작성한 CMS(Content Management System)입니다.
XpressEngine(XE)은 PHP로 작성한 설치형 CMS(Content Management System)입니다.
오픈소스 라이선스로 누구나 사용 또는 개작할 수 있으며, 개방형 프로젝트로서 누구나 개발에 참여할 수 있습니다.
## Supprot
## Support
* Official sitie (Korean) : http://www.xpressengine.com/
## Maintainers
@ -23,17 +21,18 @@ adrian.vasile.constantin, aerofleet, @akasima, @andreimarin, araste, @bnu, @bong
`CONTRIBUTING.md`파일을 참고하세요.
## License
Copyright (C) NAVER Corp. <http://www.navercorp.com>
Copyright 2014 NAVER Corp. <http://www.navercorp.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

View file

@ -30,6 +30,13 @@ if($_REQUEST['act'] != 'api')
// Read func file
require_once(_XE_PATH_ . 'addons/blogapi/blogapi.func.php');
// If HTTP_RAW_POST_DATA is NULL, Print error message
if(!$GLOBALS['HTTP_RAW_POST_DATA'])
{
$content = getXmlRpcFailure(1, 'Invalid Method Call');
printContent($content);
}
// xmlprc parsing
// Parse the requested xmlrpc
$xml = new SimpleXMLElement($GLOBALS['HTTP_RAW_POST_DATA']);
@ -487,7 +494,7 @@ if($called_position == 'before_module_proc')
$post = new stdClass();
$post->categories = array();
$post->dateCreated = date("Ymd", $oDocument->getRegdateTime()) . 'T' . date("H:i:s", $oDocument->getRegdateTime());
$post->description = htmlspecialchars($oEditorController->transComponent($oDocument->getContent(false, false, true, false)), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
$post->description = sprintf('<![CDATA[%s]]>',$oEditorController->transComponent($oDocument->getContent(false, false, true, false)));
$post->link = $post->permaLink = getFullUrl('', 'document_srl', $oDocument->document_srl);
$post->postid = $oDocument->document_srl;
$post->title = htmlspecialchars($oDocument->get('title'), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);

View file

@ -31,7 +31,11 @@ function getXmlRpcResponse($params)
// Encoding
function _getEncodedVal($val, $is_sub_set = false)
{
if(is_int($val))
if(preg_match('/^\<\!\[CDATA\[/',$val))
{
$buff = sprintf("<value>%s</value>", $val);
}
elseif(is_int($val))
{
$buff = sprintf("<value><i4>%d</i4></value>", $val);
}

View file

@ -12,8 +12,11 @@ if(!defined("__XE__")) exit();
if(!class_exists('AddonCaptcha', false))
{
// On the mobile mode, XE Core does not load jquery and xe.js as normal.
Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true);
Context::loadFile(array('./common/js/xe.min.js', 'head', NULL, -100000), true);
if(Mobile::isFromMobilePhone())
{
Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true);
Context::loadFile(array('./common/js/xe.min.js', 'head', NULL, -100000), true);
}
class AddonCaptcha
{

View file

@ -12,8 +12,11 @@ if(!defined("__XE__")) exit();
if(!class_exists('AddonMemberCaptcha', false))
{
// On the mobile mode, XE Core does not load jquery and xe.js as normal.
Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true);
Context::loadFile(array('./common/js/xe.min.js', 'head', NULL, -100000), true);
if(Mobile::isFromMobilePhone())
{
Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true);
Context::loadFile(array('./common/js/xe.min.js', 'head', NULL, -100000), true);
}
class AddonMemberCaptcha
{

View file

@ -205,6 +205,9 @@ class Context
$this->context->lang = &$GLOBALS['lang'];
$this->context->_COOKIE = $_COOKIE;
// 20140429 editor/image_link
$this->_checkGlobalVars();
$this->setRequestMethod('');
$this->_setXmlRpcArgument();
@ -1115,6 +1118,16 @@ class Context
($self->request_method = $_SERVER['REQUEST_METHOD']);
}
/**
* handle global arguments
*
* @return void
*/
function _checkGlobalVars()
{
$this->_recursiveCheckVar($_SERVER['HTTP_HOST']);
}
/**
* handle request areguments for GET/POST
*

2
common/js/x.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -751,7 +751,7 @@
.x [class^="x_icon-"],
.x [class*=" x_icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}
/* White icons with optional class, or on hover/active states of certain elements */
.x .x_icon-white,
#gnb.gnb.open .x_icon-white,
.x .x_nav-pills>.x_active>a>[class^="x_icon-"],
.x .x_nav-pills>.x_active>a>[class*=" x_icon-"],
.x .x_nav-list>.x_active>a>[class^="x_icon-"],
@ -1591,4 +1591,4 @@ to{background-position:0 0}
.x .x_hide{display:none}
.x .x_show{display:block}
.x .x_invisible{visibility:hidden}
.x .x_affix{position:fixed}
.x .x_affix{position:fixed}

File diff suppressed because one or more lines are too long

View file

@ -11,8 +11,8 @@
<condition operation="like" column="mid" var="s_mid" pipe="or" />
<condition operation="like" column="browser_title" var="s_browser_title" pipe="or" />
<condition operation="like" column="comment" var="s_comment" pipe="or" />
<condition operation="equal" column="module_category_srl" var="s_module_category_srl" pipe="or" />
</group>
<condition operation="equal" column="module_category_srl" var="s_module_category_srl" pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="module_srl" order="desc" />

View file

@ -89,8 +89,9 @@
<form action="" class="search x_input-append center" no-error-return-url="true">
<input loop="$param => $key, $val" cond="!in_array($key, array('mid', 'vid', 'act', 'page', 'search_target', 'search_keyword'))" type="hidden" name="{$key}" value="{$val}" />
<select cond="count($module_category)" name="module_category_srl" title="{$lang->module_category}" style="margin-right:4px">
<option value="" selected="selected"|cond="!$module_category_srl">{$lang->all}</option>
<option value="0" selected="selected"|cond="$module_category_srl==='0'">{$lang->not_exists}</option>
<option value="{$key}" loop="$module_category => $key,$val" selected="selected"|cond="$module_category==$key">{$val->title}</option>
<option value="{$key}" loop="$module_category => $key,$val" selected="selected"|cond="$module_category_srl==$key">{$val->title}</option>
</select>
<select name="search_target" title="{$lang->search_target}" style="margin-right:4px">
<option value="mid" selected="selected"|cond="$search_target=='mid'">{$lang->mid}</option>
@ -124,4 +125,4 @@ jQuery(function($){
}
});
});
</script>
</script>

View file

@ -472,7 +472,7 @@ class commentAdminController extends comment
$obj->module_srl = $originObject->module_srl;
$oCommentController = getController('comment');
$output = $oCommentController->insertComment($obj);
$output = $oCommentController->insertComment($obj, true);
return $output;
}

View file

@ -300,7 +300,7 @@ class commentController extends comment
{
$obj->comment_srl = getNextSequence();
}
elseif(!checkUserSequence($obj->comment_srl))
elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl))
{
return new Object(-1, 'msg_not_permitted');
}
@ -520,18 +520,22 @@ class commentController extends comment
$oMail->setSender($obj->email_address, $obj->email_address);
$mail_title = "[XE - " . Context::get('mid') . "] A new comment was posted on document: \"" . $oDocument->getTitleText() . "\"";
$oMail->setTitle($mail_title);
$url_comment = getFullUrl('','document_srl',$obj->document_srl).'#comment_'.$obj->comment_srl;
if($using_validation)
{
$url_approve = getFullUrl('', 'module', 'comment', 'act', 'procCommentAdminChangePublishedStatusChecked', 'cart[]', $obj->comment_srl, 'will_publish', '1', 'search_target', 'is_published', 'search_keyword', 'N');
$url_trash = getFullUrl('', 'module', 'comment', 'act', 'procCommentAdminDeleteChecked', 'cart[]', $obj->comment_srl, 'search_target', 'is_trash', 'search_keyword', 'true');
$url_approve = getFullUrl('', 'module', 'admin', 'act', 'procCommentAdminChangePublishedStatusChecked', 'cart[]', $obj->comment_srl, 'will_publish', '1', 'search_target', 'is_published', 'search_keyword', 'N');
$url_trash = getFullUrl('', 'module', 'admin', 'act', 'procCommentAdminDeleteChecked', 'cart[]', $obj->comment_srl, 'search_target', 'is_trash', 'search_keyword', 'true');
$mail_content = "
A new comment on the document \"" . $oDocument->getTitleText() . "\" is waiting for your approval.
<br />
<br />
Author: " . $member_info->nick_name . "
<br />Author e-mail: " . $member_info->email_address . "
<br />From : <a href=\"" . $url_comment . "\">" . $url_comment . "</a>
<br />Comment:
<br />\"" . $obj->content . "\"
<br />Document:
<br />\"" . $oDocument->getContentText(). "\"
<br />
<br />
Approve it: <a href=\"" . $url_approve . "\">" . $url_approve . "</a>
@ -546,8 +550,11 @@ class commentController extends comment
$mail_content = "
Author: " . $member_info->nick_name . "
<br />Author e-mail: " . $member_info->email_address . "
<br />From : <a href=\"" . $url_comment . "\">" . $url_comment . "</a>
<br />Comment:
<br />\"" . $obj->content . "\"
<br />Document:
<br />\"" . $oDocument->getContentText(). "\"
";
$oMail->setContent($mail_content);
@ -1100,7 +1107,17 @@ class commentController extends comment
$_SESSION['voted_comment'][$comment_srl] = TRUE;
// Return the result
return new Object(0, $success_message);
$output = new Object(0, $success_message);
if($point > 0)
{
$output->add('voted_count', $obj->after_point);
}
else
{
$output->add('blamed_count', $obj->after_point);
}
return $output;
}
/**

View file

@ -234,7 +234,7 @@ class documentController extends document
if(!$output->toBool()) return $output;
// Register it if no given document_srl exists
if(!$obj->document_srl) $obj->document_srl = getNextSequence();
elseif(!checkUserSequence($obj->document_srl)) return new Object(-1, 'msg_not_permitted');
elseif(!$manual_inserted && !$isRestore && !checkUserSequence($obj->document_srl)) return new Object(-1, 'msg_not_permitted');
$oDocumentModel = getModel('document');
// Set to 0 if the category_srl doesn't exist
@ -1143,14 +1143,19 @@ class documentController extends document
$_SESSION['voted_document'][$document_srl] = true;
// Return result
$output = new Object();
if($point > 0)
{
return new Object(0, 'success_voted');
$output->setMessage('success_voted');
$output->add('voted_count', $obj->after_point);
}
else
{
return new Object(0, 'success_blamed');
$output->setMessage('success_blamed');
$output->add('blamed_count', $obj->after_point);
}
return $output;
}
/**

View file

@ -24,8 +24,8 @@
var align = (node.style.cssFloat) ? node.style.cssFloat : node.style.styleFloat;
var margin = (node.style.margin) ? node.style.margin.match('[0-9]+') : node.getAttribute('margin');
var alt = node.getAttribute('alt');
var width = $(node).width();
var height = $(node).height();
var width = node.getAttribute('width');
var height = node.getAttribute('height');
var link_url = node.getAttribute('link_url');
var open_window = node.getAttribute('open_window');

View file

@ -422,7 +422,7 @@ function insertUploadedFile(editorSequence) {
temp_code = '';
temp_code += "<img src=\""+file.download_url+"\" alt=\""+file.source_filename+"\"";
if(obj.complete === true) { temp_code += " width=\""+obj.width+"\" height=\""+obj.height+"\""; }
temp_code += " />\r\n";
temp_code += " />\r\n<p><br /></p>\r\n";
text.push(temp_code);
} else {
// 이미지외의 경우는 multimedia_link 컴포넌트 연결

File diff suppressed because one or more lines are too long

View file

@ -335,8 +335,8 @@ class installAdminController extends install
list($width, $height, $type_no, $attrs) = @getimagesize($target_file);
if($iconname == 'favicon.ico')
{
if(!preg_match('/^.*(icon).*$/',$type)) {
Context::set('msg', '*.icon '.Context::getLang('msg_possible_only_file'));
if(!preg_match('/^.*\.ico$/i',$type)) {
Context::set('msg', '*.ico '.Context::getLang('msg_possible_only_file'));
return;
}
if($width && $height && ($width != '16' || $height != '16')) {
@ -346,7 +346,7 @@ class installAdminController extends install
}
else if($iconname == 'mobicon.png')
{
if(!preg_match('/^.*(png).*$/',$type)) {
if(!preg_match('/^.*\.png$/i',$type)) {
Context::set('msg', '*.png '.Context::getLang('msg_possible_only_file'));
return;
}

View file

@ -475,7 +475,7 @@ class memberAdminController extends member
}
else if($formInfo->name == 'password')
{
$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="6:20" /></field>';
$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:20" /></field>';
$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
}
else if($formInfo->name == 'find_account_question')

View file

@ -94,7 +94,7 @@ class memberAdminView extends member
}
}
$config = $this->memberConfig;
$memberIdentifiers = array('user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name');
$memberIdentifiers = array('email_address'=>'email_address', 'user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name');
$usedIdentifiers = array();
if(is_array($config->signupForm))

View file

@ -121,7 +121,7 @@
<!--@end-->
</select>
<select name="search_target" style="margin-right:4px" title="{$lang->search_target}">
{@$lang->search_target_list = array_merge($lang->search_target_list, $usedIdentifiers)}
{@$lang->search_target_list = array_merge($usedIdentifiers, $lang->search_target_list)}
<option value="{$key}" loop="$lang->search_target_list=>$key,$val" selected="selected"|cond="$search_target==$key">{$val}</option>
</select>
<input type="search" name="search_keyword" value="{htmlspecialchars($search_keyword, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}" style="width:140px">

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
<rule name="number_with_plus_minus" type="regex" test="/^(\+|-)?[1-9][0-9]*$/" />
<rule name="number_with_plus_minus" type="regex" test="/^(\+|-)?[0-9][0-9]*$/" />
</customrules>
<fields>
<field name="member_srl" required="true" rule="number" />

View file

@ -664,16 +664,20 @@ function doShowWidgetSizeSetup(px, py, obj) {
jQuery.each(opts, function(key, val){
var el = form[0].elements[key];
if (el)
{
el.value = val;
if(el.className.match(/\bcolor-indicator\b/))
{
el.style.background = el.value = '#'+el.value;
var $el = jQuery(el);
if(el) {
$el.val(val);
if($el.hasClass('color-indicator')) {
if(val != 'transparent') {
val = val.toUpperCase();
$el.css('background', '#' + val);
$el.val('#' + val);
}
}
}
if (el.tagName.toLowerCase() == "select")
{
if(el.tagName.toLowerCase() == "select") {
if(el.selectedIndex == -1) {
el.selectedIndex = 0;
}

File diff suppressed because one or more lines are too long

View file

@ -62,7 +62,7 @@
<option value="solid">{$lang->cmd_widget_border_solid}</option>
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
</select>
<input type="text" name="border_top_color" value="" class="color_input color-indicator" maxlength="6"/>
<input type="text" name="border_top_color" value="" class="color_input color-indicator" maxlength="7"/>
</td>
</tr>
<tr>
@ -72,7 +72,7 @@
<option value="solid">{$lang->cmd_widget_border_solid}</option>
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
</select>
<input type="text" name="border_left_color" value="" class="color_input color-indicator" maxlength="6"/>
<input type="text" name="border_left_color" value="" class="color_input color-indicator" maxlength="7"/>
</td>
<td style="text-align:right">
<input type="number" name="border_right_thick" value="" class="small_input" /> px
@ -80,7 +80,7 @@
<option value="solid">{$lang->cmd_widget_border_solid}</option>
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
</select>
<input type="text" name="border_right_color" value="" class="color_input color-indicator" maxlength="6"/>
<input type="text" name="border_right_color" value="" class="color_input color-indicator" maxlength="7"/>
</td>
</tr>
<tr>
@ -90,7 +90,7 @@
<option value="solid">{$lang->cmd_widget_border_solid}</option>
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
</select>
<input type="text" name="border_bottom_color" value="" class="color_input color-indicator" maxlength="6"/>
<input type="text" name="border_bottom_color" value="" class="color_input color-indicator" maxlength="7"/>
</td>
</tr>
<tr>
@ -126,7 +126,7 @@
<style scoped>
.wgs{margin:0;width:700px}
.wgs select{margin:0;width:auto}
.wgs input{margin:0!important;width:50px}
.wgs input{margin:0!important;width:60px}
</style>
</section>
<!--%load_js_plugin("ui.colorpicker")-->