mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
issue 46 apply validator to spamfilter module
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8553 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
84bd81ab40
commit
60d7f6fb84
11 changed files with 91 additions and 23 deletions
|
|
@ -7,10 +7,10 @@
|
||||||
<action name="dispSpamfilterAdminDeniedIPList" type="view" standalone="true" />
|
<action name="dispSpamfilterAdminDeniedIPList" type="view" standalone="true" />
|
||||||
<action name="dispSpamfilterAdminDeniedWordList" type="view" standalone="true" />
|
<action name="dispSpamfilterAdminDeniedWordList" type="view" standalone="true" />
|
||||||
|
|
||||||
<action name="procSpamfilterAdminInsertConfig" type="controller" standalone="true" />
|
<action name="procSpamfilterAdminInsertConfig" type="controller" standalone="true" ruleset="insertConfig" />
|
||||||
<action name="procSpamfilterAdminInsertDeniedIP" type="controller" standalone="true" />
|
<action name="procSpamfilterAdminInsertDeniedIP" type="controller" standalone="true" ruleset="insertDeniedIp" />
|
||||||
<action name="procSpamfilterAdminDeleteDeniedIP" type="controller" standalone="true" />
|
<action name="procSpamfilterAdminDeleteDeniedIP" type="controller" standalone="true" ruleset="deleteDeniedIp" />
|
||||||
<action name="procSpamfilterAdminInsertDeniedWord" type="controller" standalone="true" />
|
<action name="procSpamfilterAdminInsertDeniedWord" type="controller" standalone="true" ruleset="insertDeniedWord" />
|
||||||
<action name="procSpamfilterAdminDeleteDeniedWord" type="controller" standalone="true" />
|
<action name="procSpamfilterAdminDeleteDeniedWord" type="controller" standalone="true" ruleset="deleteDeniedWord" />
|
||||||
</actions>
|
</actions>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
||||||
10
modules/spamfilter/ruleset/deleteDeniedIp.xml
Normal file
10
modules/spamfilter/ruleset/deleteDeniedIp.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ruleset version="1.5.0">
|
||||||
|
<customrules>
|
||||||
|
<rule name="ip" type="regex" test="/((0|1[0-9]{0,2}|2[0-4][0-9]|25[0-5])|\*)(\.((0|1[0-9]{0,2}|2[0-4][0-9]|25[0-5])|\*)){3}/" />
|
||||||
|
</customrules>
|
||||||
|
<fields>
|
||||||
|
<field name="act" required="true" default="procSpamfilterAdminDeleteDeniedIP" />
|
||||||
|
<field name="ipaddress" required="true" rule="ip" />
|
||||||
|
</fields>
|
||||||
|
</ruleset>
|
||||||
9
modules/spamfilter/ruleset/deleteDeniedWord.xml
Normal file
9
modules/spamfilter/ruleset/deleteDeniedWord.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ruleset version="1.5.0">
|
||||||
|
<customrules>
|
||||||
|
</customrules>
|
||||||
|
<fields>
|
||||||
|
<field name="act" required="true" default="procSpamfilterAdminDeleteDeniedWord" />
|
||||||
|
<field name="word" required="true" length="1:250" />
|
||||||
|
</fields>
|
||||||
|
</ruleset>
|
||||||
9
modules/spamfilter/ruleset/insertConfig.xml
Normal file
9
modules/spamfilter/ruleset/insertConfig.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ruleset version="1.5.0">
|
||||||
|
<customrules>
|
||||||
|
</customrules>
|
||||||
|
<fields>
|
||||||
|
<field name="interval" required="true" rule="number" default="0" />
|
||||||
|
<field name="limit_count" required="true" rule="number" default="5" />
|
||||||
|
</fields>
|
||||||
|
</ruleset>
|
||||||
9
modules/spamfilter/ruleset/insertDeniedIp.xml
Normal file
9
modules/spamfilter/ruleset/insertDeniedIp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ruleset version="1.5.0">
|
||||||
|
<customrules>
|
||||||
|
<rule name="ip" type="regex" test="/((0|1[0-9]{0,2}|2[0-4][0-9]|25[0-5])|\*)(\.((0|1[0-9]{0,2}|2[0-4][0-9]|25[0-5])|\*)){3}/" />
|
||||||
|
</customrules>
|
||||||
|
<fields>
|
||||||
|
<field name="ipaddress" required="true" rule="ip" />
|
||||||
|
</fields>
|
||||||
|
</ruleset>
|
||||||
8
modules/spamfilter/ruleset/insertDeniedWord.xml
Normal file
8
modules/spamfilter/ruleset/insertDeniedWord.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ruleset version="1.5.0">
|
||||||
|
<customrules>
|
||||||
|
</customrules>
|
||||||
|
<fields>
|
||||||
|
<field name="word" required="true" length="1:250" />
|
||||||
|
</fields>
|
||||||
|
</ruleset>
|
||||||
|
|
@ -23,6 +23,11 @@
|
||||||
// Create and insert the module Controller object
|
// Create and insert the module Controller object
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
$output = $oModuleController->insertModuleConfig('spamfilter',$args);
|
$output = $oModuleController->insertModuleConfig('spamfilter',$args);
|
||||||
|
if($output->toBool() && !in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||||
|
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminConfig');
|
||||||
|
header('location:'.$returnUrl);
|
||||||
|
return;
|
||||||
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,7 +47,13 @@
|
||||||
**/
|
**/
|
||||||
function procSpamfilterAdminDeleteDeniedIP() {
|
function procSpamfilterAdminDeleteDeniedIP() {
|
||||||
$ipaddress = Context::get('ipaddress');
|
$ipaddress = Context::get('ipaddress');
|
||||||
return $this->deleteIP($ipaddress);
|
$output = $this->deleteIP($ipaddress);
|
||||||
|
if($output->toBool() && !in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||||
|
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedIPList');
|
||||||
|
header('location:'.$returnUrl);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -50,7 +61,13 @@
|
||||||
**/
|
**/
|
||||||
function procSpamfilterAdminInsertDeniedWord() {
|
function procSpamfilterAdminInsertDeniedWord() {
|
||||||
$word = Context::get('word');
|
$word = Context::get('word');
|
||||||
return $this->insertWord($word);
|
$output = $this->insertWord($word);
|
||||||
|
if($output->toBool() && !in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||||
|
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedWordList');
|
||||||
|
header('location:'.$returnUrl);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -58,7 +75,13 @@
|
||||||
**/
|
**/
|
||||||
function procSpamfilterAdminDeleteDeniedWord() {
|
function procSpamfilterAdminDeleteDeniedWord() {
|
||||||
$word = base64_decode(Context::get('word'));
|
$word = base64_decode(Context::get('word'));
|
||||||
return $this->deleteWord($word);
|
$output = $this->deleteWord($word);
|
||||||
|
if($output->toBool() && !in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||||
|
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedWordList');
|
||||||
|
header('location:'.$returnUrl);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
<!--%import("filter/insert_denied_ip.xml")-->
|
|
||||||
<!--%import("filter/delete_denied_ip.xml")-->
|
|
||||||
|
|
||||||
<!--#include("header.html")-->
|
<!--#include("header.html")-->
|
||||||
|
|
||||||
<!-- xml js filter를 이용하기 위한 데이터 전달용 form -->
|
<!-- xml js filter를 이용하기 위한 데이터 전달용 form -->
|
||||||
<form id="fo_denied_ip" action="./" method="get">
|
<form ruleset="deleteDeniedIp" id="fo_denied_ip" action="./" method="post">
|
||||||
|
<input type="hidden" name="act" value="procSpamfilterAdminDeleteDeniedIP" />
|
||||||
<input type="hidden" name="ipaddress" value="" />
|
<input type="hidden" name="ipaddress" value="" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- 수동 추가 -->
|
<!-- 수동 추가 -->
|
||||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_denied_ip)">
|
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||||
|
<form ruleset="insertDeniedIp" action="./" method="post">
|
||||||
|
<input type="hidden" name="act" value="procSpamfilterAdminInsertDeniedIP" />
|
||||||
<table cellspacing="0" class="rowTable">
|
<table cellspacing="0" class="rowTable">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><div>{$lang->denied_ip}</div></th>
|
<th scope="row"><div>{$lang->denied_ip}</div></th>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
<!--#include("header.html")-->
|
<!--#include("header.html")-->
|
||||||
|
|
||||||
<!--%import("filter/insert_denied_word.xml")-->
|
|
||||||
<!--%import("filter/delete_denied_word.xml")-->
|
|
||||||
|
|
||||||
<!-- xml js filter를 이용하기 위한 데이터 전달용 form -->
|
<!-- xml js filter를 이용하기 위한 데이터 전달용 form -->
|
||||||
<form id="fo_denied_word" action="./" method="get">
|
<form ruleset="deleteDeniedWord" id="fo_denied_word" action="./" method="post">
|
||||||
|
<input type="hidden" name="act" value="procSpamfilterAdminDeleteDeniedWord" />
|
||||||
<input type="hidden" name="word" value="" />
|
<input type="hidden" name="word" value="" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- 수동 추가 -->
|
<!-- 수동 추가 -->
|
||||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_denied_word)">
|
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||||
|
<form ruleset="insertDeniedWord" action="./" method="post">
|
||||||
|
<input type="hidden" name="act" value="procSpamfilterAdminInsertDeniedWord" />
|
||||||
<table cellspacing="0" class="rowTable">
|
<table cellspacing="0" class="rowTable">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><div>{$lang->word}</div></th>
|
<th scope="row"><div>{$lang->word}</div></th>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<!--%import("filter/insert_config.xml")-->
|
|
||||||
|
|
||||||
<!--#include("header.html")-->
|
<!--#include("header.html")-->
|
||||||
|
|
||||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_config)">
|
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||||
|
<form ruleset="insertConfig" action="./" method="post">
|
||||||
|
<input type="hidden" name="act" value="procSpamfilterAdminInsertConfig" />
|
||||||
|
|
||||||
<table cellspacing="0" class="rowTable">
|
<table cellspacing="0" class="rowTable">
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
function doDeleteDeniedIP(ipaddress) {
|
function doDeleteDeniedIP(ipaddress) {
|
||||||
var fo_obj = get_by_id('fo_denied_ip');
|
var fo_obj = get_by_id('fo_denied_ip');
|
||||||
fo_obj.ipaddress.value = ipaddress;
|
fo_obj.ipaddress.value = ipaddress;
|
||||||
procFilter(fo_obj, delete_denied_ip);
|
fo_obj.submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -13,5 +13,5 @@ function doDeleteDeniedIP(ipaddress) {
|
||||||
function doDeleteDeniedWord(word) {
|
function doDeleteDeniedWord(word) {
|
||||||
var fo_obj = get_by_id('fo_denied_word');
|
var fo_obj = get_by_id('fo_denied_word');
|
||||||
fo_obj.word.value = word;
|
fo_obj.word.value = word;
|
||||||
procFilter(fo_obj, delete_denied_word);
|
fo_obj.submit();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue