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:
ovclas 2011-06-30 06:10:34 +00:00
parent 84bd81ab40
commit 60d7f6fb84
11 changed files with 91 additions and 23 deletions

View file

@ -23,6 +23,11 @@
// Create and insert the module Controller object
$oModuleController = &getController('module');
$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;
}
@ -42,7 +47,13 @@
**/
function procSpamfilterAdminDeleteDeniedIP() {
$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() {
$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() {
$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;
}
/**