Close Connection when there is no connection value.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13161 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2013-09-25 15:29:32 +00:00
parent 034a5c0288
commit f70ce644ce
1410 changed files with 7188 additions and 53541 deletions

View file

@ -22,11 +22,11 @@
<action name="dispSpamfilterAdminDeniedWordList" type="view" standalone="true" menu_name="spamFilter" />
<action name="dispSpamfilterAdminConfigBlock" type="view" standalone="true" menu_name="spamFilter" />
<action name="procSpamfilterAdminInsertDeniedIP" type="controller" standalone="true" ruleset="insertDeniedIp" />
<action name="procSpamfilterAdminInsertDeniedIP" type="controller" standalone="true" />
<action name="procSpamfilterAdminInsertDeniedWord" type="controller" standalone="true" />
<action name="procSpamfilterAdminDeleteDeniedIP" type="controller" standalone="true" ruleset="deleteDeniedIp" />
<action name="procSpamfilterAdminDeleteDeniedWord" type="controller" standalone="true" ruleset="deleteDeniedWord" />
<action name="procSpamfilterAdminDeleteDeniedIP" type="controller" standalone="true" />
<action name="procSpamfilterAdminDeleteDeniedWord" type="controller" standalone="true" />
<action name="procSpamfilterAdminInsertConfig" type="controller" standalone="true" ruleset="insertConfig" />
</actions>

View file

@ -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*(\/\/[^\r\n]*)?[\r\n]*)*$/" />
</customrules>
<fields>
<field name="act" required="true" default="procSpamfilterAdminDeleteDeniedIP" />
<field name="ipaddress" required="true" rule="ip" />
</fields>
</ruleset>

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
<rule name="word" type="regex" test="/^(.{2,40}[\r\n]+)*.{2,40}$/" />
</customrules>
<fields>
<field name="act" required="true" default="procSpamfilterAdminDeleteDeniedWord" />
<field name="word" required="true" rule="word" />
</fields>
</ruleset>

View file

@ -39,10 +39,11 @@ class spamfilterAdminController extends spamfilter
{
$output = $oSpamfilterController->insertIP($ipaddress_list);
if(!$output->toBool() && !$output->get('fail_list')) return $output;
if($output->get('fail_list')) $message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).'</em>';
$this->setMessage(Context::getLang('success_registed').$message_fail);
}
if($output->get('fail_list')) $message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).'</em>';
$this->setMessage(Context::getLang('success_registed').$message_fail);
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedIPList');
$this->setRedirectUrl($returnUrl);
@ -56,9 +57,10 @@ class spamfilterAdminController extends spamfilter
{
$output = $this->insertWord($word_list);
if(!$output->toBool() && !$output->get('fail_list')) return $output;
if($output->get('fail_list')) $message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).'</em>';
$this->setMessage(Context::getLang('success_registed').$message_fail);
}
if($output->get('fail_list')) $message_fail = '<em>'.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).'</em>';
$this->setMessage(Context::getLang('success_registed').$message_fail);
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedWordList');
$this->setRedirectUrl($returnUrl);
@ -70,7 +72,7 @@ class spamfilterAdminController extends spamfilter
function procSpamfilterAdminDeleteDeniedIP()
{
$ipAddressList = Context::get('ipaddress');
$this->deleteIP($ipAddressList);
if($ipAddressList) $this->deleteIP($ipAddressList);
$this->setMessage(Context::getLang('success_deleted'));

View file

@ -9,6 +9,7 @@
<input type="hidden" name="act" value="procSpamfilterAdminInsertConfig" />
<input type="hidden" name="module" value="spamfilter" />
<input type="hidden" name="ruleset" value="insertConfig" />
<input type="hidden" name="xe_validator_id" value="modules/spamfilter/tpl/1" />
<div class="x_control-group">
<p><strong>{$lang->cmd_interval}</strong></p>
<label for="spamCond1_yes" class="x_inline">

View file

@ -8,6 +8,7 @@
<form action="./" method="post">
<input type="hidden" name="act" value="procSpamfilterAdminDeleteDeniedIP" />
<input type="hidden" name="module" value="spamfilter" />
<input type="hidden" name="xe_validator_id" value="modules/spamfilter/tpl/1" />
<table class="x_table x_table-striped x_table-hover">
<caption>
<strong>{$lang->cmd_denied_ip}</strong>
@ -34,10 +35,10 @@
</tbody>
</table>
</form>
<form action="./" style="margin-right:14px">
<form action="./" style="margin-right:14px" method="post">
<input type="hidden" name="act" value="procSpamfilterAdminInsertDeniedIP" />
<input type="hidden" name="module" value="spamfilter" />
<input type="hidden" name="ruleset" value="insertDeniedIp" />
<input type="hidden" name="xe_validator_id" value="modules/spamfilter/tpl/1" />
<input type="hidden" name="active" value="ip" />
<textarea name="ipaddress_list" title="{$lang->add_denied_ip}: {$lang->about_denied_ip}" rows="4" cols="42" style="width:100%" placeholder="{$lang->about_denied_ip}"></textarea>
<span class="x_pull-right" style="margin-right:-14px">

View file

@ -8,6 +8,7 @@
<form action="./" method="post">
<input type="hidden" name="act" value="procSpamfilterAdminDeleteDeniedWord" />
<input type="hidden" name="module" value="spamfilter" />
<input type="hidden" name="xe_validator_id" value="modules/spamfilter/tpl/1" />
<table class="x_table x_table-striped x_table-hover">
<caption>
<strong>{$lang->cmd_denied_word}</strong>
@ -25,7 +26,7 @@
<tbody>
<tr loop="$word_list => $word_info">
<td>{$word_info->word}</td>
<td><!--@if($word_info->latest_hit)-->{$word_info->latest_hit}<!--@else-->-<!--@end--></td>
<td><!--@if($word_info->latest_hit)-->{zdate($word_info->latest_hit,'Y-m-d H:i')}<!--@else-->-<!--@end--></td>
<td>{$word_info->hit}</td>
<td>{zdate($word_info->regdate,'Y-m-d')}</td>
<td><input type="checkbox" name="word[]" value="{$word_info->word}" /></td>
@ -36,11 +37,11 @@
</tbody>
</table>
</form>
<form action="./" style="margin-right:14px">
<form action="./" style="margin-right:14px" method="post">
<input type="hidden" name="act" value="procSpamfilterAdminInsertDeniedWord" />
<input type="hidden" name="module" value="spamfilter" />
<input type="hidden" name="ruleset" value="insertDeniedWord" />
<input type="hidden" name="active" value="word" />
<input type="hidden" name="xe_validator_id" value="modules/spamfilter/tpl/1" />
<textarea name="word_list" title="{$lang->add_denied_word}: {$lang->about_denied_word}" placeholder="{$lang->about_denied_word}" rows="4" cols="42" style="width:100%"></textarea>
<span class="x_pull-right" style="margin-right:-14px">
<button type="submit" class="x_btn x_btn-primary">{$lang->add_denied_word}</button>

View file

@ -1,8 +0,0 @@
<form id="spamfilterDelete" action="" method="post">
<input type="hidden" name="module" value="spamfilter" />
<input type="hidden" name="act" value="" />
<input type="hidden" name="ipaddress" value="" />
<input type="hidden" name="word" value="" />
<input type="hidden" name="ruleset" value="">
</form>

View file

@ -1,7 +1,7 @@
<load target="js/spamfilter_admin.js" usecdn="true" />
<div class="x_page-header">
<h1>{$lang->spamfilter} <a class="x_icon-question-sign" href="./help/index.html#UMAN_content_spamfilter" target="_blank">{$lang->help}</a></h1>
<h1>{$lang->spamfilter} <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_content_spamfilter" target="_blank">{$lang->help}</a></h1>
</div>
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/spamfilter/tpl/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>

View file

@ -5,7 +5,6 @@ function doDeleteDeniedIP(ipaddress) {
var fo_obj = get_by_id('spamfilterDelete');
fo_obj.ipaddress.value = ipaddress;
fo_obj.act.value = "procSpamfilterAdminDeleteDeniedIP";
fo_obj.ruleset.value = 'deleteDeniedIp';
fo_obj.submit();
}
@ -16,6 +15,5 @@ function doDeleteDeniedWord(word) {
var fo_obj = get_by_id('spamfilterDelete');
fo_obj.word.value = word;
fo_obj.act.value = "procSpamfilterAdminDeleteDeniedWord";
fo_obj.ruleset.value = 'deleteDeniedWord';
fo_obj.submit();
}