From: <tr...@us...> - 2011-12-03 19:40:20
|
Revision: 8402 http://xoops.svn.sourceforge.net/xoops/?rev=8402&view=rev Author: trabis Date: 2011-12-03 19:40:12 +0000 (Sat, 03 Dec 2011) Log Message: ----------- Moving HTMLPurifier to private folder, removing some unused files Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/ProtectorFilter.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/bruteforce_overrun_message.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/crawler_overrun_message.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/f5attack_overrun_message.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_deny_by_httpbl.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_deny_by_rbl.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_htmlpurify4everyone.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_htmlpurify4guest.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_need_multibyte.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_register_moratorium.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_register_insert_js_check.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_errorlog.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_redirection.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_bwlimit_errorlog.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_bwlimit_message.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/prepurge_exit_message.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/spamcheck_overrun_message.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_enabled/precommon_badip_message.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/xoops_lib/HTMLPurifier/ Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/registry.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/configs/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_message.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/images/module_icon_old.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/library/ Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/ProtectorFilter.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/ProtectorFilter.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/ProtectorFilter.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -24,6 +24,7 @@ // Abstract of each filter classes class ProtectorFilterAbstract { var $protector = null ; + var $errors = array(); function ProtectorFilterAbstract() { Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/registry.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/registry.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/class/registry.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,82 +0,0 @@ -<?php -// Author: Trabis -// URL: http://www.xuups.com -// E-Mail: lus...@gm... - -if (!defined("XOOPS_ROOT_PATH")) { - die("XOOPS root path not defined"); -} - -class ProtectorRegistry -{ - var $_entries; - var $_locks; - - function ProtectorRegistry() - { - $this->_entries = array(); - $this->_locks = array(); - } - - function getInstance() - { - static $instance = false; - if (!$instance) { - $instance = new ProtectorRegistry(); - } - return $instance; - } - - function setEntry($key, $item) - { - if ($this->isLocked($key) == true) { - trigger_error('Unable to set entry `' . $key . '`. Entry is locked.', E_USER_WARNING); - return false; - } - - $this->_entries[$key] = $item; - return true; - } - - function unsetEntry($key) - { - unset($this->_entries[$key]); - } - - function getEntry($key) - { - if (isset($this->_entries[$key]) == false) { - return null; - } - - return $this->_entries[$key]; - } - - function isEntry($key) - { - return ($this->getEntry($key) !== null); - } - - function lockEntry($key) - { - $this->_locks[$key] = true; - return true; - } - - function unlockEntry($key) - { - unset($this->_locks[$key]); - } - - function isLocked($key) - { - return (isset($this->_locks[$key]) == true); - } - - function unsetAll() - { - $this->_entries = array(); - $this->_locks = array(); - } -} -?> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/bruteforce_overrun_message.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/bruteforce_overrun_message.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/bruteforce_overrun_message.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,14 +1,30 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_bruteforce_overrun_message extends ProtectorFilterAbstract { + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - // header( 'Location: http://google.com/' ) ; // redirect somewhere - echo 'You have tried too many wrong loggin in' ; // write any message as you like - exit ; - } +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ -} - -?> \ No newline at end of file +class protector_bruteforce_overrun_message extends ProtectorFilterAbstract +{ + public function execute() + { + // header( 'Location: http://google.com/' ) ; // redirect somewhere + echo 'You have failed to login too many times!'; // write any message as you like + exit; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/crawler_overrun_message.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/crawler_overrun_message.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/crawler_overrun_message.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,14 +1,30 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_crawler_overrun_message extends ProtectorFilterAbstract { + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - // header( 'Location: http://google.com/' ) ; // redirect somewhere - echo 'You have accessed too many times while short term' ; // write any message as you like - exit ; - } +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ -} - -?> \ No newline at end of file +class protector_crawler_overrun_message extends ProtectorFilterAbstract +{ + public function execute() + { + // header( 'Location: http://google.com/' ) ; // redirect somewhere + echo 'You have accessed too many times while short term'; // write any message as you like + exit; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/f5attack_overrun_message.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/f5attack_overrun_message.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/f5attack_overrun_message.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,14 +1,30 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_f5attack_overrun_message extends ProtectorFilterAbstract { + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - // header( 'Location: http://google.com/' ) ; // redirect somewhere - echo 'You have reloaded a page too many times' ; // write any message as you like - exit ; - } +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ -} - -?> \ No newline at end of file +class protector_f5attack_overrun_message extends ProtectorFilterAbstract +{ + function execute() + { + // header( 'Location: http://google.com/' ) ; // redirect somewhere + echo 'You have reloaded a page too many times'; // write any message as you like + exit; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/index.html 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/index.html 2011-12-03 19:40:12 UTC (rev 8402) @@ -1 +1 @@ - <script>history.go(-1);</script> \ No newline at end of file +<script>history.go(-1);</script> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_deny_by_httpbl.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_deny_by_httpbl.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_deny_by_httpbl.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,36 +1,51 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ + // get your 12-character access key from http://www.projecthoneypot.org/ -define( 'PROTECTOR_HTTPBL_KEY' , '............' ) ; +define('PROTECTOR_HTTPBL_KEY', '............'); -class protector_postcommon_post_deny_by_httpbl extends ProtectorFilterAbstract { +class protector_postcommon_post_deny_by_httpbl extends ProtectorFilterAbstract +{ + function execute() + { + $xoops = Xoops::getInstance(); - function execute() - { - // http:bl servers (don't enable too many servers) - $rbls = array( - 'http:BL' => PROTECTOR_HTTPBL_KEY.'.%s.dnsbl.httpbl.org' , - ) ; - - global $xoopsUser ; - - $rev_ip = implode( '.' , array_reverse( explode( '.' , @$_SERVER['REMOTE_ADDR'] ) ) ) ; - // test - // $rev_ip = '162.142.248.125' ; + // http:bl servers (don't enable too many servers) + $rbls = array( + 'http:BL' => PROTECTOR_HTTPBL_KEY . '.%s.dnsbl.httpbl.org', + ); - foreach( $rbls as $rbl_name => $rbl_fmt ) { - $host = sprintf( $rbl_fmt , $rev_ip ) ; - if( gethostbyname( $host ) != $host ) { - $this->protector->message .= "DENY by $rbl_name\n" ; - $uid = is_object( $xoopsUser ) ? $xoopsUser->getVar('uid') : 0 ; - $this->protector->output_log( 'RBL SPAM' , $uid , false , 128 ) ; - die( _MD_PROTECTOR_DENYBYRBL ) ; - } - } - - return true ; - } + $rev_ip = implode('.', array_reverse(explode('.', @$_SERVER['REMOTE_ADDR']))); + // test + // $rev_ip = '162.142.248.125' ; -} - -?> \ No newline at end of file + foreach ($rbls as $rbl_name => $rbl_fmt) { + $host = sprintf($rbl_fmt, $rev_ip); + if (gethostbyname($host) != $host) { + $this->protector->message .= "DENY by $rbl_name\n"; + $uid = $xoops->isUser() ? $xoops->user->getVar('uid') : 0; + $this->protector->output_log('RBL SPAM', $uid, false, 128); + die(_MD_PROTECTOR_DENYBYRBL); + } + } + return true; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_deny_by_rbl.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_deny_by_rbl.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_deny_by_rbl.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,38 +1,54 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_postcommon_post_deny_by_rbl extends ProtectorFilterAbstract { + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - // RBL servers (don't enable too many servers) - $rbls = array( - 'sbl-xbl.spamhaus.org' , -# 'niku.2ch.net' , -# 'list.dsbl.org' , -# 'bl.spamcop.net' , -# 'all.rbl.jp' , -# 'opm.blitzed.org' , -# 'bsb.empty.us' , -# 'bsb.spamlookup.net' , - ) ; - - global $xoopsUser ; - - $rev_ip = implode( '.' , array_reverse( explode( '.' , @$_SERVER['REMOTE_ADDR'] ) ) ) ; - - foreach( $rbls as $rbl ) { - $host = $rev_ip . '.' . $rbl ; - if( gethostbyname( $host ) != $host ) { - $this->protector->message .= "DENY by $rbl\n" ; - $uid = is_object( $xoopsUser ) ? $xoopsUser->getVar('uid') : 0 ; - $this->protector->output_log( 'RBL SPAM' , $uid , false , 128 ) ; - die( _MD_PROTECTOR_DENYBYRBL ) ; - } - } - - return true ; - } +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ -} +class protector_postcommon_post_deny_by_rbl extends ProtectorFilterAbstract +{ + function execute() + { + // RBL servers (don't enable too many servers) + $rbls = array( + 'sbl-xbl.spamhaus.org', + # 'niku.2ch.net' , + # 'list.dsbl.org' , + # 'bl.spamcop.net' , + # 'all.rbl.jp' , + # 'opm.blitzed.org' , + # 'bsb.empty.us' , + # 'bsb.spamlookup.net' , + ); -?> \ No newline at end of file + global $xoopsUser; + + $rev_ip = implode('.', array_reverse(explode('.', @$_SERVER['REMOTE_ADDR']))); + + foreach ($rbls as $rbl) { + $host = $rev_ip . '.' . $rbl; + if (gethostbyname($host) != $host) { + $this->protector->message .= "DENY by $rbl\n"; + $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0; + $this->protector->output_log('RBL SPAM', $uid, false, 128); + die(_MD_PROTECTOR_DENYBYRBL); + } + } + + return true; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_htmlpurify4everyone.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_htmlpurify4everyone.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_htmlpurify4everyone.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,50 +1,50 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_postcommon_post_htmlpurify4everyone extends ProtectorFilterAbstract { - var $purifier ; - var $method ; + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - // HTMLPurifier runs with PHP5 only - if( version_compare( PHP_VERSION , '5.0.0' ) < 0 ) { - die( 'Turn postcommon_post_htmlpurify4everyone.php off because this filter cannot run with PHP4' ) ; - } +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ - if( file_exists( XOOPS_ROOT_PATH.'/class/icms.htmlpurifier.php' ) ) { - // use HTMLPurifier inside ImpressCMS - if( ! class_exists( 'icms_HTMLPurifier' ) ) { - require_once ICMS_ROOT_PATH.'/class/icms.htmlpurifier.php' ; - } -// $pure = icms_HTMLPurifier::getPurifierInstance() ; -// $_POST = $pure->icms_html_purifier( $_POST , 'protector' ) ; - $this->purifier = icms_HTMLPurifier::getPurifierInstance() ; - $this->method = 'icms_html_purifier' ; +class protector_postcommon_post_htmlpurify4everyone extends ProtectorFilterAbstract +{ + var $purifier; - } else { - // use HTMLPurifier inside Protector - require_once dirname(dirname(__FILE__)).'/library/HTMLPurifier.auto.php' ; - $config = HTMLPurifier_Config::createDefault(); - $config->set('Cache', 'SerializerPath', XOOPS_TRUST_PATH.'/modules/protector/configs'); - $config->set('Core', 'Encoding', _CHARSET); - //$config->set('HTML', 'Doctype', 'HTML 4.01 Transitional'); - $this->purifier = new HTMLPurifier($config); - $this->method = 'purify' ; - } + var $method; - $_POST = $this->purify_recursive( $_POST ) ; - } + function execute() + { + $xoops = Xoops::getInstance(); + // use HTMLPurifier inside Protector + require_once $xoops->path('lib/HTMLPurifier/HTMLPurifier.auto.php'); + $config = HTMLPurifier_Config::createDefault(); + $config->set('Cache', 'SerializerPath', XOOPS_PATH); + $config->set('Core', 'Encoding', _CHARSET); + //$config->set('HTML', 'Doctype', 'HTML 4.01 Transitional'); + $this->purifier = new HTMLPurifier($config); + $this->method = 'purify'; + $_POST = $this->purify_recursive($_POST); + } - - function purify_recursive( $data ) - { - if( is_array( $data ) ) { - return array_map( array( $this , 'purify_recursive' ) , $data ) ; - } else { - return strlen( $data ) > 32 ? call_user_func( array( $this->purifier , $this->method ) , $data ) : $data ; - } - } - -} - -?> \ No newline at end of file + function purify_recursive($data) + { + if (is_array($data)) { + return array_map(array($this, 'purify_recursive'), $data); + } else { + return strlen($data) > 32 ? call_user_func(array($this->purifier, $this->method), $data) : $data; + } + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_htmlpurify4guest.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_htmlpurify4guest.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_htmlpurify4guest.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,56 +1,57 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_postcommon_post_htmlpurify4guest extends ProtectorFilterAbstract { - var $purifier ; - var $method ; + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - global $xoopsUser ; +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ - // HTMLPurifier runs with PHP5 only - if( version_compare( PHP_VERSION , '5.0.0' ) < 0 ) { - die( 'Turn postcommon_post_htmlpurify4guest.php off because this filter cannot run with PHP4' ) ; - } +class protector_postcommon_post_htmlpurify4guest extends ProtectorFilterAbstract +{ + var $purifier; - if( is_object( $xoopsUser ) ) { - return true ; - } + var $method; - if( file_exists( XOOPS_ROOT_PATH.'/class/icms.htmlpurifier.php' ) ) { - // use HTMLPurifier inside ImpressCMS - if( ! class_exists( 'icms_HTMLPurifier' ) ) { - require_once ICMS_ROOT_PATH.'/class/icms.htmlpurifier.php' ; - } -// $pure = icms_HTMLPurifier::getPurifierInstance() ; -// $_POST = $pure->icms_html_purifier( $_POST , 'protector' ) ; - $this->purifier = icms_HTMLPurifier::getPurifierInstance() ; - $this->method = 'icms_html_purifier' ; + function execute() + { + $xoops = Xoops::getInstance(); - } else { - // use HTMLPurifier inside Protector - require_once dirname(dirname(__FILE__)).'/library/HTMLPurifier.auto.php' ; - $config = HTMLPurifier_Config::createDefault(); - $config->set('Cache', 'SerializerPath', XOOPS_TRUST_PATH.'/modules/protector/configs'); - $config->set('Core', 'Encoding', _CHARSET); - //$config->set('HTML', 'Doctype', 'HTML 4.01 Transitional'); - $this->purifier = new HTMLPurifier($config); - $this->method = 'purify' ; - } + if ($xoops->isUser()) { + return true; + } - $_POST = $this->purify_recursive( $_POST ) ; - } + // use HTMLPurifier inside Protector + require_once $xoops->path('lib/HTMLPurifier/HTMLPurifier.auto.php'); + $config = HTMLPurifier_Config::createDefault(); + $config->set('Cache', 'SerializerPath', XOOPS_PATH); + $config->set('Core', 'Encoding', _CHARSET); + //$config->set('HTML', 'Doctype', 'HTML 4.01 Transitional'); + $this->purifier = new HTMLPurifier($config); + $this->method = 'purify'; + $_POST = $this->purify_recursive($_POST); + return true; + } - function purify_recursive( $data ) - { - if( is_array( $data ) ) { - return array_map( array( $this , 'purify_recursive' ) , $data ) ; - } else { - return strlen( $data ) > 32 ? call_user_func( array( $this->purifier , $this->method ) , $data ) : $data ; - } - } - -} - -?> \ No newline at end of file + function purify_recursive($data) + { + if (is_array($data)) { + return array_map(array($this, 'purify_recursive'), $data); + } else { + return strlen($data) > 32 ? call_user_func(array($this->purifier, $this->method), $data) : $data; + } + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_need_multibyte.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_need_multibyte.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_need_multibyte.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,43 +1,65 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ + // Don't enable this for site using single-byte // Perhaps, japanese, schinese, tchinese, and korean can use it -class protector_postcommon_post_need_multibyte extends ProtectorFilterAbstract { +class protector_postcommon_post_need_multibyte extends ProtectorFilterAbstract +{ + function execute() + { + $xoops = Xoops::getInstance(); - function execute() - { - global $xoopsUser ; - - if( ! function_exists( 'mb_strlen' ) ) return true ; - - // registered users always pass this plugin - if( is_object( $xoopsUser ) ) return true ; - - $lengths = array( - 0 => 100 , // default value - 'message' => 2 , - 'com_text' => 2 , - 'excerpt' => 2 , - ) ; - - foreach( $_POST as $key => $data ) { - // dare to ignore arrays/objects - if( ! is_string( $data ) ) continue ; - - $check_length = isset( $lengths[ $key ] ) ? $lengths[ $key ] : $lengths[ 0 ] ; - if( strlen( $data ) > $check_length ) { - if( strlen( $data ) == mb_strlen( $data ) ) { - $this->protector->message .= "No multibyte character was found ($data)\n" ; - $this->protector->output_log( 'Singlebyte SPAM' , 0 , false , 128 ) ; - die( 'Protector rejects your post, because your post looks like SPAM' ) ; - } - } - } - - return true ; - } + if (!function_exists('mb_strlen')) { + return true; + } -} + // registered users always pass this plugin + if ($xoops->isUser()) { + return true; + } -?> \ No newline at end of file + $lengths = array( + 0 => 100, // default value + 'message' => 2, + 'com_text' => 2, + 'excerpt' => 2, + ); + + foreach ($_POST as $key => $data) { + // dare to ignore arrays/objects + if (!is_string($data)) { + continue; + } + + $check_length = isset($lengths[$key]) ? $lengths[$key] : $lengths[0]; + if (strlen($data) > $check_length) { + if (strlen($data) == mb_strlen($data)) { + $this->protector->message .= "No multibyte character was found ($data)\n"; + $this->protector->output_log('Singlebyte SPAM', 0, false, 128); + die('Protector rejects your post, because your post looks like SPAM'); + } + } + } + + return true; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_register_moratorium.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_register_moratorium.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_post_register_moratorium.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,26 +1,43 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -define( 'PROTECTOR_POSTCOMMON_POST_REGISTER_MORATORIUM' , 60 ) ; // minutes + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ -class protector_postcommon_post_register_moratorium extends ProtectorFilterAbstract { +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ - function execute() - { - global $xoopsUser ; +define('PROTECTOR_POSTCOMMON_POST_REGISTER_MORATORIUM', 60); // minutes - if( ! is_object( $xoopsUser ) ) { - return true ; - } +class protector_postcommon_post_register_moratorium extends ProtectorFilterAbstract +{ + function execute() + { + $xoops = Xoops::getInstance(); - $moratorium_result = intval( ( $xoopsUser->getVar('user_regdate') + PROTECTOR_POSTCOMMON_POST_REGISTER_MORATORIUM * 60 - time() ) / 60 ) ; - if( $moratorium_result > 0 ) { - if( preg_match( '#(https?\:|\[\/url\]|www\.)#' , serialize( $_POST ) ) ) { - printf( _MD_PROTECTOR_FMT_REGISTER_MORATORIUM , $moratorium_result ) ; - exit ; - } - } - } + if (!$xoops->isUser()) { + return true; + } + $moratorium_result = intval(($xoops->user->getVar('user_regdate') + PROTECTOR_POSTCOMMON_POST_REGISTER_MORATORIUM * 60 - time()) / 60); + if ($moratorium_result > 0) { + if (preg_match('#(https?\:|\[\/url\]|www\.)#', serialize($_POST))) { + printf(_MD_PROTECTOR_FMT_REGISTER_MORATORIUM, $moratorium_result); + exit; + } + } + return true; + } } - -?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_register_insert_js_check.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_register_insert_js_check.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/postcommon_register_insert_js_check.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,76 +1,97 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_postcommon_register_insert_js_check extends ProtectorFilterAbstract { + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - ob_start( array( $this , 'ob_filter' ) ) ; +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ - if( ! empty( $_POST ) ) { - if( ! $this->checkValidate() ) { - die( _MD_PROTECTOR_TURNJAVASCRIPTON ) ; - } - } +class protector_postcommon_register_insert_js_check extends ProtectorFilterAbstract +{ + function execute() + { + ob_start(array($this, 'ob_filter')); - return true ; - } + if (!empty($_POST)) { + if (!$this->checkValidate()) { + die(_MD_PROTECTOR_TURNJAVASCRIPTON); + } + } - // insert javascript into the registering form - function ob_filter( $s ) - { - $antispam_htmls = $this->getHtml4Assign() ; + return true; + } - return preg_replace( '/<form[^>]*action=["\'](|#|register.php)["\'][^>]+>/i' , '$0'."\n".$antispam_htmls['html_in_form']."\n".$antispam_htmls['js_global'] , $s , 1 ) ; - } + // insert javascript into the registering form + function ob_filter($s) + { + $antispam_htmls = $this->getHtml4Assign(); + return preg_replace('/<form[^>]*action=["\'](|#|register.php)["\'][^>]+>/i', '$0' . "\n" . $antispam_htmls['html_in_form'] . "\n" . $antispam_htmls['js_global'], $s, 1); + } - // import from D3forumAntispamDefault.clas.php - function getMd5( $time = null ) - { - if( empty( $time ) ) $time = time() ; - return md5( gmdate( 'YmdH' , $time ) . XOOPS_DB_PREFIX . XOOPS_DB_NAME ) ; - } + // import from D3forumAntispamDefault.clas.php + function getMd5($time = null) + { + if (empty($time)) { + $time = time(); + } + return md5(gmdate('YmdH', $time) . XOOPS_DB_PREFIX . XOOPS_DB_NAME); + } - function getHtml4Assign() - { - $as_md5 = $this->getMd5() ; - $as_md5array = preg_split( '//' , $as_md5 , -1 , PREG_SPLIT_NO_EMPTY ) ; - $as_md5shuffle = array() ; - foreach( $as_md5array as $key => $val ) { - $as_md5shuffle[] = array( 'key' => $key , 'val' => $val ) ; - } - shuffle( $as_md5shuffle ) ; - $js_in_validate_function = "antispam_md5s=new Array(32);\n" ; - foreach( $as_md5shuffle as $item ) { - $key = $item['key'] ; - $val = $item['val'] ; - $js_in_validate_function .= "antispam_md5s[$key]='$val';\n" ; - } - $js_in_validate_function .= " + function getHtml4Assign() + { + $as_md5 = $this->getMd5(); + $as_md5array = preg_split('//', $as_md5, -1, PREG_SPLIT_NO_EMPTY); + $as_md5shuffle = array(); + foreach ($as_md5array as $key => $val) { + $as_md5shuffle[] = array( + 'key' => $key, + 'val' => $val + ); + } + shuffle($as_md5shuffle); + $js_in_validate_function = "antispam_md5s=new Array(32);\n"; + foreach ($as_md5shuffle as $item) { + $key = $item['key']; + $val = $item['val']; + $js_in_validate_function .= "antispam_md5s[$key]='$val';\n"; + } + $js_in_validate_function .= " antispam_md5 = '' ; for( i = 0 ; i < 32 ; i ++ ) { antispam_md5 += antispam_md5s[i] ; } xoopsGetElementById('antispam_md5').value = antispam_md5 ; - " ; - - return array( - 'html_in_form' => '<input type="hidden" name="antispam_md5" id="antispam_md5" value="" />' , - 'js_global' => '<script type="text/javascript"><!--//'."\n".$js_in_validate_function."\n".'//--></script><noscript><div class="errorMsg">'._MD_PROTECTOR_TURNJAVASCRIPTON.'</div></noscript>' , - ) ; - } + "; - function checkValidate() - { - $user_md5 = trim( @$_POST['antispam_md5'] ) ; - - // 2-3 hour margin - if( $user_md5 != $this->getMd5() && $user_md5 != $this->getMd5( time() - 3600 ) && $user_md5 != $this->getMd5( time() - 7200 ) ) { - $this->errors[] = _MD_PROTECTOR_TURNJAVASCRIPTON ; - return false ; - } - return true ; - } -} + return array( + 'html_in_form' => '<input type="hidden" name="antispam_md5" id="antispam_md5" value="" />', + 'js_global' => '<script type="text/javascript"><!--//' . "\n" . $js_in_validate_function . "\n" . '//--></script><noscript><div class="errorMsg">' . _MD_PROTECTOR_TURNJAVASCRIPTON . '</div></noscript>', + ); + } -?> \ No newline at end of file + function checkValidate() + { + $user_md5 = trim(@$_POST['antispam_md5']); + + // 2-3 hour margin + if ($user_md5 != $this->getMd5() && $user_md5 != $this->getMd5(time() - 3600) && $user_md5 != $this->getMd5(time() - 7200)) { + $this->errors[] = _MD_PROTECTOR_TURNJAVASCRIPTON; + return false; + } + return true; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_errorlog.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_errorlog.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_errorlog.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,18 +1,34 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_precommon_badip_errorlog extends ProtectorFilterAbstract { + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - echo _MD_PROTECTOR_YOUAREBADIP ; - $protector = Protector::getInstance() ; - if( $protector->ip_matched_info ) { - printf( _MD_PROTECTOR_FMT_JAILINFO , date( _MD_PROTECTOR_FMT_JAILTIME , $protector->ip_matched_info ) ) ; - } - error_log( 'Protector: badip '.@$_SERVER['REMOTE_ADDR'] , 0 ) ; - exit ; - } +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ -} - -?> \ No newline at end of file +class protector_precommon_badip_errorlog extends ProtectorFilterAbstract +{ + function execute() + { + echo _MD_PROTECTOR_YOUAREBADIP; + $protector = Protector::getInstance(); + if ($protector->ip_matched_info) { + printf(_MD_PROTECTOR_FMT_JAILINFO, date(_MD_PROTECTOR_FMT_JAILTIME, $protector->ip_matched_info)); + } + error_log('Protector: badip ' . @$_SERVER['REMOTE_ADDR'], 0); + exit; + } +} \ No newline at end of file Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_message.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_message.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_message.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,13 +0,0 @@ -<?php - -class protector_precommon_badip_message extends ProtectorFilterAbstract { - - function execute() - { - echo _MD_PROTECTOR_YOUAREBADIP ; - exit ; - } - -} - -?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_redirection.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_redirection.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_badip_redirection.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,17 +1,33 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -// define it as you like :-) + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ -define( 'PROTECTOR_BADIP_REDIRECTION_URI' , 'http://yahoo.com/' ) ; +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ -class protector_precommon_badip_redirection extends ProtectorFilterAbstract { +// define it as you like :-) - function execute() - { - header( 'Location: '.PROTECTOR_BADIP_REDIRECTION_URI ) ; - exit ; - } +define('PROTECTOR_BADIP_REDIRECTION_URI', 'http://yahoo.com/'); -} - -?> \ No newline at end of file +class protector_precommon_badip_redirection extends ProtectorFilterAbstract +{ + function execute() + { + header('Location: ' . PROTECTOR_BADIP_REDIRECTION_URI); + exit; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_bwlimit_errorlog.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_bwlimit_errorlog.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_bwlimit_errorlog.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,17 +1,33 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_precommon_bwlimit_errorlog extends ProtectorFilterAbstract { + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - header( 'HTTP/1.0 503 Service unavailable' ) ; - header( 'Retry-After: 600' ) ; +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ - echo _MD_PROTECTOR_BANDWIDTHLIMITED ; - error_log( 'Protector: bwlimit '.@$_SERVER['REMOTE_ADDR'] , 0 ) ; - exit ; - } +class protector_precommon_bwlimit_errorlog extends ProtectorFilterAbstract +{ + function execute() + { + header('HTTP/1.0 503 Service unavailable'); + header('Retry-After: 600'); -} - -?> \ No newline at end of file + echo _MD_PROTECTOR_BANDWIDTHLIMITED; + error_log('Protector: bwlimit ' . @$_SERVER['REMOTE_ADDR'], 0); + exit; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_bwlimit_message.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_bwlimit_message.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/precommon_bwlimit_message.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,16 +1,32 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_precommon_bwlimit_message extends ProtectorFilterAbstract { + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - header( 'HTTP/1.0 503 Service unavailable' ) ; - header( 'Retry-After: 600' ) ; +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ - echo _MD_PROTECTOR_BANDWIDTHLIMITED ; - exit ; - } +class protector_precommon_bwlimit_message extends ProtectorFilterAbstract +{ + function execute() + { + header('HTTP/1.0 503 Service unavailable'); + header('Retry-After: 600'); -} - -?> \ No newline at end of file + echo _MD_PROTECTOR_BANDWIDTHLIMITED; + exit; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/prepurge_exit_message.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/prepurge_exit_message.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/prepurge_exit_message.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,14 +1,30 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_prepurge_exit_message extends ProtectorFilterAbstract { + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - // header( 'Location: http://google.com/' ) ; // redirect somewhere - echo 'Protector detects attacking actions' ; // write any message as you like - exit ; - } +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ -} - -?> \ No newline at end of file +class protector_prepurge_exit_message extends ProtectorFilterAbstract +{ + function execute() + { + // header( 'Location: http://google.com/' ) ; // redirect somewhere + echo 'Protector detected attacking actions'; // write any message as you like + exit; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/spamcheck_overrun_message.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/spamcheck_overrun_message.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_disabled/spamcheck_overrun_message.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,14 +1,30 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_spamcheck_overrun_message extends ProtectorFilterAbstract { + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - // header( 'Location: http://google.com/' ) ; // redirect somewhere - echo 'Your post looks like SPAM' ; // write any message as you like - exit ; - } +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ -} - -?> \ No newline at end of file +class protector_spamcheck_overrun_message extends ProtectorFilterAbstract +{ + function execute() + { + // header( 'Location: http://google.com/' ) ; // redirect somewhere + echo 'Your post looks like SPAM'; // write any message as you like + exit; + } +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_enabled/precommon_badip_message.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_enabled/precommon_badip_message.php 2011-12-03 19:02:00 UTC (rev 8401) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/filters_enabled/precommon_badip_message.php 2011-12-03 19:40:12 UTC (rev 8402) @@ -1,17 +1,33 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. -class protector_precommon_badip_message extends ProtectorFilterAbstract { + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ - function execute() - { - echo _MD_PROTECTOR_YOUAREBADIP ; - $protector = Protector::getInstance() ; - if( $protector->ip_matched_info ) { - printf( _MD_PROTECTOR_FMT_JAILINFO , date( _MD_PROTECTOR_FMT_JAILTIME , $protector->ip_matched_info ) ) ; - } - exit ; - } +/** + * Protector + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package protector + * @author trabis <lus...@gm...> + * @version $Id$ + */ -} - -?> \ No newline at end of file +class protector_precommon_badip_message extends ProtectorFilterAbstract +{ + public function execute() + { + echo _MD_PROTECTOR_YOUAREBADIP; + $protector = Protector::getInstance(); + if ($protector->ip_matched_info) { + printf(_MD_PROTECTOR_FMT_JAILINFO, date(_MD_PROTECTOR_FMT_JAILTIME, $protector->ip_matched_info)); + } + exit; + } +} \ No newline at end of file Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/images/module_icon_old.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |