- Timestamp:
- Aug 15, 2010, 3:32:31 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/nbc_HistoryIPExcluder/branches/2.1/main.inc.php
r5615 r6761 2 2 /* 3 3 Plugin Name: History IP Excluder 4 Version: 2.1. 05 Description: Permet l'exclusion d'une IP ou d'une plage d'IP de l historique - Excludes one IP or a range of IP from the history.4 Version: 2.1.1 5 Description: Permet l'exclusion d'une IP ou d'une plage d'IP de l'historique et de les blacklister à l'inscription - Base MySql seulement! / Excludes one IP or a range of IP from the history and to blacklist them on registration - MySql database only! 6 6 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=147 7 7 Author: Nicco, Eric … … 20 20 - Removing "nbc_" prefix in plugin code and display in piwigo's plugin manager 21 21 - Displaying the good plugin name and current version in admin panel 22 23 2.1.1 - Bug 1792 fixed (Thx to TOnin) 24 - Bug 1511 fixed - New function to blacklist excluded IPs or ranged IPs for registration 22 25 23 26 -------------------------------------------------------------------------------- … … 86 89 } 87 90 } 91 92 /* Check users registration */ 93 add_event_handler('register_user_check', 'HIPE_RegistrationCheck', EVENT_HANDLER_PRIORITY_NEUTRAL +2, 2); 94 95 function HIPE_RegistrationCheck($err, $user) 96 { 97 global $errors, $conf; 98 load_language('plugin.lang', HIPE_PATH); 99 100 if (count($err)!=0 ) return $err; 101 102 $IP_Client = explode('.', $_SERVER['REMOTE_ADDR']); 103 $HIPE_Config = unserialize($conf['HistoryIPConfig']); 104 $conf_HIPE = explode("," , $conf['HistoryIPExcluder']); 105 106 if (isset($HIPE_Config['Blacklist']) and $HIPE_Config['Blacklist'] == true) 107 { 108 foreach ($conf_HIPE as $Exclusion) 109 { 110 $IP_Exclude = explode('.', $Exclusion); 111 112 if ( 113 (($IP_Client[0] == $IP_Exclude[0]) or ($IP_Exclude[0] == '%')) and 114 (!isset($IP_Exclude[1]) or ($IP_Client[1] == $IP_Exclude[1]) or ($IP_Exclude[1] == '%')) and 115 (!isset($IP_Exclude[2]) or ($IP_Client[2] == $IP_Exclude[2]) or ($IP_Exclude[2] == '%')) and 116 (!isset($IP_Exclude[3]) or ($IP_Client[3] == $IP_Exclude[3]) or ($IP_Exclude[3] == '%')) 117 ) 118 { 119 $err = l10n('Error_HIPE_BlacklistedIP'); 120 } 121 } 122 return $err; 123 } 124 } 88 125 ?>
Note: See TracChangeset
for help on using the changeset viewer.