#64 서버 내 경로를 절대경로로 변경

This commit is contained in:
bnu 2013-11-22 14:57:24 +09:00
parent bf0dd35f0a
commit 932862be1f
42 changed files with 807 additions and 133 deletions

View file

@ -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)
{

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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')));

View file

@ -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)
{

View file

@ -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)

View file

@ -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;
}

View file

@ -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)
{

View file

@ -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);

View file

@ -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;
}

View file

@ -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);
}

View file

@ -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'))
{

View file

@ -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;

View file

@ -3,7 +3,6 @@
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)
@ -11,7 +10,7 @@ class UploadFileFilter
// TODO: 기능개선후 enable
return TRUE; // disable
if (! $file || ! file_exists ( $file )) return TRUE;
if (! $file || ! FileHandler::exists($file)) return TRUE;
return self::_check ( $file );
}

View file

@ -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;
}
/**

View file

@ -95,7 +95,7 @@ class Validator
));
$this->_has_mb_func = is_callable('mb_strlen');
$this->setCacheDir('./files/cache');
$this->setCacheDir(_XE_PATH_ . 'files/cache');
}
/**

650
krzip.patch Normal file
View file

@ -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 @@
<value xml:lang="tr"><![CDATA[Güncellemek istediğinize emin misiniz?]]></value>
<value xml:lang="vi"><![CDATA[Bạn chắc chắn muốn Update?]]></value>
</item>
+ <item name="confirm_process">
+ <value xml:lang="ko"><![CDATA[처리하시겠습니까?]]></value>
+ <value xml:lang="en"><![CDATA[Are you sure you want to process?]]></value>
+ </item>
<item name="column_type">
<value xml:lang="ko"><![CDATA[형식]]></value>
<value xml:lang="en"><![CDATA[Column Type]]></value>
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 @@
+<query id="getCommentCountByMemberSrl" action="select">
+ <tables>
+ <table name="comments" />
+ </tables>
+ <columns>
+ <column name="count(*)" alias="count" />
+ </columns>
+ <conditions>
+ <condition operation="equal" column="member_srl" var="member_srl" filter="number" notnull="notnull" />
+ </conditions>
+</query>
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 @@
+<query id="getCommentList" action="select">
+ <tables>
+ <table name="comments" />
+ </tables>
+ <columns>
+ <column name="comment_srl" />
+ <column name="parent_srl" />
+ <column name="regdate" />
+ </columns>
+ <conditions>
+ <condition operation="equal" column="member_srl" var="member_srl" filter="number" notnull="notnull" />
+ </conditions>
+ <navigation>
+ <index var="list_order" default="list_order" order="asc" />
+ <list_count var="list_count" default="20" />
+ <page_count var="page_count" default="10" />
+ <page var="page" default="1" />
+ </navigation>
+</query>
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 @@
+<query id="getDocumentCountByMemberSrl" action="select">
+ <tables>
+ <table name="documents" />
+ </tables>
+ <columns>
+ <column name="count(*)" alias="count" />
+ </columns>
+ <conditions>
+ <condition operation="equal" column="member_srl" var="member_srl" filter="number" notnull="notnull" />
+ </conditions>
+</query>
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 @@
+<query id="getDocumentList" action="select">
+ <tables>
+ <table name="documents" />
+ </tables>
+ <columns>
+ <column name="*" />
+ </columns>
+ <conditions>
+ <condition operation="equal" column="member_srl" var="member_srl" filter="number" notnull="notnull" />
+ </conditions>
+ <navigation>
+ <index var="list_order" default="list_order" order="asc" />
+ <list_count var="list_count" default="20" />
+ <page_count var="page_count" default="10" />
+ <page var="page" default="1" />
+ </navigation>
+</query>
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 @@
<action name="dispMemberGetTempPassword" type="view" />
<action name="dispMemberResendAuthMail" type="view" />
<action name="dispSavedDocumentList" type="view" />
+ <action name="dispMemberSpammer" type="view" />
<action name="dispMemberAdminList" type="view" index="true" admin_index="true" menu_name="userList" menu_index="true"/>
<!--action name="dispMemberAdminConfig" type="view" menu_name="userSetting" menu_index="true" /-->
@@ -68,6 +69,7 @@
<action name="procMemberUpdateAuthMail" type="controller" />
<action name="procMemberResendAuthMail" type="controller" ruleset="resendAuthMail" />
<action name="procMemberResetAuthMail" type="controller" ruleset="resetAuthMail" />
+ <action name="procMemberSpammerManage" type="controller" />
<action name="procMemberAdminInsert" type="controller" ruleset="insertAdminMember" />
<action name="procMemberAdminDelete" type="controller" />
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 @@
<value xml:lang="en"><![CDATA[Address information does not exist.]]></value>
<value xml:lang="zh-CN"><![CDATA[加入会员后要移动的情报不存在]]></value>
</item>
-
+ <item name="cmd_spammer">
+ <value xml:lang="ko"><![CDATA[스패머 관리]]></value>
+ <value xml:lang="en"><![CDATA[Spam User Manage]]></value>
+ </item>
+ <item name="spammer_description">
+ <value xml:lang="ko"><![CDATA[<p>스팸 작성자 차단/삭제 및 회원이 남긴 글과 댓글을 모두 휴지통 이동 또는 삭제 합니다. 이 처리는 회원이 작성한 게시물의 양에 따라 오래걸릴 수 있습니다. </p>]]></value>
+ <value xml:lang="en"><![CDATA[<p>Spam user management. This function remove all of documents, comments</p>]]></value>
+ </item>
+ <item name="spammer_btn">
+ <value xml:lang="ko"><![CDATA[데이터 삭제]]></value>
+ <value xml:lang="en"><![CDATA[DELETE DATA]]></value>
+ </item>
</lang>
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 @@
+<!--%import("filter/manage_checked_document.xml")-->
+<style type="text/css">
+.dot-line {border-bottom:1px dotted #ddd; padding:8px 0;}
+.progress-box {visibility:hidden;padding:10px;}
+.progress-complete {visibility:hidden;background-color:#EAEAEA;color:#F15F5F;font-weight:bold;text-align:center;padding:3px;}
+.progress-cancel {visibility:hidden;background-color:#EAEAEA;color:#F15F5F;font-weight:bold;text-align:center;padding:3px;}
+.btn-proc { padding:40px 0; text-align:center;}
+</style>
+
+<div class="x_modal-header">
+ <h1>{$lang->cmd_spammer}</h1>
+</div>
+
+<form action="./" method="post" id="fo_management" onsubmit="return false">
+<input type="hidden" name="module" value="member" />
+<input type="hidden" name="act" value="procMemberSpammerManage" />
+<input type="hidden" name="proc_type" value="" />
+<input type="hidden" name="member_srl" value="{$spammer_info->member_srl}" />
+<input type="hidden" name="module_srl" value="{$module_srl}" />
+<input type="hidden" name="cnt_loop" value="1" />
+<div class="x_modal-body x_form-horizontal" style="max-height:none">
+ <div class="dot-line">{$lang->description} : {$lang->spammer_description}</div>
+ <div class="dot-line">{$lang->nick_name} : <span class="nick_name">{$spammer_info->nick_name}</span></div>
+
+ <div class="dot-line">
+ <p>{$lang->about_member_description}</p>
+ <textarea name="spam_description" id="spam_description" cols="400" rows="3" style="width:400px"></textarea>
+ </div>
+ <div class="btn-proc" >
+ <button type="submit" onclick="doSpammerManage( {proc_type:'trash'} )" />{$lang->cmd_trash}</button>
+ <button type="submit" onclick="doSpammerManage( {proc_type:'delete'} )" />{$lang->cmd_delete}</button>
+ </div>
+
+ <div class="progress-box">
+ <div>Document Count : <span id="document_count"></span> <span id="document_percent"></span></div>
+ <div class="x_progress x_progress-striped x_active">
+ <div class="x_bar" id="progressBar" style="width: 0%"></div>
+ </div>
+ <div class="progress-complete">{$lang->cmd_complete}</div>
+ <div class-"cancel"><button type="button" onclick="cancelSpammerManage();">{$lang->cmd_cancel}</button></div>
+ </div>
+ <div class="progress-cancel dot-line">{$lang->success_declare_canceled}</div>
+</div>
+</form>
+<script type="text/javascript">
+var bSpammerManageProc = true;
+var f = jQuery('#fo_management').get(0);
+function doSpammerManage( args ) {
+ if( args.cnt_loop == undefined ) {
+ if(!confirm('{$lang->confirm_process}')) return false;
+
+ // reset form
+ f.proc_type.value = args.proc_type;
+ f.cnt_loop.value = 1;
+
+ bSpammerManageProc = true;
+ args.member_srl = f.member_srl.value;
+ args.module_srl = f.module_srl.value;
+ args.cnt_loop = f.cnt_loop.value;
+ args.spam_description = f.spam_description.value;
+ args.proc_type = f.proc_type.value;
+
+ jQuery('.progress-box').css('visibility','visible');
+ jQuery('.progress-cancel').css('visibility','hidden');
+
+ }
+
+ jQuery.exec_json( f.module.value + '.' + f.act.value, args, progressSpammerManage );
+
+ return false; // don't page move
+}
+
+function progressSpammerManage( data ) {
+
+
+ setTimeout( function() {
+ if( data.total_count != undefined && parseInt( data.total_count ) > 0 ) {
+ var doc_count = parseInt( data.total_count ) - parseInt( data.remain_count );
+ jQuery('#document_count').html( doc_count + "/" + data.total_count );
+ jQuery('#document_percent').html(data.progress + "%");
+ }
+ jQuery('#progressBar').width(data.progress + "%");
+ if(data.remain_count <= 0) {
+ jQuery('.progress-complete').css('visibility','visible');
+ return;
+ }
+
+ var args = data;
+ f.cnt_loop.value = data.cnt_loop;
+
+ if( bSpammerManageProc == false ) {
+ jQuery('.progress-box').css('visibility','hidden');
+ jQuery('.progress-cancel').css('visibility','visible');
+
+ // reset progress values
+ jQuery('#document_count').html("");
+ jQuery('#document_percent').html("");
+ jQuery('#progressBar').width("0%");
+
+ return;
+ }
+ doSpammerManage( args );
+
+ }, 500 );
+}
+
+function cancelSpammerManage() {
+ bSpammerManageProc = false;
+}
+</script>

View file

@ -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;

View file

@ -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;

View file

@ -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]);
}

View file

@ -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");

View file

@ -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);

View file

@ -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';

View file

@ -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();

View file

@ -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;

View file

@ -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)

View file

@ -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));
}
}

View file

@ -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;

View file

@ -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})
{

View file

@ -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);
}
}

View file

@ -760,7 +760,7 @@ class layoutModel extends layout
$buff = '<?php if(!defined("__XE__")) exit(); '.$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);
}
/**

View file

@ -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

View file

@ -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)

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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')
{

View file

@ -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);
}

View file

@ -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');

View file

@ -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)<filemtime($xml_file))
{
@ -903,7 +903,7 @@ class moduleModel extends module
return $info;
}
@include($cache_file);
if(file_exists($cache_file)) include($cache_file);
return $info;
}
@ -1713,7 +1713,7 @@ class moduleModel extends module
$designInfoFile = sprintf(_XE_PATH_.'files/site_design/design_%s.php', $site_srl);
if(is_readable($designInfoFile))
{
@include($designInfoFile);
include($designInfoFile);
$skinName = $designInfo->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);
}

View file

@ -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)<filemtime($path))
if($caching_interval <1 || !file_exists($cache_file) || filemtime($cache_file) + $caching_interval*60 <= $_SERVER['REQUEST_TIME'] || filemtime($cache_file)<filemtime($target_file))
{
if(file_exists($cache_file)) FileHandler::removeFile($cache_file);
// Read a target file and get content
ob_start();
@include($path);
include(FileHandler::getRealPath($target_file));
$content = ob_get_clean();
// Replace relative path to the absolute path
$this->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('/(<!--%import\()(\")([^"]+)(\")/is',array($this,'_replacePath'),$content);
@ -201,7 +205,7 @@ class pageView extends page
$__Context->tpl_path = $filepath;
ob_start();
@include($cache_file);
include($cache_file);
$content = ob_get_clean();
return $content;

View file

@ -171,7 +171,7 @@ class pollController extends poll
$oDB->commit();
$skin = Context::get('skin');
if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default';
if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) $skin = 'default';
// Get tpl
$tpl = $oPollModel->getPollHtml($poll_srl, '', $skin);
@ -191,7 +191,7 @@ class pollController extends poll
$poll_srl = Context::get('poll_srl');
$skin = Context::get('skin');
if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default';
if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) $skin = 'default';
$oPollModel = &getModel('poll');
$tpl = $oPollModel->getPollResultHtml($poll_srl, $skin);

View file

@ -129,7 +129,7 @@ class widgetModel extends widget
$xml_file = sprintf("%sconf/info.xml", $widget_path);
if(!file_exists($xml_file)) return;
// If the problem by comparing the cache file and include the return variable $widget_info
$cache_file = sprintf('./files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType());
$cache_file = sprintf(_XE_PATH_ . 'files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType());
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file))
{
@ -300,7 +300,7 @@ class widgetModel extends widget
$xml_file = sprintf("%sskin.xml", $widgetStyle_path);
if(!file_exists($xml_file)) return;
// If the problem by comparing the cache file and include the return variable $widgetStyle_info
$cache_file = sprintf('./files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType());
$cache_file = sprintf(_XE_PATH_ . 'files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType());
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file))
{