mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 12:32:14 +09:00
issue 2287 modifed spamfilter module
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.2@11106 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
612193126c
commit
464bc59681
8 changed files with 26 additions and 32 deletions
|
|
@ -71,7 +71,7 @@
|
||||||
$url = getUrl('','module','admin','act','dispCommentAdminList','search_target','ipaddress','search_keyword',$oComment->getIpAddress());
|
$url = getUrl('','module','admin','act','dispCommentAdminList','search_target','ipaddress','search_keyword',$oComment->getIpAddress());
|
||||||
$oCommentController->addCommentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress');
|
$oCommentController->addCommentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress');
|
||||||
|
|
||||||
$url = sprintf("var params = new Array(); params['ipaddress']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oComment->getIpAddress());
|
$url = sprintf("var params = new Array(); params['ipaddress_list']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oComment->getIpAddress());
|
||||||
$oCommentController->addCommentPopupMenu($url,'cmd_add_ip_to_spamfilter','','javascript');
|
$oCommentController->addCommentPopupMenu($url,'cmd_add_ip_to_spamfilter','','javascript');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -474,7 +474,7 @@
|
||||||
$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->getIpAddress());
|
$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->getIpAddress());
|
||||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress');
|
$oDocumentController->addDocumentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress');
|
||||||
|
|
||||||
$url = sprintf("var params = new Array(); params['ipaddress']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oDocument->getIpAddress());
|
$url = sprintf("var params = new Array(); params['ipaddress_list']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oDocument->getIpAddress());
|
||||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_add_ip_to_spamfilter','','javascript');
|
$oDocumentController->addDocumentPopupMenu($url,'cmd_add_ip_to_spamfilter','','javascript');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
<action name="procSpamfilterAdminDeleteDeniedIP" type="controller" standalone="true" ruleset="deleteDeniedIp" />
|
<action name="procSpamfilterAdminDeleteDeniedIP" type="controller" standalone="true" ruleset="deleteDeniedIp" />
|
||||||
<action name="procSpamfilterAdminDeleteDeniedWord" type="controller" standalone="true" ruleset="deleteDeniedWord" />
|
<action name="procSpamfilterAdminDeleteDeniedWord" type="controller" standalone="true" ruleset="deleteDeniedWord" />
|
||||||
<action name="procSpamfilterAdminInsertConfig" type="controller" standalone="true" ruleset="insertSetting" />
|
<action name="procSpamfilterAdminInsertConfig" type="controller" standalone="true" ruleset="insertConfig" />
|
||||||
|
|
||||||
</actions>
|
</actions>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
||||||
7
modules/spamfilter/ruleset/insertConfig.xml
Normal file
7
modules/spamfilter/ruleset/insertConfig.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ruleset version="1.5.0">
|
||||||
|
<fields>
|
||||||
|
<field name="limits" required="true" />
|
||||||
|
<field name="check_trackback" required="true" />
|
||||||
|
</fields>
|
||||||
|
</ruleset>
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<ruleset version="1.5.0">
|
|
||||||
<customrules>
|
|
||||||
<rule name="ip" type="regex" test="/^(\d{1,3}(?:.(\d{1,3}|\*)){3}\s*(\/\/.*)?[^.]*)*$/" />
|
|
||||||
<rule name="word" type="regex" test="/^((.{2,40}[\r\n]+)*.{2,40})*$/" />
|
|
||||||
</customrules>
|
|
||||||
<fields>
|
|
||||||
<field name="act" required="true" default="procSpamfilterAdminInsertSetting" />
|
|
||||||
</fields>
|
|
||||||
</ruleset>
|
|
||||||
|
|
@ -33,10 +33,10 @@
|
||||||
|
|
||||||
function procSpamfilterAdminInsertDeniedIP(){
|
function procSpamfilterAdminInsertDeniedIP(){
|
||||||
//스팸IP 추가
|
//스팸IP 추가
|
||||||
$ipaddressList = Context::get('ipaddressList');
|
$ipaddress_list = Context::get('ipaddress_list');
|
||||||
$oSpamfilterController = &getController('spamfilter');
|
$oSpamfilterController = &getController('spamfilter');
|
||||||
if($ipaddressList){
|
if($ipaddress_list){
|
||||||
$insertIPOutput = $oSpamfilterController->insertIP($ipaddressList);
|
$insertIPOutput = $oSpamfilterController->insertIP($ipaddress_list);
|
||||||
if(!$insertIPOutput->toBool()) return $insertIPOutput;
|
if(!$insertIPOutput->toBool()) return $insertIPOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,9 +45,9 @@
|
||||||
}
|
}
|
||||||
function procSpamfilterAdminInsertDeniedWord(){
|
function procSpamfilterAdminInsertDeniedWord(){
|
||||||
//스팸 키워드 추가
|
//스팸 키워드 추가
|
||||||
$wordList = Context::get('wordList');
|
$word_list = Context::get('word_list');
|
||||||
if($wordList){
|
if($word_list){
|
||||||
$insertWordOutput = $this->insertWord($wordList);
|
$insertWordOutput = $this->insertWord($word_list);
|
||||||
if(!$insertWordOutput->toBool()) return $insertWordOutput;
|
if(!$insertWordOutput->toBool()) return $insertWordOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,10 +93,10 @@
|
||||||
* @brief Register the spam word
|
* @brief Register the spam word
|
||||||
* The post, which contains the newly registered spam word, should be considered as a spam
|
* The post, which contains the newly registered spam word, should be considered as a spam
|
||||||
**/
|
**/
|
||||||
function insertWord($wordList) {
|
function insertWord($word_list) {
|
||||||
$wordList = str_replace("\r","",$wordList);
|
$word_list = str_replace("\r","",$word_list);
|
||||||
$wordList = explode("\n",$wordList);
|
$word_list = explode("\n",$word_list);
|
||||||
foreach($wordList as $wordKey => $word) {
|
foreach($word_list as $word) {
|
||||||
if(trim($word)) $args->word = $word;
|
if(trim($word)) $args->word = $word;
|
||||||
$output = executeQuery('spamfilter.insertDeniedWord', $args);
|
$output = executeQuery('spamfilter.insertDeniedWord', $args);
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
|
|
||||||
|
|
@ -136,11 +136,10 @@
|
||||||
* @brief IP registration
|
* @brief IP registration
|
||||||
* The registered IP address is considered as a spammer
|
* The registered IP address is considered as a spammer
|
||||||
**/
|
**/
|
||||||
function insertIP($ipaddressList, $description = null) {
|
function insertIP($ipaddress_list, $description = null) {
|
||||||
//리눅스시.. 변환부분 체크하는 것 다시 봐야할 듯.
|
$ipaddress_list = str_replace("\r","",$ipaddress_list);
|
||||||
$ipaddressList = str_replace("\r","",$ipaddressList);
|
$ipaddress_list = explode("\n",$ipaddress_list);
|
||||||
$ipaddressList = explode("\n",$ipaddressList);
|
foreach($ipaddress_list as $ipaddressValue) {
|
||||||
foreach($ipaddressList as $ipaddressKey => $ipaddressValue) {
|
|
||||||
preg_match("/(\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/\s*(.*))?/",$ipaddressValue,$matches);
|
preg_match("/(\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/\s*(.*))?/",$ipaddressValue,$matches);
|
||||||
if($ipaddress=trim($matches[1])) {
|
if($ipaddress=trim($matches[1])) {
|
||||||
$args->ipaddress = $ipaddress;
|
$args->ipaddress = $ipaddress;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
<script>
|
|
||||||
</script>
|
|
||||||
<load target="js/spamfilter_admin.js" usecdn="true" />
|
<load target="js/spamfilter_admin.js" usecdn="true" />
|
||||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||||
|
|
@ -55,7 +53,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<p class="a">
|
<p class="a">
|
||||||
<textarea rows="8" cols="42" name="ipaddressList" title="스팸 IP 추가"></textarea>
|
<textarea rows="8" cols="42" name="ipaddress_list" title="스팸 IP 추가"></textarea>
|
||||||
<span class="btn small"><button type="button" onclick="doInsertDeniedIP('{$lang->msg_invalid_format}')">{$lang->cmd_insert}</button></span>
|
<span class="btn small"><button type="button" onclick="doInsertDeniedIP('{$lang->msg_invalid_format}')">{$lang->cmd_insert}</button></span>
|
||||||
<span class="desc">{$lang->about_denied_ip}</span>
|
<span class="desc">{$lang->about_denied_ip}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -70,7 +68,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<p class="a">
|
<p class="a">
|
||||||
<textarea rows="8" cols="42" name="wordList" title="스팸 키워드 추가"></textarea>
|
<textarea rows="8" cols="42" name="word_list" title="스팸 키워드 추가"></textarea>
|
||||||
<span class="btn small"><button type="button" onclick="doInsertDeniedWord('{$lang->msg_invalid_format}')">{$lang->add}</button></span>
|
<span class="btn small"><button type="button" onclick="doInsertDeniedWord('{$lang->msg_invalid_format}')">{$lang->add}</button></span>
|
||||||
<span class="desc">{$lang->about_denied_word}</span>
|
<span class="desc">{$lang->about_denied_word}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue