$name, 'URL' => get_root_url().'admin.php?page=plugin-'.basename(HIPE_PATH) ) ); return $menu; } // IP exclusion from logs add_event_handler('pwg_log_allowed', 'HIPE_IP_Filtrer'); function HIPE_IP_Filtrer($do_log) { global $conf; $conf_HIPE = explode("," , $conf['HistoryIPExcluder']); if (!$do_log) return $do_log; else { $IP_Client = explode('.', $_SERVER['REMOTE_ADDR']); foreach ($conf_HIPE as $Exclusion) { $IP_Exclude = explode('.', $Exclusion); if ( (($IP_Client[0] == $IP_Exclude[0]) or ($IP_Exclude[0] == '%')) and (!isset($IP_Exclude[1]) or ($IP_Client[1] == $IP_Exclude[1]) or ($IP_Exclude[1] == '%')) and (!isset($IP_Exclude[2]) or ($IP_Client[2] == $IP_Exclude[2]) or ($IP_Exclude[2] == '%')) and (!isset($IP_Exclude[3]) or ($IP_Client[3] == $IP_Exclude[3]) or ($IP_Exclude[3] == '%')) ) { $do_log = false; } } return $do_log; } } /* Check users registration */ add_event_handler('register_user_check', 'HIPE_RegistrationCheck', EVENT_HANDLER_PRIORITY_NEUTRAL +2, 2); function HIPE_RegistrationCheck($err, $user) { global $errors, $conf; load_language('plugin.lang', HIPE_PATH); if (count($err)!=0 ) return $err; $IP_Client = explode('.', $_SERVER['REMOTE_ADDR']); $HIPE_Config = unserialize($conf['HistoryIPConfig']); $conf_HIPE = explode("," , $conf['HistoryIPExcluder']); if (isset($HIPE_Config['Blacklist']) and $HIPE_Config['Blacklist'] == true) { foreach ($conf_HIPE as $Exclusion) { $IP_Exclude = explode('.', $Exclusion); if ( (($IP_Client[0] == $IP_Exclude[0]) or ($IP_Exclude[0] == '%')) and (!isset($IP_Exclude[1]) or ($IP_Client[1] == $IP_Exclude[1]) or ($IP_Exclude[1] == '%')) and (!isset($IP_Exclude[2]) or ($IP_Client[2] == $IP_Exclude[2]) or ($IP_Exclude[2] == '%')) and (!isset($IP_Exclude[3]) or ($IP_Client[3] == $IP_Exclude[3]) or ($IP_Exclude[3] == '%')) ) { $err = l10n('Error_HIPE_BlacklistedIP'); } } return $err; } } ?>