mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +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());
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@
|
|||
$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->getIpAddress());
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
<action name="procSpamfilterAdminDeleteDeniedIP" type="controller" standalone="true" ruleset="deleteDeniedIp" />
|
||||
<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>
|
||||
</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(){
|
||||
//스팸IP 추가
|
||||
$ipaddressList = Context::get('ipaddressList');
|
||||
$ipaddress_list = Context::get('ipaddress_list');
|
||||
$oSpamfilterController = &getController('spamfilter');
|
||||
if($ipaddressList){
|
||||
$insertIPOutput = $oSpamfilterController->insertIP($ipaddressList);
|
||||
if($ipaddress_list){
|
||||
$insertIPOutput = $oSpamfilterController->insertIP($ipaddress_list);
|
||||
if(!$insertIPOutput->toBool()) return $insertIPOutput;
|
||||
}
|
||||
|
||||
|
|
@ -45,9 +45,9 @@
|
|||
}
|
||||
function procSpamfilterAdminInsertDeniedWord(){
|
||||
//스팸 키워드 추가
|
||||
$wordList = Context::get('wordList');
|
||||
if($wordList){
|
||||
$insertWordOutput = $this->insertWord($wordList);
|
||||
$word_list = Context::get('word_list');
|
||||
if($word_list){
|
||||
$insertWordOutput = $this->insertWord($word_list);
|
||||
if(!$insertWordOutput->toBool()) return $insertWordOutput;
|
||||
}
|
||||
|
||||
|
|
@ -93,10 +93,10 @@
|
|||
* @brief Register the spam word
|
||||
* The post, which contains the newly registered spam word, should be considered as a spam
|
||||
**/
|
||||
function insertWord($wordList) {
|
||||
$wordList = str_replace("\r","",$wordList);
|
||||
$wordList = explode("\n",$wordList);
|
||||
foreach($wordList as $wordKey => $word) {
|
||||
function insertWord($word_list) {
|
||||
$word_list = str_replace("\r","",$word_list);
|
||||
$word_list = explode("\n",$word_list);
|
||||
foreach($word_list as $word) {
|
||||
if(trim($word)) $args->word = $word;
|
||||
$output = executeQuery('spamfilter.insertDeniedWord', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
|
|||
|
|
@ -136,11 +136,10 @@
|
|||
* @brief IP registration
|
||||
* The registered IP address is considered as a spammer
|
||||
**/
|
||||
function insertIP($ipaddressList, $description = null) {
|
||||
//리눅스시.. 변환부분 체크하는 것 다시 봐야할 듯.
|
||||
$ipaddressList = str_replace("\r","",$ipaddressList);
|
||||
$ipaddressList = explode("\n",$ipaddressList);
|
||||
foreach($ipaddressList as $ipaddressKey => $ipaddressValue) {
|
||||
function insertIP($ipaddress_list, $description = null) {
|
||||
$ipaddress_list = str_replace("\r","",$ipaddress_list);
|
||||
$ipaddress_list = explode("\n",$ipaddress_list);
|
||||
foreach($ipaddress_list as $ipaddressValue) {
|
||||
preg_match("/(\d{1,3}(?:.(\d{1,3}|\*)){3})\s*(\/\/\s*(.*))?/",$ipaddressValue,$matches);
|
||||
if($ipaddress=trim($matches[1])) {
|
||||
$args->ipaddress = $ipaddress;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
<script>
|
||||
</script>
|
||||
<load target="js/spamfilter_admin.js" usecdn="true" />
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
|
|
@ -55,7 +53,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
<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="desc">{$lang->about_denied_ip}</span>
|
||||
</p>
|
||||
|
|
@ -70,7 +68,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
<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="desc">{$lang->about_denied_word}</span>
|
||||
</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue