From 932862be1f12662f7d6a1f822b1e95d44238403c Mon Sep 17 00:00:00 2001
From: bnu
Date: Fri, 22 Nov 2013 14:57:24 +0900
Subject: [PATCH] =?UTF-8?q?#64=20=EC=84=9C=EB=B2=84=20=EB=82=B4=20?=
=?UTF-8?q?=EA=B2=BD=EB=A1=9C=EB=A5=BC=20=EC=A0=88=EB=8C=80=EA=B2=BD?=
=?UTF-8?q?=EB=A1=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
addons/blogapi/blogapi.addon.php | 6 +-
addons/captcha/captcha.addon.php | 4 +-
.../captcha_member/captcha_member.addon.php | 4 +-
.../member_communication.addon.php | 6 +-
.../member_extra_info.lib.php | 7 +-
.../point_level_icon.addon.php | 2 +-
classes/context/Context.class.php | 3 +-
classes/display/DisplayHandler.class.php | 3 +-
classes/display/HTMLDisplayHandler.php | 4 +-
classes/file/FileHandler.class.php | 3 +-
classes/module/ModuleHandler.class.php | 12 +-
classes/module/ModuleObject.class.php | 4 +-
classes/security/EmbedFilter.class.php | 4 +-
classes/security/UploadFileFilter.class.php | 17 +-
classes/template/TemplateHandler.class.php | 3 +-
classes/validator/Validator.class.php | 2 +-
krzip.patch | 650 ++++++++++++++++++
modules/addon/addon.admin.model.php | 2 +-
modules/admin/admin.admin.controller.php | 5 +-
modules/admin/admin.admin.model.php | 12 +-
modules/autoinstall/autoinstall.class.php | 9 +-
modules/document/document.model.php | 5 +-
.../poll_maker/poll_maker.class.php | 2 +-
modules/editor/editor.model.php | 22 +-
.../importer/importer.admin.controller.php | 4 +-
modules/install/install.admin.controller.php | 2 +-
modules/install/install.controller.php | 5 +-
modules/install/script/ko.install.php | 2 +-
modules/layout/layout.admin.model.php | 4 +-
modules/layout/layout.admin.view.php | 3 +-
modules/layout/layout.model.php | 6 +-
modules/layout/layout.view.php | 24 +-
modules/menu/menu.admin.controller.php | 25 +-
modules/menu/menu.admin.model.php | 18 +-
modules/menu/menu.admin.view.php | 6 +-
modules/module/module.admin.controller.php | 2 +-
modules/module/module.admin.model.php | 8 +-
modules/module/module.admin.view.php | 2 +-
modules/module/module.model.php | 12 +-
modules/page/page.view.php | 18 +-
modules/poll/poll.controller.php | 4 +-
modules/widget/widget.model.php | 4 +-
42 files changed, 807 insertions(+), 133 deletions(-)
create mode 100644 krzip.patch
diff --git a/addons/blogapi/blogapi.addon.php b/addons/blogapi/blogapi.addon.php
index c6693207a..b06edfffb 100644
--- a/addons/blogapi/blogapi.addon.php
+++ b/addons/blogapi/blogapi.addon.php
@@ -28,7 +28,7 @@ if($_REQUEST['act'] != 'api')
}
// Read func file
-require_once('./addons/blogapi/blogapi.func.php');
+require_once(_XE_PATH_ . 'addons/blogapi/blogapi.func.php');
// xmlprc parsing
// Parse the requested xmlrpc
@@ -83,8 +83,8 @@ if($called_position == 'before_module_proc')
$category_list = $oDocumentModel->getCategoryList($this->module_srl);
// Specifies a temporary file storage
- $tmp_uploaded_path = sprintf('./files/cache/blogapi/%s/%s/', $this->mid, $user_id);
- $uploaded_target_path = sprintf('/files/cache/blogapi/%s/%s/', $this->mid, $user_id);
+ $tmp_uploaded_path = sprintf(_XE_PATH_ . 'files/cache/blogapi/%s/%s/', $this->mid, $user_id);
+ $uploaded_target_path = sprintf(_XE_PATH_ . 'files/cache/blogapi/%s/%s/', $this->mid, $user_id);
switch($method_name)
{
diff --git a/addons/captcha/captcha.addon.php b/addons/captcha/captcha.addon.php
index d99f1a385..bacf97d3c 100644
--- a/addons/captcha/captcha.addon.php
+++ b/addons/captcha/captcha.addon.php
@@ -64,7 +64,7 @@ if(!class_exists('AddonCaptcha'))
{
if(!$this->compareCaptcha())
{
- Context::loadLang('./addons/captcha/lang');
+ Context::loadLang(_XE_PATH_ . 'addons/captcha/lang');
$_SESSION['XE_VALIDATOR_ERROR'] = -1;
$_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied');
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
@@ -85,7 +85,7 @@ if(!class_exists('AddonCaptcha'))
// compare session when calling actions such as writing a post or a comment on the board/issue tracker module
if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $this->target_acts))
{
- Context::loadLang('./addons/captcha/lang');
+ Context::loadLang(_XE_PATH_ . 'addons/captcha/lang');
$ModuleHandler->error = "captcha_denied";
}
diff --git a/addons/captcha_member/captcha_member.addon.php b/addons/captcha_member/captcha_member.addon.php
index 125668196..ac1e57c5f 100644
--- a/addons/captcha_member/captcha_member.addon.php
+++ b/addons/captcha_member/captcha_member.addon.php
@@ -75,7 +75,7 @@ if(!class_exists('AddonMemberCaptcha'))
{
if(!$this->compareCaptcha())
{
- Context::loadLang('./addons/captcha_member/lang');
+ Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang');
$_SESSION['XE_VALIDATOR_ERROR'] = -1;
$_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied');
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
@@ -96,7 +96,7 @@ if(!class_exists('AddonMemberCaptcha'))
// compare session when calling actions such as writing a post or a comment on the board/issue tracker module
if(!$_SESSION['member_captcha_authed'] && in_array(Context::get('act'), $this->target_acts))
{
- Context::loadLang('./addons/captcha_member/lang');
+ Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang');
$ModuleHandler->error = "captcha_denied";
}
diff --git a/addons/member_communication/member_communication.addon.php b/addons/member_communication/member_communication.addon.php
index 4f8f24088..ae7a7beb8 100644
--- a/addons/member_communication/member_communication.addon.php
+++ b/addons/member_communication/member_communication.addon.php
@@ -26,20 +26,20 @@ if(!$logged_info)
if($called_position == 'before_module_init' && $this->module != 'member')
{
// Load a language file from the communication module
- Context::loadLang('./modules/communication/lang');
+ Context::loadLang(_XE_PATH_ . 'modules/communication/lang');
// Add menus on the member login information
$oMemberController = getController('member');
$oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend');
$oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
// Pop-up to display messages if a flag on new message is set
- $flag_path = './files/member_extra_info/new_message_flags/' . getNumberingPath($logged_info->member_srl);
+ $flag_path = _XE_PATH_ . 'files/member_extra_info/new_message_flags/' . getNumberingPath($logged_info->member_srl);
$flag_file = $flag_path . $logged_info->member_srl;
if(file_exists($flag_file) && $addon_info->use_alarm != 'N')
{
$new_message_count = trim(FileHandler::readFile($flag_file));
FileHandler::removeFile($flag_file);
- Context::loadLang('./addons/member_communication/lang');
+ Context::loadLang(_XE_PATH_ . 'addons/member_communication/lang');
Context::loadFile(array('./addons/member_communication/tpl/member_communication.js'), true);
$text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived')));
diff --git a/addons/member_extra_info/member_extra_info.lib.php b/addons/member_extra_info/member_extra_info.lib.php
index b6fc4e2ff..f0f759f75 100644
--- a/addons/member_extra_info/member_extra_info.lib.php
+++ b/addons/member_extra_info/member_extra_info.lib.php
@@ -28,7 +28,8 @@ function memberTransImageName($matches)
$_tmp->cached = true;
$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
- if(file_exists($image_name_file))
+
+ if(file_exists(_XE_PATH_ . $image_name_file))
{
$_tmp->image_name_file = $image_name_file;
}
@@ -36,7 +37,8 @@ function memberTransImageName($matches)
{
$image_name_file = '';
}
- if(file_exists($image_mark_file))
+
+ if(file_exists(_XE_PATH_ . $image_mark_file))
{
$_tmp->image_mark_file = $image_mark_file;
}
@@ -55,6 +57,7 @@ function memberTransImageName($matches)
$image_name_file = $_tmp->image_name_file;
$image_mark_file = $_tmp->image_mark_file;
}
+
// If image name and mark doesn't exist, set the original information
if(!$image_name_file && !$image_mark_file && !$group_image)
{
diff --git a/addons/point_level_icon/point_level_icon.addon.php b/addons/point_level_icon/point_level_icon.addon.php
index e091c6597..6c93ece0a 100644
--- a/addons/point_level_icon/point_level_icon.addon.php
+++ b/addons/point_level_icon/point_level_icon.addon.php
@@ -17,7 +17,7 @@ if($called_position != "before_display_content" || Context::getResponseMethod()
return;
}
-require_once('./addons/point_level_icon/point_level_icon.lib.php');
+require_once(_XE_PATH_ . 'addons/point_level_icon/point_level_icon.lib.php');
$temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'pointLevelIconTrans', $output);
if($temp_output)
diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php
index a5a8881be..14b1a22e4 100644
--- a/classes/context/Context.class.php
+++ b/classes/context/Context.class.php
@@ -694,12 +694,13 @@ class Context
function getFTPInfo()
{
is_a($this, 'Context') ? $self = $this : $self = self::getInstance();
+
if(!$self->isFTPRegisted())
{
return null;
}
- @include($self->getFTPConfigFile());
+ include($self->getFTPConfigFile());
return $ftp_info;
}
diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php
index 973cbdf5b..5a319d9cb 100644
--- a/classes/display/DisplayHandler.class.php
+++ b/classes/display/DisplayHandler.class.php
@@ -76,12 +76,13 @@ class DisplayHandler extends Handler
$called_position = 'before_display_content';
$oAddonController = &getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
- @include($addon_file);
+ if(file_exists($addon_file)) include($addon_file);
if(method_exists($handler, "prepareToPrint"))
{
$handler->prepareToPrint($output);
}
+
// header output
if($this->gz_enabled)
{
diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php
index e0c3a8948..56500c552 100644
--- a/classes/display/HTMLDisplayHandler.php
+++ b/classes/display/HTMLDisplayHandler.php
@@ -100,7 +100,7 @@ class HTMLDisplayHandler
// search if the changes CSS exists in the admin layout edit window
$edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl);
- if(file_exists($edited_layout_css))
+ if(FileHandler::exists($edited_layout_css))
{
Context::loadFile(array($edited_layout_css, 'all', '', 100));
}
@@ -278,7 +278,7 @@ class HTMLDisplayHandler
case 'number':
case 'range':
case 'color':
- $str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . @htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"';
+ $str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"';
break;
case 'password':
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str);
diff --git a/classes/file/FileHandler.class.php b/classes/file/FileHandler.class.php
index 04c9cb68e..3a5c35fa0 100644
--- a/classes/file/FileHandler.class.php
+++ b/classes/file/FileHandler.class.php
@@ -17,10 +17,11 @@ class FileHandler
*/
function getRealPath($source)
{
- if(substr_compare($source, './', 0, 2) === 0)
+ if(strlen($source) > 2 && substr_compare($source, './', 0, 2) === 0)
{
return _XE_PATH_ . substr($source, 2);
}
+
return $source;
}
diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php
index cb708cfb2..4454b28cf 100644
--- a/classes/module/ModuleHandler.class.php
+++ b/classes/module/ModuleHandler.class.php
@@ -93,7 +93,7 @@ class ModuleHandler extends Handler
$called_position = 'before_module_init';
$oAddonController = getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? 'mobile' : 'pc');
- @include($addon_file);
+ if(file_exists($addon_file)) include($addon_file);
}
/**
@@ -878,9 +878,9 @@ class ModuleHandler extends Handler
$oMenuAdminController = getAdminController('menu');
$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
- if(file_exists($homeMenuCacheFile))
+ if(FileHandler::exists($homeMenuCacheFile))
{
- @include($homeMenuCacheFile);
+ include($homeMenuCacheFile);
}
if(!$menu->menu_srl)
@@ -895,9 +895,11 @@ class ModuleHandler extends Handler
$menu->php_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->php_file);
}
}
- if(file_exists($menu->php_file))
+
+ $php_file = FileHandler::exists($menu->php_file);
+ if($php_file)
{
- @include($menu->php_file);
+ include($php_file);
}
Context::set($menu_id, $menu);
}
diff --git a/classes/module/ModuleObject.class.php b/classes/module/ModuleObject.class.php
index ae2d0d55c..1c89decc8 100644
--- a/classes/module/ModuleObject.class.php
+++ b/classes/module/ModuleObject.class.php
@@ -391,7 +391,7 @@ class ModuleObject extends Object
$called_position = 'before_module_proc';
$oAddonController = getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
- @include($addon_file);
+ if(FileHandler::exists($addon_file)) include($addon_file);
if(isset($this->xml_info->action->{$this->act}) && method_exists($this, $this->act))
{
@@ -450,7 +450,7 @@ class ModuleObject extends Object
$called_position = 'after_module_proc';
$oAddonController = getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
- @include($addon_file);
+ if(FileHandler::exists($addon_file)) include($addon_file);
if(is_a($output, 'Object') || is_subclass_of($output, 'Object'))
{
diff --git a/classes/security/EmbedFilter.class.php b/classes/security/EmbedFilter.class.php
index 11afe6cf9..5677c58c8 100644
--- a/classes/security/EmbedFilter.class.php
+++ b/classes/security/EmbedFilter.class.php
@@ -17,8 +17,8 @@ class EmbedFilter
* @var int
*/
var $allowscriptaccessKey = 0;
- var $whiteUrlXmlFile = './classes/security/conf/embedWhiteUrl.xml';
- var $whiteUrlCacheFile = './files/cache/embedfilter/embedWhiteUrl.php';
+ var $whiteUrlXmlFile = _XE_PATH_ . 'classes/security/conf/embedWhiteUrl.xml';
+ var $whiteUrlCacheFile = _XE_PATH_ . 'files/cache/embedfilter/embedWhiteUrl.php';
var $whiteUrlList = array();
var $whiteIframeUrlList = array();
var $parser = NULL;
diff --git a/classes/security/UploadFileFilter.class.php b/classes/security/UploadFileFilter.class.php
index 445043931..56cfdb9bf 100644
--- a/classes/security/UploadFileFilter.class.php
+++ b/classes/security/UploadFileFilter.class.php
@@ -3,24 +3,23 @@
class UploadFileFilter
{
-
private static $_block_list = array ('exec', 'system', 'passthru', 'show_source', 'phpinfo', 'fopen', 'file_get_contents', 'file_put_contents', 'fwrite', 'proc_open', 'popen');
-
+
public function check($file)
{
// TODO: 기능개선후 enable
-
+
return TRUE; // disable
- if (! $file || ! file_exists ( $file )) return TRUE;
+ if (! $file || ! FileHandler::exists($file)) return TRUE;
return self::_check ( $file );
}
-
+
private function _check($file)
{
if (! ($fp = fopen ( $file, 'r' ))) return FALSE;
-
+
$has_php_tag = FALSE;
-
+
while ( ! feof ( $fp ) )
{
$content = fread ( $fp, 8192 );
@@ -34,9 +33,9 @@ class UploadFileFilter
}
}
}
-
+
fclose ( $fp );
-
+
return TRUE;
}
}
diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php
index 706008492..ee9370891 100644
--- a/classes/template/TemplateHandler.class.php
+++ b/classes/template/TemplateHandler.class.php
@@ -12,7 +12,7 @@
class TemplateHandler
{
- private $compiled_path = './files/cache/template_compiled/'; ///< path of compiled caches files
+ private $compiled_path = 'files/cache/template_compiled/'; ///< path of compiled caches files
private $path = NULL; ///< target directory
private $filename = NULL; ///< target filename
private $file = NULL; ///< target file (fullpath)
@@ -30,6 +30,7 @@ class TemplateHandler
public function __construct()
{
$this->xe_path = rtrim(preg_replace('/([^\.^\/]+)\.php$/i', '', $_SERVER['SCRIPT_NAME']), '/');
+ $this->compiled_path = _XE_PATH_ . $this->compiled_path;
}
/**
diff --git a/classes/validator/Validator.class.php b/classes/validator/Validator.class.php
index 54aa68e08..11762da50 100644
--- a/classes/validator/Validator.class.php
+++ b/classes/validator/Validator.class.php
@@ -95,7 +95,7 @@ class Validator
));
$this->_has_mb_func = is_callable('mb_strlen');
- $this->setCacheDir('./files/cache');
+ $this->setCacheDir(_XE_PATH_ . 'files/cache');
}
/**
diff --git a/krzip.patch b/krzip.patch
new file mode 100644
index 000000000..43b98456a
--- /dev/null
+++ b/krzip.patch
@@ -0,0 +1,650 @@
+diff --git a/common/lang/lang.xml b/common/lang/lang.xml
+index 6bba46e..fdad62d 100644
+--- a/common/lang/lang.xml
++++ b/common/lang/lang.xml
+@@ -3272,6 +3272,10 @@
+
+
+
++ -
++
++
++
+ -
+
+
+diff --git a/modules/comment/comment.model.php b/modules/comment/comment.model.php
+index 095085a..21c26e2 100644
+--- a/modules/comment/comment.model.php
++++ b/modules/comment/comment.model.php
+@@ -1054,6 +1054,46 @@ class commentModel extends comment
+ }
+ }
+
++ /**
++ * Get the total number of comments in corresponding with member_srl.
++ * @param int $member_srl
++ * @return int
++ */
++ function getCommentCountByMemberSrl($member_srl)
++ {
++ $args = new stdClass();
++ $args->member_srl = $member_srl;
++ $output = executeQuery('comment.getCommentCountByMemberSrl', $args);
++ $total_count = $output->data->count;
++
++ return (int) $total_count;
++ }
++
++
++ /**
++ * Get comment list of the doc in corresponding woth member_srl.
++ * @param int $member_srl
++ * @param array $columnList
++ * @param int $page
++ * @param bool $is_admin
++ * @param int $count
++ * @return object
++ */
++ function getCommentListByMemberSrl($member_srl, $columnList = array(), $page = 0, $is_admin = FALSE, $count = 0)
++ {
++ $args = new stdClass();
++ $args->member_srl = $member_srl;
++ $args->list_count = $count;
++ $output = executeQuery('comment.getCommentListByMemberSrl', $args, $columnList);
++ $comment_list = $output->data;
++
++ if(!$comment_list) return;
++ if(!is_array($comment_list)) $comment_list = array($comment_list);
++
++ return $comment_list;
++
++ }
++
+ }
+ /* End of file comment.model.php */
+ /* Location: ./modules/comment/comment.model.php */
+diff --git a/modules/comment/queries/getCommentCountByMemberSrl.xml b/modules/comment/queries/getCommentCountByMemberSrl.xml
+new file mode 100644
+index 0000000..f81db46
+--- /dev/null
++++ b/modules/comment/queries/getCommentCountByMemberSrl.xml
+@@ -0,0 +1,11 @@
++
+diff --git a/modules/comment/queries/getCommentListByMemberSrl.xml b/modules/comment/queries/getCommentListByMemberSrl.xml
+new file mode 100644
+index 0000000..6d8c680
+--- /dev/null
++++ b/modules/comment/queries/getCommentListByMemberSrl.xml
+@@ -0,0 +1,19 @@
++
+diff --git a/modules/document/document.model.php b/modules/document/document.model.php
+index 94840fc..b8938eb 100644
+--- a/modules/document/document.model.php
++++ b/modules/document/document.model.php
+@@ -1490,6 +1490,44 @@ class documentModel extends document
+ }
+ }
+ }
++
++ /**
++ * Get the total number of Document in corresponding with member_srl.
++ * @param int $member_srl
++ * @return int
++ */
++ function getDocumentCountByMemberSrl($member_srl)
++ {
++ $args = new stdClass();
++ $args->member_srl = $member_srl;
++ $output = executeQuery('document.getDocumentCountByMemberSrl', $args);
++ $total_count = $output->data->count;
++
++ return (int) $total_count;
++ }
++
++ /**
++ * Get document list of the doc in corresponding woth member_srl.
++ * @param int $member_srl
++ * @param array $columnList
++ * @param int $page
++ * @param bool $is_admin
++ * @param int $count
++ * @return object
++ */
++ function getDocumentListByMemberSrl($member_srl, $columnList = array(), $page = 0, $is_admin = FALSE, $count = 0 )
++ {
++ $args = new stdClass();
++ $args->member_srl = $member_srl;
++ $args->list_count = $count;
++ $output = executeQuery('document.getDocumentListByMemberSrl', $args, $columnList);
++ $document_list = $output->data;
++
++ if(!$document_list) return;
++ if(!is_array($document_list)) $document_list = array($document_list);
++
++ return $document_list;
++ }
+ }
+ /* End of file document.model.php */
+ /* Location: ./modules/document/document.model.php */
+diff --git a/modules/document/document.view.php b/modules/document/document.view.php
+index 788708b..497050d 100644
+--- a/modules/document/document.view.php
++++ b/modules/document/document.view.php
+@@ -176,6 +176,7 @@ class documentView extends document
+ $this->setTemplatePath($this->module_path.'tpl');
+ $this->setTemplateFile('saved_list_popup');
+ }
++
+ }
+ /* End of file document.view.php */
+ /* Location: ./modules/document/document.view.php */
+diff --git a/modules/document/queries/getDocumentCountByMemberSrl.xml b/modules/document/queries/getDocumentCountByMemberSrl.xml
+new file mode 100644
+index 0000000..ed457fb
+--- /dev/null
++++ b/modules/document/queries/getDocumentCountByMemberSrl.xml
+@@ -0,0 +1,11 @@
++
++
++
++
++
++
++
++
++
++
++
+diff --git a/modules/document/queries/getDocumentListByMemberSrl.xml b/modules/document/queries/getDocumentListByMemberSrl.xml
+new file mode 100644
+index 0000000..49e8035
+--- /dev/null
++++ b/modules/document/queries/getDocumentListByMemberSrl.xml
+@@ -0,0 +1,17 @@
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
+diff --git a/modules/member/conf/module.xml b/modules/member/conf/module.xml
+index 5cbe433..a2f7f2b 100644
+--- a/modules/member/conf/module.xml
++++ b/modules/member/conf/module.xml
+@@ -20,6 +20,7 @@
+
+
+
++
+
+
+
+@@ -68,6 +69,7 @@
+
+
+
++
+
+
+
+diff --git a/modules/member/lang/lang.xml b/modules/member/lang/lang.xml
+index 0a9eced..d5524e7 100644
+--- a/modules/member/lang/lang.xml
++++ b/modules/member/lang/lang.xml
+@@ -2619,5 +2619,16 @@
+
+
+
+-
++ -
++
++
++
++ -
++ 스팸 작성자 차단/삭제 및 회원이 남긴 글과 댓글을 모두 휴지통 이동 또는 삭제 합니다. 이 처리는 회원이 작성한 게시물의 양에 따라 오래걸릴 수 있습니다.
]]>
++ Spam user management. This function remove all of documents, comments]]>
++
++ -
++
++
++
+
+diff --git a/modules/member/member.class.php b/modules/member/member.class.php
+index e7bde82..86f7059 100644
+--- a/modules/member/member.class.php
++++ b/modules/member/member.class.php
+@@ -144,6 +144,9 @@ class member extends ModuleObject {
+ FileHandler::makeDir('./files/member_extra_info/profile_image');
+ FileHandler::makeDir('./files/member_extra_info/signature');
+
++ // 2013. 11. 22 add menu when popup document menu called
++ $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
++
+ return new Object();
+ }
+
+@@ -208,6 +211,9 @@ class member extends ModuleObject {
+ if(!is_readable('./files/ruleset/login.xml')) return true;
+ if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true;
+
++ // 2013. 11. 22 add menu when popup document menu called
++ if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true;
++
+ return false;
+ }
+
+@@ -345,6 +351,10 @@ class member extends ModuleObject {
+ if(!is_readable('./files/ruleset/find_member_account_by_question.xml'))
+ $oMemberAdminController->_createFindAccountByQuestion($config->identifier);
+
++ // 2013. 11. 22 add menu when popup document menu called
++ if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'))
++ $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
++
+ return new Object(0, 'success_updated');
+ }
+
+diff --git a/modules/member/member.controller.php b/modules/member/member.controller.php
+index 6a4d769..af0331c 100644
+--- a/modules/member/member.controller.php
++++ b/modules/member/member.controller.php
+@@ -2354,6 +2354,186 @@ class memberController extends member
+ $this->setTemplatePath($this->module_path.'tpl');
+ $this->setTemplateFile('msg_success_modify_email_address');
+ }
++
++ /**
++ * trigger for document.getDocumentMenu. Append to popup menu a button for procMemberSpammerManage()
++ *
++ * @param array &$menu_list
++ *
++ * @return object
++ **/
++ function triggerGetDocumentMenu(&$menu_list)
++ {
++ $is_logged = Context::get('is_logged');
++ $logged_info = Context::get('logged_info');
++
++
++ $document_srl = Context::get('target_srl');
++
++ $oDocumentModel = &getModel('document');
++ $columnList = array('document_srl', 'module_srl', 'member_srl', 'ipaddress');
++ $oDocument = $oDocumentModel->getDocument($document_srl, false, false, $columnList);
++ $member_srl = $oDocument->get('member_srl');
++ $module_srl = $oDocument->get('module_srl');
++
++ if(!$member_srl) return new Object();
++ if(!$is_logged) return new Object();
++ if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
++
++ $oDocumentController = &getController('document');
++ $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
++ $oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
++
++ return new Object();
++ }
++
++ /**
++ * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
++ *
++ * @return object
++ **/
++ function procMemberSpammerManage()
++ {
++ $logged_info = Context::get('logged_info');
++ $member_srl = Context::get('member_srl');
++ $module_srl = Context::get('module_srl');
++ $cnt_loop = Context::get('cnt_loop');
++ $proc_type = Context::get('proc_type');
++ $isMoveToTrash = true;
++ if($proc_type == "delete")
++ $isMoveToTrash = false;
++
++ // check grant
++ $oModuleModel = &getModel('module');
++ $columnList = array('module_srl', 'module');
++ $args = new stdClass();
++ $args->module_srl = $module_srl;
++ $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl, $columnList);
++ $grant = $oModuleModel->getGrant($module_info, $logged_info);
++
++ if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
++ if(!$grant->manager) return new Object(-1,'msg_not_permitted');
++
++ $proc_msg = "";
++
++ $oDocumentController = &getController('document');
++ $oDocumentModel = &getModel('document');
++ $oCommentController = &getController('comment');
++ $oCommentModel = &getModel('comment');
++
++ // delete or trash destination
++ // proc member
++ if($cnt_loop == 1)
++ {
++ $this->_spammerMember($member_srl);
++ }
++ // proc document and comment
++ elseif($cnt_loop>1)
++ {
++ $this->_spammerDocuments($member_srl, $isMoveToTrash);
++ }
++
++ // get destination count
++ $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
++ $cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
++
++ $total_count = Context::get('total_count');
++ $remain_count = $cnt_document + $cnt_comment;
++ if($cnt_loop == 1) {
++ $total_count = $remain_count;
++ }
++
++ // get progress percent
++ if( $total_count > 0 )
++ $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
++ else
++ $progress = 100;
++
++ $this->add('total_count', $total_count);
++ $this->add('remain_count', $remain_count);
++ $this->add('progress', $progress);
++ $this->add('member_srl', $member_srl);
++ $this->add('module_srl', $module_srl);
++ $this->add('cnt_loop', ++$cnt_loop);
++ $this->add('proc_type', $proc_type);
++
++ $this->add( "retdata", $arrJson);
++ return new Object(0);
++ }
++
++ /**
++ * Denied user login and write description
++ *
++ * @param int $member_srl
++ *
++ * @return bool
++ **/
++ private function _spammerMember($member_srl) {
++ $logged_info = Context::get('logged_info');
++ $spam_description = Context::get('spam_description');
++
++ $oMemberModel = &getModel('member');
++ $columnList = array();
++ // get member current infomation
++ $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
++ // set change infomations
++ $member_info->denied = "Y";
++
++ if( $member_info->description != "" ) $member_info->description .= "\n"; // add new line
++ $member_info->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . "]";
++
++ $oMemberController = &getController('member');
++ $output = executeQuery('member.updateMember', $member_info);
++ $proc_msg .= "member info updated\t";
++
++ return true;
++ }
++
++ /**
++ * Delete or trash all documents
++ *
++ * @param int $member_srl
++ * @param bool $isMoveToTrash
++ *
++ * @return bool
++ **/
++ private function _spammerDocuments($member_srl, $isMoveToTrash) {
++
++ $logged_info = Context::get('logged_info');
++
++ $oDocumentController = &getController('document');
++ $oDocumentModel = &getModel('document');
++ $oCommentController = &getController('comment');
++ $oCommentModel = &getModel('comment');
++
++ // delete count by one request
++ $getContentsCount = 10;
++
++ // 1. proc comment, 2. proc document
++ $cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
++ $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
++ if($cnt_comment > 0)
++ {
++ $columnList = array();
++ $commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
++ if($commentList) {
++ foreach($commentList as $v) {
++ $oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
++ }
++ }
++ } elseif($cnt_document > 0) {
++ $columnList = array();
++ $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
++ if($documentList) {
++ foreach($documentList as $v) {
++ if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
++ else $oDocumentController->deleteDocument($v->document_srl);
++ }
++ }
++ }
++
++ return true;
++ }
+ }
+ /* End of file member.controller.php */
+ /* Location: ./modules/member/member.controller.php */
+diff --git a/modules/member/member.view.php b/modules/member/member.view.php
+index 380cecf..31c49a7 100644
+--- a/modules/member/member.view.php
++++ b/modules/member/member.view.php
+@@ -611,6 +611,43 @@ class memberView extends member
+
+ Context::addHtmlHeader($js_code);
+ }
++
++ /**
++ * Spammer manage popup
++ *
++ * @return void
++ **/
++ function dispMemberSpammer()
++ {
++ $member_srl = Context::get('member_srl');
++ $module_srl = Context::get('module_srl');
++
++ // check grant
++ $oModuleModel = &getModel('module');
++ $columnList = array('module_srl', 'module');
++ $args = new stdClass();
++ $args->module_srl = $module_srl;
++ $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl, $columnList);
++ $grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
++
++ if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
++ if(!$grant->manager) return new Object(-1,'msg_not_permitted');
++
++ $oMemberModel = &getModel('member');
++ $spammer_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
++
++ Context::loadLang('modules/document/lang/');
++ Context::set('spammer_info',$spammer_info);
++ Context::set('module_srl',$module_srl);
++
++ // Select Pop-up layout
++ $this->setLayoutPath('./common/tpl');
++ $this->setLayoutFile('popup_layout');
++
++ $this->setTemplatePath($this->module_path.'tpl');
++ $this->setTemplateFile('spammer');
++ }
++
+ }
+ /* End of file member.view.php */
+ /* Location: ./modules/member/member.view.php */
+diff --git a/modules/member/skins/default/js/member.js b/modules/member/skins/default/js/member.js
+index 9422cfd..41c8e72 100644
+--- a/modules/member/skins/default/js/member.js
++++ b/modules/member/skins/default/js/member.js
+@@ -160,3 +160,4 @@ function doDeleteSavedDocument(document_srl, confirm_message) {
+ function insertSelectedModule(id, module_srl, mid, browser_title) {
+ location.href = current_url.setQuery('selected_module_srl',module_srl);
+ }
++
+diff --git a/modules/member/tpl/spammer.html b/modules/member/tpl/spammer.html
+new file mode 100644
+index 0000000..d371f0f
+--- /dev/null
++++ b/modules/member/tpl/spammer.html
+@@ -0,0 +1,110 @@
++
++
++
++
++
++
++
diff --git a/modules/addon/addon.admin.model.php b/modules/addon/addon.admin.model.php
index 3afb79f37..dda143681 100644
--- a/modules/addon/addon.admin.model.php
+++ b/modules/addon/addon.admin.model.php
@@ -26,7 +26,7 @@ class addonAdminModel extends addon
*/
function getAddonPath($addon_name)
{
- $class_path = sprintf('./addons/%s/', $addon_name);
+ $class_path = sprintf(_XE_PATH_ . 'addons/%s/', $addon_name);
if(is_dir($class_path))
{
return $class_path;
diff --git a/modules/admin/admin.admin.controller.php b/modules/admin/admin.admin.controller.php
index b86fdc985..8fb817201 100644
--- a/modules/admin/admin.admin.controller.php
+++ b/modules/admin/admin.admin.controller.php
@@ -173,7 +173,7 @@ class adminAdminController extends admin
$buff = '';
if(is_readable($siteDesignFile))
{
- @include($siteDesignFile);
+ include($siteDesignFile);
}
else
{
@@ -294,8 +294,7 @@ class adminAdminController extends admin
{
if($favorite->type == 'module')
{
- $modulePath = './modules/' . $favorite->module;
- $modulePath = FileHandler::getRealPath($modulePath);
+ $modulePath = _XE_PATH_ . 'modules/' . $favorite->module;
if(!is_dir($modulePath))
{
$deleteTargets[] = $favorite->admin_favorite_srl;
diff --git a/modules/admin/admin.admin.model.php b/modules/admin/admin.admin.model.php
index b10d5480b..f1513f25a 100644
--- a/modules/admin/admin.admin.model.php
+++ b/modules/admin/admin.admin.model.php
@@ -100,7 +100,7 @@ class adminAdminModel extends admin
*/
function getAdminFTPPath()
{
- Context::loadLang('./modules/autoinstall/lang');
+ Context::loadLang(_XE_PATH_ . 'modules/autoinstall/lang');
@set_time_limit(5);
require_once(_XE_PATH_ . 'libs/ftp.class.php');
@@ -236,9 +236,11 @@ class adminAdminModel extends admin
*/
function getAdminFTPList()
{
- Context::loadLang('./modules/autoinstall/lang');
+ Context::loadLang(_XE_PATH_ . 'modules/autoinstall/lang');
@set_time_limit(5);
+
require_once(_XE_PATH_ . 'libs/ftp.class.php');
+
$ftp_info = Context::getRequestVars();
if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
{
@@ -435,7 +437,7 @@ class adminAdminModel extends admin
$theme_info->name = $theme_name;
$theme_info->title = $xml_obj->title->body;
$thumbnail = './themes/' . $theme_name . '/thumbnail.png';
- $theme_info->thumbnail = (file_exists($thumbnail)) ? $thumbnail : NULL;
+ $theme_info->thumbnail = (FileHandler::exists($thumbnail)) ? $thumbnail : NULL;
$theme_info->version = $xml_obj->version->body;
$date_obj = new stdClass();
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
@@ -595,7 +597,7 @@ class adminAdminModel extends admin
$oModuleModel = getModel('module');
foreach($searched_list as $val)
{
- $skin_list = $oModuleModel->getSkins('./modules/' . $val);
+ $skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/' . $val);
if(is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule))
{
@@ -770,7 +772,7 @@ class adminAdminModel extends admin
foreach($list as $k => $v)
{
- if(!is_dir('./modules/' . $v->module))
+ if(!is_dir(_XE_PATH_ . 'modules/' . $v->module))
{
unset($list[$k]);
}
diff --git a/modules/autoinstall/autoinstall.class.php b/modules/autoinstall/autoinstall.class.php
index d3294a509..70f0b5c60 100644
--- a/modules/autoinstall/autoinstall.class.php
+++ b/modules/autoinstall/autoinstall.class.php
@@ -103,12 +103,11 @@ class autoinstall extends ModuleObject
$oDB = DB::getInstance();
$oModuleModel = getModel('module');
- if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_installed_packages.xml"))
- && $oDB->isTableExists("autoinstall_installed_packages"))
+ if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml') && $oDB->isTableExists("autoinstall_installed_packages"))
{
return TRUE;
}
- if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_remote_categories.xml"))
+ if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml')
&& $oDB->isTableExists("autoinstall_remote_categories"))
{
return TRUE;
@@ -147,12 +146,12 @@ class autoinstall extends ModuleObject
$oModuleModel = getModel('module');
$oModuleController = getController('module');
- if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_installed_packages.xml"))
+ if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml')
&& $oDB->isTableExists("autoinstall_installed_packages"))
{
$oDB->dropTable("autoinstall_installed_packages");
}
- if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_remote_categories.xml"))
+ if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml')
&& $oDB->isTableExists("autoinstall_remote_categories"))
{
$oDB->dropTable("autoinstall_remote_categories");
diff --git a/modules/document/document.model.php b/modules/document/document.model.php
index 94840fca6..03fe68923 100644
--- a/modules/document/document.model.php
+++ b/modules/document/document.model.php
@@ -698,7 +698,7 @@ class documentModel extends document
function getCategoryList($module_srl, $columnList = array())
{
// Category of the target module file swollen
- $filename = sprintf("./files/cache/document_category/%s.php", $module_srl);
+ $filename = sprintf("%sfiles/cache/document_category/%s.php", _XE_PATH_, $module_srl);
// If the target file to the cache file regeneration category
if(!file_exists($filename))
{
@@ -706,7 +706,8 @@ class documentModel extends document
if(!$oDocumentController->makeCategoryFile($module_srl)) return array();
}
- @include($filename);
+ include($filename);
+
// Cleanup of category
$document_category = array();
$this->_arrangeCategory($document_category, $menu->list, 0);
diff --git a/modules/editor/components/poll_maker/poll_maker.class.php b/modules/editor/components/poll_maker/poll_maker.class.php
index 1ff5a8571..21af7fde6 100644
--- a/modules/editor/components/poll_maker/poll_maker.class.php
+++ b/modules/editor/components/poll_maker/poll_maker.class.php
@@ -27,7 +27,7 @@ class poll_maker extends EditorHandler
{
// Wanted Skins survey
$oModuleModel = &getModel('module');
- $skin_list = $oModuleModel->getSkins("./modules/poll/");
+ $skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/poll/');
Context::set('skin_list', $skin_list);
// Pre-compiled source code to compile template return to
$tpl_path = $this->component_path.'tpl';
diff --git a/modules/editor/editor.model.php b/modules/editor/editor.model.php
index acfe070d9..61ce397f1 100644
--- a/modules/editor/editor.model.php
+++ b/modules/editor/editor.model.php
@@ -3,7 +3,7 @@
/**
* @class editorModel
* @author NAVER (developers@xpressengine.com)
- * @brief model class of the editor odule
+ * @brief model class of the editor odule
*/
class editorModel extends editor
{
@@ -15,7 +15,7 @@ class editorModel extends editor
* That means there is a limitation that more than 30 editors cannot be displayed on a single page.
*
* However, editor_sequence can be value from getNextSequence() in case of the modified or the auto-saved for file upload
- *
+ *
*/
/**
@@ -29,7 +29,7 @@ class editorModel extends editor
$oModuleModel = &getModel('module');
$GLOBALS['__editor_module_config__'][$module_srl] = $oModuleModel->getModulePartConfig('editor', $module_srl);
}
- $editor_config = $GLOBALS['__editor_module_config__'][$module_srl];
+ $editor_config = $GLOBALS['__editor_module_config__'][$module_srl];
$oModuleModel = &getModel('module');
$editor_default_config = $oModuleModel->getModuleConfig('editor');
@@ -64,7 +64,7 @@ class editorModel extends editor
function loadDrComponents()
{
- $drComponentPath = './modules/editor/skins/dreditor/drcomponents/';
+ $drComponentPath = _XE_PATH_ . 'modules/editor/skins/dreditor/drcomponents/';
$drComponentList = FileHandler::readDir($drComponentPath);
$oTemplate = &TemplateHandler::getInstance();
@@ -76,7 +76,7 @@ class editorModel extends editor
{
unset($obj);
$obj = $this->getDrComponentXmlInfo($drComponent);
- Context::loadLang(sprintf('%s%s/lang/',$drComponentPath,$drComponent));
+ Context::loadLang(sprintf('%s%s/lang/',$drComponentPath,$drComponent));
$path = sprintf('%s%s/tpl/',$drComponentPath,$drComponent);
$obj->html = $oTemplate->compile($path,$drComponent);
$drComponentInfo[$drComponent] = $obj;
@@ -250,7 +250,7 @@ class editorModel extends editor
if($skin=='dreditor')
{
- $this->loadDrComponents();
+ $this->loadDrComponents();
}
/**
@@ -371,7 +371,7 @@ class editorModel extends editor
$editor_config = $this->getEditorConfig($module_srl);
$config = new stdClass();
-
+
// Configurations listed according to a type
if($type == 'document')
{
@@ -602,7 +602,7 @@ class editorModel extends editor
if(!file_exists($cache_file)) return;
@include($cache_file);
$logged_info = Context::get('logged_info');
- if($logged_info && is_array($logged_info->group_list))
+ if($logged_info && is_array($logged_info->group_list))
{
$group_list = array_keys($logged_info->group_list);
}
@@ -632,16 +632,16 @@ class editorModel extends editor
{
if(!$logged_info)
{
- $val->enabled = "N";
+ $val->enabled = "N";
}
else
{
$is_granted = false;
foreach($group_list as $group_srl)
{
- if(in_array($group_srl, $val->target_group)) $is_granted = true;
+ if(in_array($group_srl, $val->target_group)) $is_granted = true;
}
- if(!$is_granted) $val->enabled = "N";
+ if(!$is_granted) $val->enabled = "N";
}
}
if($val->enabled != "N" && $val->mid_list)
diff --git a/modules/importer/importer.admin.controller.php b/modules/importer/importer.admin.controller.php
index 59792a95c..060fe6c4e 100644
--- a/modules/importer/importer.admin.controller.php
+++ b/modules/importer/importer.admin.controller.php
@@ -302,7 +302,9 @@ class importerAdminController extends importer
$columnList = array('module_srl', 'module');
$target_module_info = $oModuleModel->getModuleInfoByModuleSrl($target_module, $columnList);
- require_once('./modules/importer/ttimport.class.php');
+ $ttimporter = FileHandler::exists(_XE_PATH_ . 'modules/importer/ttimport.class.php');
+ if($ttimporter) require_once($ttimporter);
+
$oTT = new ttimport();
$cur = $oTT->importModule($key, $cur, $index_file, $this->unit_count, $target_module, $guestbook_target_module, $user_id, $target_module_info->module);
break;
diff --git a/modules/install/install.admin.controller.php b/modules/install/install.admin.controller.php
index cad2494f9..549846b88 100644
--- a/modules/install/install.admin.controller.php
+++ b/modules/install/install.admin.controller.php
@@ -142,7 +142,7 @@ class installAdminController extends install
$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
if(file_exists($homeMenuCacheFile))
{
- @include($homeMenuCacheFile);
+ include($homeMenuCacheFile);
}
if(!$homeMenuSrl || $homeMenuSrl != $output->menu_srl)
diff --git a/modules/install/install.controller.php b/modules/install/install.controller.php
index 55f89ea66..90e27686b 100644
--- a/modules/install/install.controller.php
+++ b/modules/install/install.controller.php
@@ -176,13 +176,14 @@ class installController extends install
if(!$this->makeConfigFile()) return new Object(-1, 'msg_install_failed');
// load script
- $scripts = FileHandler::readDir('./modules/install/script','/(\.php)$/');
+ $scripts = FileHandler::readDir(_XE_PATH_ . 'modules/install/script', '/(\.php)$/');
if(count($scripts)>0)
{
sort($scripts);
foreach($scripts as $script)
{
- $output = include(FileHandler::getRealPath('./modules/install/script/'.$script));
+ $script_path = FileHandler::getRealPath('./modules/install/script/');
+ $output = include($script_path . $script));
}
}
diff --git a/modules/install/script/ko.install.php b/modules/install/script/ko.install.php
index c6e99ee27..61e01a792 100644
--- a/modules/install/script/ko.install.php
+++ b/modules/install/script/ko.install.php
@@ -114,7 +114,7 @@ $obj->module_srl = $module_srl;
Context::set('version', __XE_VERSION__);
$obj->title = 'Welcome XE';
-$obj->content = $oTemplateHandler->compile('./modules/install/script/welcome_content', 'welcome_content_'.$lang);
+$obj->content = $oTemplateHandler->compile(_XE_PATH_ . 'modules/install/script/welcome_content', 'welcome_content_'.$lang);
$output = $oDocumentController->insertDocument($obj);
if(!$output->toBool()) return $output;
diff --git a/modules/layout/layout.admin.model.php b/modules/layout/layout.admin.model.php
index cbcd27311..5be33c0c0 100644
--- a/modules/layout/layout.admin.model.php
+++ b/modules/layout/layout.admin.model.php
@@ -184,8 +184,8 @@ class layoutAdminModel extends layout
public function getSiteDefaultLayout($viewType = 'P', $siteSrl = 0)
{
$target = ($viewType == 'M') ? 'mlayout_srl' : 'layout_srl';
- $designInfoFile = sprintf(_XE_PATH_.'/files/site_design/design_%s.php', $siteSrl);
- @include($designInfoFile);
+ $designInfoFile = sprintf(_XE_PATH_ . 'files/site_design/design_%s.php', $siteSrl);
+ if(FileHandler::exists($designInfoFile)) include($designInfoFile);
if(!$designInfo || !$designInfo->{$target})
{
diff --git a/modules/layout/layout.admin.view.php b/modules/layout/layout.admin.view.php
index 6f427aaaa..f81bcaed8 100644
--- a/modules/layout/layout.admin.view.php
+++ b/modules/layout/layout.admin.view.php
@@ -319,7 +319,8 @@ class layoutAdminView extends layout
{
foreach($layout_info->menu as $menu_id => $menu)
{
- if(file_exists($menu->php_file)) @include($menu->php_file);
+ $menu->php_file = FileHandler::getRealPath($menu->php_file);
+ if(FileHandler::exists($menu->php_file)) include($menu->php_file);
Context::set($menu_id, $menu);
}
}
diff --git a/modules/layout/layout.model.php b/modules/layout/layout.model.php
index e0a9b8f49..a51da7185 100644
--- a/modules/layout/layout.model.php
+++ b/modules/layout/layout.model.php
@@ -760,7 +760,7 @@ class layoutModel extends layout
$buff = '';
FileHandler::writeFile($cache_file, $buff);
- if(file_exists($cache_file)) @include($cache_file);
+ if(FileHandler::exists($cache_file)) include($cache_file);
if(!$layout_info->title)
{
@@ -807,7 +807,7 @@ class layoutModel extends layout
*/
function getUserLayoutPath($layout_srl)
{
- return sprintf("./files/faceOff/%s",getNumberingPath($layout_srl,3));
+ return sprintf("%sfiles/faceOff/%s", _XE_PATH_, getNumberingPath($layout_srl,3));
}
/**
@@ -942,7 +942,7 @@ class layoutModel extends layout
*/
function getLayoutCache($layout_name,$lang_type)
{
- return sprintf("./files/cache/layout/%s.%s.cache.php",$layout_name,$lang_type);
+ return sprintf("%sfiles/cache/layout/%s.%s.cache.php", _XE_PATH_, $layout_name,$lang_type);
}
/**
diff --git a/modules/layout/layout.view.php b/modules/layout/layout.view.php
index 89fed4ec1..c7e63ea63 100644
--- a/modules/layout/layout.view.php
+++ b/modules/layout/layout.view.php
@@ -87,12 +87,12 @@ class layoutView extends layout
if ($skinType == 'M')
{
- $templatePath = './modules/page/m.skins/' . $skin;
+ $templatePath = _XE_PATH_ . 'modules/page/m.skins/' . $skin;
$templateFile = 'mobile';
}
else
{
- $templatePath = './modules/page/skins/' . $skin;
+ $templatePath = _XE_PATH_ . 'modules/page/skins/' . $skin;
$templateFile = 'content';
}
@@ -113,8 +113,8 @@ class layoutView extends layout
if($layoutSrl == -1)
{
$site_srl = ($oModule) ? $oModule->module_info->site_srl : 0;
- $designInfoFile = sprintf(_XE_PATH_.'/files/site_design/design_%s.php', $site_srl);
- @include($designInfoFile);
+ $designInfoFile = sprintf(_XE_PATH_ . 'files/site_design/design_%s.php', $site_srl);
+ include($designInfoFile);
if($skinType == 'M')
{
@@ -164,7 +164,7 @@ class layoutView extends layout
if(file_exists($homeMenuCacheFile))
{
- @include($homeMenuCacheFile);
+ include($homeMenuCacheFile);
}
if(!$menu->menu_srl)
@@ -179,9 +179,11 @@ class layoutView extends layout
$menu->php_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->php_file);
}
}
- if(file_exists($menu->php_file))
+
+ $menu->php_file = FileHandler::getRealPath($menu->php_file);
+ if(FileHandler::exists($menu->php_file))
{
- @include($menu->php_file);
+ include($menu->php_file);
}
Context::set($menu_id, $menu);
}
@@ -304,7 +306,7 @@ class layoutView extends layout
}
// get module html
- require_once("./classes/display/HTMLDisplayHandler.php");
+ require_once(_XE_PATH_ . "classes/display/HTMLDisplayHandler.php");
$handler = new HTMLDisplayHandler();
return $handler->toDoc($oModule);
}
@@ -346,7 +348,9 @@ class layoutView extends layout
{
foreach($layout_info->menu as $menu_id => $menu)
{
- if(file_exists($menu->php_file)) @include($menu->php_file);
+ $menu->php_file = FileHandler::getRealPath($menu->php_file);
+ if(FileHandler::exists($menu->php_file)) include($menu->php_file);
+
Context::set($menu_id, $menu);
}
}
@@ -354,7 +358,7 @@ class layoutView extends layout
Context::set('layout_info', $layout_info);
Context::set('content', Context::getLang('layout_preview_content'));
// Temporary save the codes
- $edited_layout_file = sprintf('./files/cache/layout/tmp.tpl');
+ $edited_layout_file = _XE_PATH_ . 'files/cache/layout/tmp.tpl';
FileHandler::writeFile($edited_layout_file, $code);
// Compile
diff --git a/modules/menu/menu.admin.controller.php b/modules/menu/menu.admin.controller.php
index a12225cda..1dd7944cf 100644
--- a/modules/menu/menu.admin.controller.php
+++ b/modules/menu/menu.admin.controller.php
@@ -44,7 +44,7 @@ class menuAdminController extends menu
* home menu cache file
* @var string
*/
- private $homeMenuCacheFile = './files/cache/menu/homeSitemap.php';
+ private $homeMenuCacheFile = 'files/cache/menu/homeSitemap.php';
/**
* Initialization
@@ -53,7 +53,10 @@ class menuAdminController extends menu
function init()
{
$this->setTemplatePath($this->module_path.'tpl');
- //$this->homeMenuCacheFile = sprintf('./files/cache/menu/homeSitemap.php');
+ }
+
+ function __construct() {
+ $this->homeMenuCacheFile = _XE_PATH_ . $this->homeMenuCacheFile;
}
/**
@@ -142,7 +145,7 @@ class menuAdminController extends menu
if(is_readable(FileHandler::getRealPath($phpFile)))
{
- @include(FileHandler::getRealPath($phpFile));
+ include(FileHandler::getRealPath($phpFile));
}
// check home menu in originMenu
@@ -742,7 +745,7 @@ class menuAdminController extends menu
if(is_readable(FileHandler::getRealPath($phpFile)))
{
- @include(FileHandler::getRealPath($phpFile));
+ include(FileHandler::getRealPath($phpFile));
if(is_array($menu->list))
{
@@ -889,12 +892,12 @@ class menuAdminController extends menu
}
// get menu properies with child menu
- $phpFile = sprintf("./files/cache/menu/%s.php", $originalItemInfo->menu_srl);
+ $phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $originalItemInfo->menu_srl);
$originMenu = NULL;
if(is_readable(FileHandler::getRealPath($phpFile)))
{
- @include(FileHandler::getRealPath($phpFile));
+ include(FileHandler::getRealPath($phpFile));
if(is_array($menu->list))
{
@@ -988,12 +991,12 @@ class menuAdminController extends menu
$menuSrl = $itemInfo->menu_srl;
// get menu properies with child menu
- $phpFile = sprintf("./files/cache/menu/%s.php", $menuSrl);
+ $phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menuSrl);
$originMenu = NULL;
if(is_readable(FileHandler::getRealPath($phpFile)))
{
- @include(FileHandler::getRealPath($phpFile));
+ include(FileHandler::getRealPath($phpFile));
if(is_array($menu->list))
{
@@ -1306,7 +1309,7 @@ class menuAdminController extends menu
{
if(file_exists($this->homeMenuCacheFile))
{
- @include($this->homeMenuCacheFile);
+ include($this->homeMenuCacheFile);
}
if(!$homeMenuSrl || $homeMenuSrl != $menu_srl)
{
@@ -1618,8 +1621,8 @@ class menuAdminController extends menu
$output = executeQuery('menu.getMenuItems', $args);
if(!$output->toBool()) return;
// Specify the name of the cache file
- $xml_file = sprintf("./files/cache/menu/%s.xml.php", $menu_srl);
- $php_file = sprintf("./files/cache/menu/%s.php", $menu_srl);
+ $xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
+ $php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
// If no data found, generate an XML file without node data
$list = $output->data;
if(!$list)
diff --git a/modules/menu/menu.admin.model.php b/modules/menu/menu.admin.model.php
index 1abd14579..5c6585159 100644
--- a/modules/menu/menu.admin.model.php
+++ b/modules/menu/menu.admin.model.php
@@ -493,12 +493,9 @@ class menuAdminModel extends menu
{
$isMenuFixed = false;
$output = $this->getMenu($menuSrl);
- $php_file = sprintf('./files/cache/menu/%s.php',$output->menu_srl);
- if(file_exists($php_file)) @include($php_file);
- else
- {
- $oMenuAdminController->makeXmlFile($menuSrl);
- }
+ $php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$output->menu_srl);
+ if(file_exists($php_file)) include($php_file);
+ else $oMenuAdminController->makeXmlFile($menuSrl);
if(count($menu->list)>0)
{
@@ -532,15 +529,18 @@ class menuAdminModel extends menu
{
unset($menu);
unset($menuItems);
- $value->php_file = sprintf('./files/cache/menu/%s.php',$value->menu_srl);
- if(file_exists($value->php_file)) @include($value->php_file);
+ $value->php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$value->menu_srl);
+ if(file_exists($value->php_file))
+ {
+ include($value->php_file);
+ }
else
{
$oMenuAdminController->makeXmlFile($value->menu_srl);
}
$isMenuFixed = false;
- if(count($menu->list)>0)
+ if(count($menu->list) > 0)
{
foreach($menu->list AS $key2=>$value2)
{
diff --git a/modules/menu/menu.admin.view.php b/modules/menu/menu.admin.view.php
index 1f46ddcfa..0b0735c9d 100644
--- a/modules/menu/menu.admin.view.php
+++ b/modules/menu/menu.admin.view.php
@@ -57,8 +57,8 @@ class menuAdminView extends menu
unset($menu);
unset($menuItems);
//$value->xml_file = sprintf('./files/cache/menu/%s.xml.php',$value->menu_srl);
- $value->php_file = sprintf('./files/cache/menu/%s.php',$value->menu_srl);
- if(file_exists($value->php_file)) @include($value->php_file);
+ $value->php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$value->menu_srl);
+ if(file_exists($value->php_file)) include($value->php_file);
if(count($menu->list)>0)
{
@@ -80,7 +80,7 @@ class menuAdminView extends menu
Context::set('menu_list', $menuList);
// get installed module list
- $oPageController = &getController('page'); //for lang
+ $oPageController = &getController('page'); //for lang
$resultModuleList = $oMenuAdminModel->getModuleListInSitemap($site_srl);
Context::set('module_list', $resultModuleList);
diff --git a/modules/module/module.admin.controller.php b/modules/module/module.admin.controller.php
index 55cf1b9c5..7d6bbd40c 100644
--- a/modules/module/module.admin.controller.php
+++ b/modules/module/module.admin.controller.php
@@ -392,7 +392,7 @@ class moduleAdminController extends module
}
// Get skin information (to check extra_vars)
- $module_path = './modules/'.$module_info->module;
+ $module_path = _XE_PATH_ . 'modules/'.$module_info->module;
if($mode === 'M')
{
diff --git a/modules/module/module.admin.model.php b/modules/module/module.admin.model.php
index fad0674d3..2c35a5c79 100644
--- a/modules/module/module.admin.model.php
+++ b/modules/module/module.admin.model.php
@@ -527,7 +527,7 @@ class moduleAdminModel extends module
function getModuleAdminMultilingualHtml()
{
$oTemplate = TemplateHandler::getInstance();
- $tpl = $oTemplate->compile('./modules/module/tpl', 'multilingual_v17.html');
+ $tpl = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl', 'multilingual_v17.html');
$this->add('html', $tpl);
}
@@ -566,7 +566,7 @@ class moduleAdminModel extends module
$oSecurity->encodeHTML('lang_code_list..');
$oTemplate = TemplateHandler::getInstance();
- $tpl = $oTemplate->compile('./modules/module/tpl', 'multilingual_v17_list.html');
+ $tpl = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl', 'multilingual_v17_list.html');
$this->add('html', $tpl);
}
@@ -576,9 +576,9 @@ class moduleAdminModel extends module
*/
function getModuleAdminModuleSearcherHtml()
{
- Context::loadLang('./modules/admin/lang');
+ Context::loadLang(_XE_PATH_ . 'modules/admin/lang');
$oTemplate = TemplateHandler::getInstance();
- $tpl = $oTemplate->compile('./modules/module/tpl', 'module_searcher_v17.html');
+ $tpl = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl', 'module_searcher_v17.html');
$this->add('html', $tpl);
}
diff --git a/modules/module/module.admin.view.php b/modules/module/module.admin.view.php
index c261632c9..519456e0a 100644
--- a/modules/module/module.admin.view.php
+++ b/modules/module/module.admin.view.php
@@ -171,7 +171,7 @@ class moduleAdminView extends module
$columnList = array('module_srl', 'module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0], $columnList);
// Get a skin list of the module
- $skin_list = $oModuleModel->getSkins('./modules/'.$module_info->module);
+ $skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/'.$module_info->module);
Context::set('skin_list',$skin_list);
// Get a layout list
$oLayoutMode = &getModel('layout');
diff --git a/modules/module/module.model.php b/modules/module/module.model.php
index a7010a3af..a7832ac69 100644
--- a/modules/module/module.model.php
+++ b/modules/module/module.model.php
@@ -82,10 +82,10 @@ class moduleModel extends module
function getDefaultMid()
{
$default_url = Context::getDefaultUrl();
- if(substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
+ if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
$request_url = Context::getRequestUri();
- if(substr_compare($request_url, '/', -1) === 0) $request_url = substr($request_url, 0, -1);
+ if($request_url && substr_compare($request_url, '/', -1) === 0) $request_url = substr($request_url, 0, -1);
$default_url_parse = parse_url($default_url);
$request_url_parse = parse_url($request_url);
@@ -747,7 +747,7 @@ class moduleModel extends module
$xml_file = sprintf("%sconf/module.xml", $class_path);
if(!file_exists($xml_file)) return;
// Check if cached file exists
- $cache_file = sprintf("./files/cache/module_info/%s.%s.%s.php", $module, Context::getLangType(), __XE_VERSION__);
+ $cache_file = sprintf(_XE_PATH_ . "files/cache/module_info/%s.%s.%s.php", $module, Context::getLangType(), __XE_VERSION__);
// Update if no cache file exists or it is older than xml file
if(!file_exists($cache_file) || filemtime($cache_file)module->{$module_name}->{$target};
}
@@ -2077,7 +2077,7 @@ class moduleModel extends module
$security->encodeHTML('filebox_list..comment', 'filebox_list..attributes.');
$oTemplate = &TemplateHandler::getInstance();
- $html = $oTemplate->compile('./modules/module/tpl/', 'filebox_list_html');
+ $html = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl/', 'filebox_list_html');
$this->add('html', $html);
}
diff --git a/modules/page/page.view.php b/modules/page/page.view.php
index 6fa030ce1..c4cea5c74 100644
--- a/modules/page/page.view.php
+++ b/modules/page/page.view.php
@@ -32,7 +32,7 @@ class pageView extends page
}
case 'OUTSIDE' :
{
- $this->cache_file = sprintf("./files/cache/opage/%d.%s.cache.php", $this->module_info->module_srl, Context::getSslStatus());
+ $this->cache_file = sprintf("%sfiles/cache/opage/%d.%s.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getSslStatus());
$this->interval = (int)($this->module_info->page_caching_interval);
$this->path = $this->module_info->path;
break;
@@ -166,24 +166,28 @@ class pageView extends page
/**
* @brief Create a cache file in order to include if it is an internal file
*/
- function executeFile($path, $caching_interval, $cache_file)
+ function executeFile($target_file, $caching_interval, $cache_file)
{
// Cancel if the file doesn't exist
- if(!file_exists($path)) return;
+ if(!file_exists(FileHandler::getRealPath($target_file))) return;
+
// Get a path and filename
$tmp_path = explode('/',$cache_file);
$filename = $tmp_path[count($tmp_path)-1];
$filepath = preg_replace('/'.$filename."$/i","",$cache_file);
+ $cache_file = FileHandler::getRealPath($cache_file);
+
// Verify cache
- if($caching_interval <1 || !file_exists($cache_file) || filemtime($cache_file) + $caching_interval*60 <= $_SERVER['REQUEST_TIME'] || filemtime($cache_file)path = str_replace('\\', '/', realpath(dirname($path))) . '/';
+ $this->path = str_replace('\\', '/', realpath(dirname($target_file))) . '/';
$content = preg_replace_callback('/(target=|src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content);
$content = preg_replace_callback('/(