mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
procDocumentManageCheckedDocument() 정리
서드파티에서 조작할 수 있도록 document.manage 트리거 추가 게시물 관리 기본 쪽지 보내기 개선 (동일 작성자의 게시물을 모아 한번에 보내도록 )
This commit is contained in:
parent
54401ea28f
commit
cd837d1124
12 changed files with 195 additions and 202 deletions
|
|
@ -1049,7 +1049,10 @@ class documentController extends document
|
|||
$trash_args->module_srl = $oDocument->get('module_srl');
|
||||
$obj->module_srl = $oDocument->get('module_srl');
|
||||
// Cannot throw data from the trash to the trash
|
||||
if($trash_args->module_srl == 0) return false;
|
||||
if($trash_args->module_srl == 0)
|
||||
{
|
||||
return new BaseObject(-1, 'Error');
|
||||
}
|
||||
// Data setting
|
||||
$trash_args->document_srl = $obj->document_srl;
|
||||
$trash_args->description = $obj->description;
|
||||
|
|
@ -2538,158 +2541,181 @@ class documentController extends document
|
|||
function procDocumentManageCheckedDocument()
|
||||
{
|
||||
@set_time_limit(0);
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// Get request parameters.
|
||||
$cart = Context::get('cart');
|
||||
if(!is_array($cart)) $cart = explode('|@|', $cart);
|
||||
$cart = array_unique(array_map('intval', $cart));
|
||||
$type = Context::get('type');
|
||||
$target_module_srl = intval(Context::get('module_srl') ?: Context::get('target_module'));
|
||||
$target_category_srl = Context::get('target_category');
|
||||
|
||||
// send default message - misol 2015-07-23
|
||||
$send_default_message = Context::get('send_default_message');
|
||||
if($send_default_message === 'Y')
|
||||
{
|
||||
$message_content = '';
|
||||
$default_message_verbs = lang('default_message_verbs');
|
||||
if(isset($default_message_verbs[$type]) && is_string($default_message_verbs[$type]))
|
||||
{
|
||||
$message_content = sprintf(lang('default_message_format'), $logged_info->nick_name, $default_message_verbs[$type]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message_content = Context::get('message_content');
|
||||
if($message_content) $message_content = nl2br($message_content);
|
||||
}
|
||||
|
||||
// Check permissions on all documents.
|
||||
$document_items = array();
|
||||
$document_srl_list = array();
|
||||
$module_srl_list = array();
|
||||
$oDocumentModel = getModel('document');
|
||||
foreach ($cart as $document_srl)
|
||||
{
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
$document_items[] = $oDocument;
|
||||
$document_srl_list[] = $document_srl;
|
||||
$module_srl_list[] = $oDocument->get('module_srl');
|
||||
if (!$oDocument->isGranted())
|
||||
{
|
||||
return $this->stop('msg_not_permitted');
|
||||
}
|
||||
}
|
||||
$obj = new stdClass;
|
||||
$obj->type = Context::get('type');
|
||||
$obj->document_list = array();
|
||||
$obj->document_srl_list = array();
|
||||
$obj->target_module_srl = intval(Context::get('module_srl') ?: Context::get('target_module'));
|
||||
$obj->target_category_srl = Context::get('target_category');
|
||||
$obj->manager_message = Context::get('message_content') ? nl2br(escape(strip_tags(Context::get('message_content')))) : '';
|
||||
$obj->send_message = $obj->manager_message || Context::get('send_default_message') == 'Y';
|
||||
$obj->return_message = '';
|
||||
|
||||
// Check permissions on all modules.
|
||||
$oModuleModel = getModel('module');
|
||||
if ($target_module_srl && !in_array($target_module_srl, $module_srl_list))
|
||||
// Check permission of target module
|
||||
if($obj->target_module_srl)
|
||||
{
|
||||
$module_srl_list[] = $target_module_srl;
|
||||
}
|
||||
foreach ($module_srl_list as $module_srl)
|
||||
{
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
$module_info = getModel('module')->getModuleInfoByModuleSrl($obj->target_module_srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
$module_grant = $oModuleModel->getGrant($module_info, $logged_info);
|
||||
$module_grant = getModel('module')->getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
}
|
||||
|
||||
// Set a spam-filer not to be filtered to spams
|
||||
$oSpamController = getController('spamfilter');
|
||||
$oSpamController->setAvoidLog();
|
||||
|
||||
if($type == 'move')
|
||||
// Set Cart
|
||||
$cart = Context::get('cart');
|
||||
if(!is_array($cart))
|
||||
{
|
||||
if(!$target_module_srl) return $this->setError('fail_to_move');
|
||||
|
||||
$oDocumentAdminController = getAdminController('document');
|
||||
$output = $oDocumentAdminController->moveDocumentModule($document_srl_list, $target_module_srl, $target_category_srl);
|
||||
if(!$output->toBool()) return $this->setError('fail_to_move');
|
||||
|
||||
$msg_code = 'success_moved';
|
||||
|
||||
$cart = explode('|@|', $cart);
|
||||
}
|
||||
else if($type == 'copy')
|
||||
$obj->document_srl_list = array_unique(array_map('intval', $cart));
|
||||
|
||||
// Set document list
|
||||
$obj->document_list = getModel('document')->getDocuments($obj->document_srl_list, false, false);
|
||||
if(empty($obj->document_list))
|
||||
{
|
||||
if(!$target_module_srl) return $this->setError('fail_to_move');
|
||||
|
||||
$oDocumentAdminController = getAdminController('document');
|
||||
$output = $oDocumentAdminController->copyDocumentModule($document_srl_list, $target_module_srl, $target_category_srl);
|
||||
if(!$output->toBool()) return $this->setError('fail_to_move');
|
||||
|
||||
$msg_code = 'success_copied';
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
else if($type =='delete')
|
||||
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('document.manage', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
foreach ($document_srl_list as $document_srl)
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oController = getAdminController('document');
|
||||
if($obj->type == 'move')
|
||||
{
|
||||
if(!$obj->target_module_srl)
|
||||
{
|
||||
return $this->setError('fail_to_move');
|
||||
}
|
||||
|
||||
$output = $oController->moveDocumentModule($obj->document_srl_list, $obj->target_module_srl, $obj->target_category_srl);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$obj->return_message = 'success_moved';
|
||||
}
|
||||
else if($obj->type == 'copy')
|
||||
{
|
||||
if(!$obj->target_module_srl)
|
||||
{
|
||||
return $this->setError('fail_to_move');
|
||||
}
|
||||
|
||||
$output = $oController->copyDocumentModule($obj->document_srl_list, $obj->target_module_srl, $obj->target_category_srl);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$obj->return_message = 'success_copied';
|
||||
}
|
||||
else if($obj->type == 'delete')
|
||||
{
|
||||
foreach ($obj->document_list as $document_srl => $oDocument)
|
||||
{
|
||||
$output = $this->deleteDocument($document_srl, true);
|
||||
if(!$output->toBool()) return $this->setError('fail_to_delete');
|
||||
if(!$output->toBool())
|
||||
{
|
||||
unset($obj->document_list[$document_srl]);
|
||||
$obj->return_message = $output->getMessage();
|
||||
}
|
||||
}
|
||||
$oDB->commit();
|
||||
$msg_code = 'success_deleted';
|
||||
|
||||
$obj->return_message = $obj->return_message ?: 'success_deleted';
|
||||
}
|
||||
else if($type == 'trash')
|
||||
else if($obj->type == 'trash')
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->description = $message_content;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
foreach ($document_srl_list as $document_srl)
|
||||
$args = new stdClass;
|
||||
$args->description = $obj->manager_message;
|
||||
|
||||
foreach ($obj->document_list as $document_srl => $oDocument)
|
||||
{
|
||||
$args->document_srl = $document_srl;
|
||||
$output = $this->moveDocumentToTrash($args);
|
||||
if(!$output || !$output->toBool()) return $this->setError('fail_to_trash');
|
||||
if(!$output->toBool())
|
||||
{
|
||||
unset($obj->document_list[$document_srl]);
|
||||
$obj->return_message = $output->getMessage();
|
||||
}
|
||||
}
|
||||
$oDB->commit();
|
||||
$msg_code = 'success_trashed';
|
||||
|
||||
$obj->return_message = $obj->return_message ?: 'success_trashed';
|
||||
}
|
||||
else if($type == 'cancelDeclare')
|
||||
else if($obj->type == 'cancelDeclare')
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->document_srl = $document_srl_list;
|
||||
$args = new stdClass;
|
||||
$args->document_srl = $obj->document_srl_list;
|
||||
$output = executeQuery('document.deleteDeclaredDocuments', $args);
|
||||
$msg_code = 'success_declare_canceled';
|
||||
}
|
||||
|
||||
// Send a message
|
||||
if($message_content)
|
||||
{
|
||||
$oCommunicationController = getController('communication');
|
||||
$title = cut_str($message_content,10,'...');
|
||||
$sender_member_srl = $logged_info->member_srl;
|
||||
|
||||
foreach($document_items as $oDocument)
|
||||
if(!$output->toBool())
|
||||
{
|
||||
if(!$oDocument->get('member_srl') || $oDocument->get('member_srl')==$sender_member_srl) continue;
|
||||
|
||||
if($type=='move') $purl = sprintf("<a href=\"%s\" target=\"_blank\" style=\"padding:10px 0;\">%s</a><hr />", $oDocument->getPermanentUrl(), $oDocument->getPermanentUrl());
|
||||
else $purl = "";
|
||||
$content = sprintf("<div style=\"padding:10px 0;\"><p>%s</p></div><hr />%s<div style=\"padding:10px 0;font-weight:bold\">%s</div>%s",$message_content, $purl, $oDocument->getTitleText(), $oDocument->getContent(false, false, false));
|
||||
|
||||
$oCommunicationController->sendMessage($sender_member_srl, $oDocument->get('member_srl'), $title, $content, false);
|
||||
return $output;
|
||||
}
|
||||
|
||||
$obj->return_message = 'success_declare_canceled';
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->setError('msg_invalid_request');
|
||||
}
|
||||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('document.manage', 'after', $obj);
|
||||
|
||||
// Send a message
|
||||
$actions = lang('default_message_verbs');
|
||||
if(isset($actions[$obj->type]) && $obj->send_message)
|
||||
{
|
||||
// Set message
|
||||
$title = sprintf(lang('default_message_format'), $actions[$obj->type]);
|
||||
$content = <<< Content
|
||||
<div style="padding:10px 0;"><strong>{$title}</strong></div>
|
||||
<p>{$obj->manager_message}</p>
|
||||
<hr>
|
||||
<ul>%1\$s<ul>
|
||||
Content;
|
||||
$document_item = '<li><a href="%1$s">%2$s</a></li>';
|
||||
|
||||
// Set recipient
|
||||
$recipients = array();
|
||||
foreach ($obj->document_list as $document_srl => $oDocument)
|
||||
{
|
||||
if(!($member_srl = abs($oDocument->get('member_srl'))) || $logged_info->member_srl == $member_srl)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!isset($recipients[$member_srl]))
|
||||
{
|
||||
$recipients[$member_srl] = array();
|
||||
}
|
||||
|
||||
$recipients[$member_srl][] = sprintf($document_item, $oDocument->getPermanentUrl(), $oDocument->getTitleText());
|
||||
}
|
||||
|
||||
// Send
|
||||
$oCommunicationController = getController('communication');
|
||||
foreach ($recipients as $member_srl => $items)
|
||||
{
|
||||
$oCommunicationController->sendMessage($member_srl, $member_srl, $title, sprintf($content, implode('', $items)), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$_SESSION['document_management'] = array();
|
||||
|
||||
$this->setMessage($msg_code);
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
|
||||
$this->setMessage($obj->return_message);
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -160,57 +160,42 @@ class documentModel extends document
|
|||
* @param array $columnList
|
||||
* @return array value type is documentItem
|
||||
*/
|
||||
function getDocuments($document_srls, $is_admin = false, $load_extra_vars=true, $columnList = array())
|
||||
function getDocuments($document_srls, $is_admin = false, $load_extra_vars = true, $columnList = array())
|
||||
{
|
||||
if(is_array($document_srls))
|
||||
{
|
||||
$list_count = count($document_srls);
|
||||
$document_srls = implode(',',$document_srls);
|
||||
}
|
||||
else
|
||||
{
|
||||
$list_count = 1;
|
||||
}
|
||||
$args = new stdClass();
|
||||
$args->document_srls = $document_srls;
|
||||
$args->list_count = $list_count;
|
||||
$args->list_count = is_array($document_srls) ? count($document_srls) : 1;
|
||||
$args->order_type = 'asc';
|
||||
|
||||
$output = executeQuery('document.getDocuments', $args, $columnList);
|
||||
$document_list = $output->data;
|
||||
if(!$document_list) return;
|
||||
if(!is_array($document_list)) $document_list = array($document_list);
|
||||
|
||||
$document_count = count($document_list);
|
||||
foreach($document_list as $key => $attribute)
|
||||
$output = executeQueryArray('document.getDocuments', $args, $columnList);
|
||||
|
||||
$documents = array();
|
||||
foreach($output->data as $key => $attribute)
|
||||
{
|
||||
$document_srl = $attribute->document_srl;
|
||||
if(!$document_srl) continue;
|
||||
|
||||
if(!$document_srl = $attribute->document_srl)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl])
|
||||
{
|
||||
$oDocument = null;
|
||||
$oDocument = new documentItem();
|
||||
$oDocument->setAttribute($attribute, false);
|
||||
if($is_admin) $oDocument->setGrant();
|
||||
if($is_admin)
|
||||
{
|
||||
$oDocument->setGrant();
|
||||
}
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument;
|
||||
}
|
||||
|
||||
$result[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
||||
|
||||
$documents[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
||||
}
|
||||
|
||||
if($load_extra_vars) $this->setToAllDocumentExtraVars();
|
||||
|
||||
$output = null;
|
||||
if(count($result))
|
||||
|
||||
if($load_extra_vars)
|
||||
{
|
||||
foreach($result as $document_srl => $val)
|
||||
{
|
||||
$output[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
||||
}
|
||||
$this->setToAllDocumentExtraVars();
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
return $documents;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -85,11 +85,11 @@ $lang->select_category = 'Select a category.';
|
|||
$lang->category_description = 'Category Description';
|
||||
$lang->no_title_document = 'No title in this document.';
|
||||
$lang->send_default_message = 'Send the default message';
|
||||
$lang->default_message_format = '%1$s %2$s the document below.';
|
||||
$lang->default_message_verbs['move'] = 'moves';
|
||||
$lang->default_message_verbs['copy'] = 'copies';
|
||||
$lang->default_message_verbs['delete'] = 'deletes';
|
||||
$lang->default_message_verbs['trash'] = 'deletes';
|
||||
$lang->default_message_format = '%1$s the document by manager.';
|
||||
$lang->default_message_verbs['move'] = 'moved';
|
||||
$lang->default_message_verbs['copy'] = 'copied';
|
||||
$lang->default_message_verbs['delete'] = 'deleted';
|
||||
$lang->default_message_verbs['trash'] = 'deleted';
|
||||
$lang->improper_document_declare = 'Report an improper document';
|
||||
$lang->original_date = 'Original date';
|
||||
$lang->declared_count = 'Report count';
|
||||
|
|
|
|||
|
|
@ -81,9 +81,3 @@ $lang->select_module_id = 'モジュールIDを選択してください。';
|
|||
$lang->select_category = 'カテゴリを選択してください。';
|
||||
$lang->category_description = 'カテゴリー説明';
|
||||
$lang->no_title_document = 'タイトルがないドキュメントです。';
|
||||
$lang->send_default_message = 'Send the default message';
|
||||
$lang->default_message_format = '%1$s %2$s the document below.';
|
||||
$lang->default_message_verbs['move'] = 'moves';
|
||||
$lang->default_message_verbs['copy'] = 'copies';
|
||||
$lang->default_message_verbs['delete'] = 'deletes';
|
||||
$lang->default_message_verbs['trash'] = 'deletes';
|
||||
|
|
|
|||
|
|
@ -84,10 +84,10 @@ $lang->select_category = '분류를 선택하세요.';
|
|||
$lang->category_description = '카테고리 설명';
|
||||
$lang->no_title_document = '제목이 없는 문서입니다.';
|
||||
$lang->msg_admin_document_no_move_to_trash = '최고관리자의 게시물을 휴지통으로 이동시킬 권한이 없습니다.';
|
||||
$lang->send_default_message = '기본 쪽지 내용으로 보내기';
|
||||
$lang->default_message_format = '%1$s님께서 다음 게시물을 %2$s 합니다.';
|
||||
$lang->default_message_verbs['move'] = '이동';
|
||||
$lang->default_message_verbs['copy'] = '복사';
|
||||
$lang->send_default_message = '기본 내용으로만 쪽지 보내기';
|
||||
$lang->default_message_format = '관리자에 의해 게시물이 %1$s되었습니다.';
|
||||
$lang->default_message_verbs['move'] = '다른 게시판으로 이동';
|
||||
$lang->default_message_verbs['copy'] = '다른 게시판에 복사';
|
||||
$lang->default_message_verbs['delete'] = '삭제';
|
||||
$lang->default_message_verbs['trash'] = '삭제';
|
||||
$lang->improper_document_declare = '불량 게시글 신고';
|
||||
|
|
|
|||
|
|
@ -59,9 +59,3 @@ $lang->search_target_trash_list['trash_member_srl'] = 'Номер удалите
|
|||
$lang->search_target_trash_list['trash_user_name'] = 'Имя удалителя';
|
||||
$lang->search_target_trash_list['trash_date'] = 'Дата удаления';
|
||||
$lang->search_target_trash_list['trash_ipaddress'] = 'IP адрес удалителя';
|
||||
$lang->send_default_message = 'Send the default message';
|
||||
$lang->default_message_format = '%1$s %2$s the document below.';
|
||||
$lang->default_message_verbs['move'] = 'moves';
|
||||
$lang->default_message_verbs['copy'] = 'copies';
|
||||
$lang->default_message_verbs['delete'] = 'deletes';
|
||||
$lang->default_message_verbs['trash'] = 'deletes';
|
||||
|
|
|
|||
|
|
@ -66,9 +66,3 @@ $lang->search_target_trash_list['trash_date'] = 'Silinme Tarihi';
|
|||
$lang->search_target_trash_list['trash_ipaddress'] = 'Silici IP adresi';
|
||||
$lang->success_trashed = 'Başarıyla silindi';
|
||||
$lang->msg_not_selected_document = 'Hiçbir makale seçilmedi.';
|
||||
$lang->send_default_message = 'Send the default message';
|
||||
$lang->default_message_format = '%1$s %2$s the document below.';
|
||||
$lang->default_message_verbs['move'] = 'moves';
|
||||
$lang->default_message_verbs['copy'] = 'copies';
|
||||
$lang->default_message_verbs['delete'] = 'deletes';
|
||||
$lang->default_message_verbs['trash'] = 'deletes';
|
||||
|
|
|
|||
|
|
@ -63,9 +63,3 @@ $lang->search_target_trash_list['trash_user_name'] = 'Tên người xóa';
|
|||
$lang->search_target_trash_list['trash_date'] = 'Ngày xóa';
|
||||
$lang->search_target_trash_list['trash_ipaddress'] = 'IP Người xóa';
|
||||
$lang->success_trashed = 'Đã chuyển tới thùng rác thành công.';
|
||||
$lang->send_default_message = 'Send the default message';
|
||||
$lang->default_message_format = '%1$s %2$s the document below.';
|
||||
$lang->default_message_verbs['move'] = 'moves';
|
||||
$lang->default_message_verbs['copy'] = 'copies';
|
||||
$lang->default_message_verbs['delete'] = 'deletes';
|
||||
$lang->default_message_verbs['trash'] = 'deletes';
|
||||
|
|
|
|||
|
|
@ -65,9 +65,3 @@ $lang->search_target_trash_list['trash_user_name'] = '操作人用户名';
|
|||
$lang->search_target_trash_list['trash_date'] = '删除日期';
|
||||
$lang->search_target_trash_list['trash_ipaddress'] = '操作人IP地址';
|
||||
$lang->success_trashed = '已成功移除到回收箱。';
|
||||
$lang->send_default_message = 'Send the default message';
|
||||
$lang->default_message_format = '%1$s %2$s the document below.';
|
||||
$lang->default_message_verbs['move'] = 'moves';
|
||||
$lang->default_message_verbs['copy'] = 'copies';
|
||||
$lang->default_message_verbs['delete'] = 'deletes';
|
||||
$lang->default_message_verbs['trash'] = 'deletes';
|
||||
|
|
|
|||
|
|
@ -80,9 +80,3 @@ $lang->select_module_id = '選擇模組 ID.';
|
|||
$lang->select_category = '選擇分類';
|
||||
$lang->category_description = '分類說明';
|
||||
$lang->no_title_document = '此文章無標題。';
|
||||
$lang->send_default_message = 'Send the default message';
|
||||
$lang->default_message_format = '%1$s %2$s the document below.';
|
||||
$lang->default_message_verbs['move'] = 'moves';
|
||||
$lang->default_message_verbs['copy'] = 'copies';
|
||||
$lang->default_message_verbs['delete'] = 'deletes';
|
||||
$lang->default_message_verbs['trash'] = 'deletes';
|
||||
|
|
|
|||
|
|
@ -49,7 +49,12 @@ class spamfilter extends ModuleObject
|
|||
if(!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) return true;
|
||||
|
||||
if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) return true;
|
||||
|
||||
|
||||
if(!$oModuleModel->getTrigger('document.manage', 'spamfilter', 'controller', 'triggerManageDocument', 'before'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -102,6 +107,11 @@ class spamfilter extends ModuleObject
|
|||
{
|
||||
$oDB->addColumn('spamfilter_denied_ip','description','varchar', 250);
|
||||
}
|
||||
|
||||
if(!$oModuleModel->getTrigger('document.manage', 'spamfilter', 'controller', 'triggerManageDocument', 'before'))
|
||||
{
|
||||
$oModuleController->insertTrigger('document.manage', 'spamfilter', 'controller', 'triggerManageDocument', 'before');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -224,7 +224,15 @@ class spamfilterController extends spamfilter
|
|||
// Save a log
|
||||
$this->insertLog();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief while document manager is running, stop filter
|
||||
*/
|
||||
function triggerManageDocument(&$obj)
|
||||
{
|
||||
$this->setAvoidLog();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Log registration
|
||||
* Register the newly accessed IP address in the log. In case the log interval is withing a certain time,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue