6 if( defined(
'_INSTALL_CHARSET' ) && ! is_writable( XOOPS_ROOT_PATH.
'/mainfile.php' ) ) die(
'To use installer, remove protector\'s lines from mainfile.php first.' ) ;
9 require_once dirname(dirname(__FILE__)).
'/class/protector.php' ;
16 if( @
$conf[
'bwlimit_count'] >= 10 ) {
18 if( $bwexpire > time() ) {
19 header(
'HTTP/1.0 503 Service unavailable' ) ;
20 $protector->call_filter(
'precommon_bwlimit' ,
'This website is very busy now. Please try later.' ) ;
28 $protector->call_filter(
'precommon_badip' ,
'You are registered as BAD_IP by Protector.' ) ;
32 if( ! empty(
$conf[
'global_disabled'] ) )
return true ;
35 $reliable_ips = @unserialize( @
$conf[
'reliable_ips'] ) ;
36 if( ! is_array( $reliable_ips ) ) {
38 $reliable_ips = @unserialize( stripslashes( @
$conf[
'reliable_ips'] ) ) ;
39 if( ! is_array( $reliable_ips ) ) $reliable_ips = array() ;
41 $is_reliable =
false ;
42 foreach( $reliable_ips as $reliable_ip ) {
43 if( ! empty( $reliable_ip ) && preg_match(
'/'.$reliable_ip.
'/' ,
$_SERVER[
'REMOTE_ADDR'] ) ) {
49 $force_override = strstr( @
$_SERVER[
'REQUEST_URI'] ,
'protector/admin/index.php?page=advisory' ) ?
true :
false ;
51 if( $force_override || ! empty(
$conf[
'enable_dblayertrap'] ) ) {
52 @define(
'PROTECTOR_ENABLED_ANTI_SQL_INJECTION' , 1 ) ;
53 $protector->dblayertrap_init( $force_override ) ;
57 if( ! empty(
$conf[
'enable_bigumbrella'] ) ) {
58 @define(
'PROTECTOR_ENABLED_ANTI_XSS' , 1 ) ;
63 if( ! empty(
$conf[
'id_forceintval'] ) )
$protector->intval_allrequestsendid() ;
66 if( ! $is_reliable && ! empty(
$conf[
'file_dotdot'] ) )
$protector->eliminate_dotdot() ;
69 if( ! $is_reliable && ! empty( $_FILES ) && ! empty(
$conf[
'die_badext'] ) && ! defined(
'PROTECTOR_SKIP_FILESCHECKER' ) && !
$protector->check_uploaded_files() ) {
75 if( !
$protector->check_contami_systemglobals() ) {
76 if( @
$conf[
'contami_action'] & 4 ) {
77 if( @
$conf[
'contami_action'] & 8 ) {
94 if( ! empty(
$conf[
'disable_features'] ) )
$protector->disable_features() ;