git-svn-id: http://xe-core.googlecode.com/svn/trunk@242 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-05 07:16:51 +00:00
parent bec327d337
commit a4e2f31a53
6 changed files with 83 additions and 17 deletions

View file

@ -2,7 +2,9 @@
<module> <module>
<grants /> <grants />
<actions> <actions>
<action name="dispContent" type="view" admin_index="true" standalone="true" /> <action name="dispConfig" type="view" admin_index="true" standalone="true" />
<action name="dispDeniedIPList" type="view" standalone="true" />
<action name="dispDeniedWordList" type="view" standalone="true" />
<action name="procInsertDeniedIP" type="controller" standalone="true" /> <action name="procInsertDeniedIP" type="controller" standalone="true" />
<action name="procDeleteDeniedIP" type="controller" standalone="true" /> <action name="procDeleteDeniedIP" type="controller" standalone="true" />

View file

@ -1,4 +1,4 @@
<query id="getSpammerList" action="select"> <query id="getDeniedIPList" action="select">
<tables> <tables>
<table name="spamfilter_denied_ip" /> <table name="spamfilter_denied_ip" />
</tables> </tables>

View file

@ -13,6 +13,38 @@
function init() { function init() {
} }
/**
* @brief 금지 IP등록
**/
function procInsertDeniedIP() {
$ipaddress = Context::get('ipaddress');
return $this->insertIP($ipaddress);
}
/**
* @brief 금지 IP삭제
**/
function procDeleteDeniedIP() {
$ipaddress = Context::get('ipaddress');
return $this->deleteIP($ipaddress);
}
/**
* @brief 금지 Word등록
**/
function procInsertDeniedWord() {
$word = Context::get('word');
return $this->insertWord($word);
}
/**
* @brief 금지 Word삭제
**/
function procDeleteDeniedWord() {
$word = Context::get('word');
return $this->deleteWord($word);
}
/** /**
* @brief IP 등록 * @brief IP 등록
* 등록된 IP는 스패머로 간주 * 등록된 IP는 스패머로 간주

View file

@ -14,13 +14,26 @@
} }
/** /**
* @brief 등록된 스패머목록을 return * @brief 등록된 금지 IP목록을 return
**/ **/
function getSpammerList() { function getDeniedIPList() {
$oDB = &DB::getInstance(); $oDB = &DB::getInstance();
$args->sort_index = "regdate"; $args->sort_index = "regdate";
$args->page = Context::get('page')?Context::get('page'):1; $args->page = Context::get('page')?Context::get('page'):1;
$output = $oDB->executeQuery('spamfilter.getSpammerList', $args); $output = $oDB->executeQuery('spamfilter.getDeniedIPList', $args);
if(!$output->data) return;
if(!is_array($output->data)) return array($output->data);
return $output->data;
}
/**
* @brief 등록된 금지 Word 목록을 return
**/
function getDeniedWordList() {
$oDB = &DB::getInstance();
$args->sort_index = "regdate";
$args->page = Context::get('page')?Context::get('page'):1;
$output = $oDB->executeQuery('spamfilter.getDeniedWordList', $args);
if(!$output->data) return; if(!$output->data) return;
if(!is_array($output->data)) return array($output->data); if(!is_array($output->data)) return array($output->data);
return $output->data; return $output->data;

View file

@ -16,20 +16,39 @@
} }
/** /**
* @brief 관리자 모드에서 보여줄 화면 * @brief 스팸필터의 설정 화면
**/ **/
function dispContent() { function dispConfig() {
// 등록된 스패머의 목록을 가져옴
$oSpamFilterModel = &getModel('spamfilter');
$spammer_list = $oSpamFilterModel->getSpammerList();
Context::set('spammer_list', $spammer_list);
Context::set('total_count', count($spammer_list));
// 템플릿 파일 지정 // 템플릿 파일 지정
$this->setTemplateFile('index'); $this->setTemplateFile('index');
} }
/**
* @brief 금지 목록 출력
**/
function dispDeniedIPList() {
// 등록된 금지 IP 목록을 가져옴
$oSpamFilterModel = &getModel('spamfilter');
$ip_list = $oSpamFilterModel->getDeniedIPList();
Context::set('ip_list', $ip_list);
// 템플릿 파일 지정
$this->setTemplateFile('denied_ip_list');
}
/**
* @brief 금지 목록 출력
**/
function dispDeniedWordList() {
// 등록된 금지 Word 목록을 가져옴
$oSpamFilterModel = &getModel('spamfilter');
$word_list = $oSpamFilterModel->getDeniedWordList();
Context::set('word_list', $word_list);
// 템플릿 파일 지정
$this->setTemplateFile('denied_word_list');
}
} }
?> ?>

View file

@ -1,5 +1,5 @@
<div style="margin-bottom:20px;"> <div style="margin-bottom:20px;">
<span <!--@if($act=='dispConfig')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispModuleConfig','module_srl','')}">{$lang->cmd_module_config}</a>]</span> <span <!--@if($act=='dispConfig')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispConfig','module_srl','')}">{$lang->cmd_module_config}</a>]</span>
<span <!--@if($act=='dispDeniedIP')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispDeniedIP')}">{$lang->cmd_denied_ip}</a>]</span> <span <!--@if($act=='dispDeniedIPList')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispDeniedIPList')}">{$lang->cmd_denied_ip}</a>]</span>
<span <!--@if($act=='dispDeniedWord')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispDeniedWord')}">{$lang->cmd_denied_word}</a>]</span> <span <!--@if($act=='dispDeniedWordList')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispDeniedWordList')}">{$lang->cmd_denied_word}</a>]</span>
</div> </div>