Changeset 5113 for extensions/nbc_HistoryIPExcluder
- Timestamp:
- Mar 11, 2010, 11:03:23 PM (14 years ago)
- Location:
- extensions/nbc_HistoryIPExcluder/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.php
r5099 r5113 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 5 //include_once(get_language_filepath('plugin.lang.php', NBC_HISTORYIPEXCLUDER_PATH));6 5 load_language('plugin.lang', HIPE_PATH); 7 6 8 7 9 8 $ip_geolocalisation1 = '<a href="http://www.geoiptool.com/fr/?IP='; 10 $ip_geolocalisation2 = '" title="Geo IP localisation" target="_blank"><img src="'.HIPE_PATH.'/geoip.ico" class="button" alt="'.l10n(' nbc_IP_geolocalisation').'"></a>';9 $ip_geolocalisation2 = '" title="Geo IP localisation" target="_blank"><img src="'.HIPE_PATH.'/geoip.ico" class="button" alt="'.l10n('IP_geolocalisation').'"></a>'; 11 10 12 11 $ip_ripe1 = '<a href="http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext='; … … 21 20 $v = str_replace( "\r\n", ",", $v ); 22 21 $v = str_replace( ",,", ",", $v ); 23 24 $conf['nbc_HistoryIPExcluder'] = serialize($v); 25 //$conf['nbc_HistoryIPExcluder'] = stripslashes($v); 22 23 $conf['nbc_HistoryIPExcluder'] = stripslashes($v); 26 24 27 25 $query = ' 28 26 UPDATE '.CONFIG_TABLE.' 29 SET value="'. addslashes($conf['nbc_HistoryIPExcluder']).'"27 SET value="'.$conf['nbc_HistoryIPExcluder'].'" 30 28 WHERE param="nbc_HistoryIPExcluder" 31 29 LIMIT 1'; … … 33 31 34 32 // information message 35 array_push($page['infos'], $lang['HIPE_save_config']);33 array_push($page['infos'], l10n('HIPE_save_config')); 36 34 } 37 35 elseif ( isset($_POST['CleanHist']) ) 38 36 { 39 $conf_HIPE = unserialize($conf['nbc_HistoryIPExcluder']); 40 //$conf_nbc_HistoryIPExcluder = explode("," , $conf['nbc_HistoryIPExcluder']); 37 $conf_HIPE = explode("," , $conf['nbc_HistoryIPExcluder']); 41 38 42 39 foreach ( $conf_HIPE as $Exclusion ) … … 59 56 60 57 // information message 61 array_push($page['infos'], $lang['HIPE_hist_cleaned']);58 array_push($page['infos'], l10n('HIPE_hist_cleaned')); 62 59 } 63 60 elseif ( isset($_POST['HIPE_IPByMember']) ) … … 65 62 $template->assign( 66 63 array( 67 'HIPE_DESCRIPTION2' => $lang['HIPE_IPByMember_description'],64 'HIPE_DESCRIPTION2' => l10n('HIPE_IPByMember_description'), 68 65 ) 69 66 ); … … 200 197 } 201 198 202 203 $conf_HIPE = unserialize($conf['nbc_HistoryIPExcluder']); 204 //$conf_nbc_HistoryIPExcluder = explode("," , $conf['nbc_HistoryIPExcluder']); 199 $conf_HIPE = explode("," , $conf['nbc_HistoryIPExcluder']); 205 200 206 201 $template->assign( 207 202 array( 208 203 'HIPE_F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=plugin§ion=nbc_HistoryIPExcluder%2Fadmin%2FHIPE_admin.php', 209 'IPs_EXCLUDED' => $conf_HIPE,204 'IPs_EXCLUDED' => implode("\n", $conf_HIPE), 210 205 ) 211 206 ); … … 214 209 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 215 210 216 //$template->set_filenames( array('plugin_admin_content' => HIPE_PATH.'admin/nbc_HistoryIPExcluder_admin.tpl') );217 218 //$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');219 220 211 ?> -
extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.tpl
r5099 r5113 11 11 <br> 12 12 13 <label> 14 {'HIPE_admin_description1'|@translate} <textarea name="HIPE_IPs_Excluded" rows="10" cols="60" {$TAG_INPUT_ENABLED}>{$IPs_EXCLUDED}</textarea> 15 </label> 13 <label>{'HIPE_admin_description1'|@translate}</label> 14 15 <div style="text-align:center;"> 16 <textarea name="HIPE_IPs_Excluded" rows="10" cols="60" {$TAG_INPUT_ENABLED}>{$IPs_EXCLUDED}</textarea> 17 </div> 18 19 <p><input type="submit" name="submit" value="{'submit'|@translate}" class="bouton" {$TAG_INPUT_ENABLED}> <input type="submit" name="CleanHist" value="{'HIPE_CleanHist'|@translate}" class="bouton" {$TAG_INPUT_ENABLED}></p> 20 16 21 </fieldset> 17 22 18 <p><input type="submit" name="submit" value="{'submit'|@translate}" class="bouton" {$TAG_INPUT_ENABLED}> <input type="submit" name="CleanHist" value="{'HIPE_CleanHist'|@translate}" class="bouton" {$TAG_INPUT_ENABLED}></p> 19 20 <br> 23 <fieldset> 24 <legend>{'HIPE_admin_section2'|@translate}</legend> 21 25 22 26 <p style="text-align:center;"> … … 33 37 34 38 <fieldset> 35 <legend>{'HIPE_admin_section 2'|@translate}</legend>39 <legend>{'HIPE_admin_section3'|@translate}</legend> 36 40 37 41 <label>{$HIPE_DESCRIPTION2}</label> … … 51 55 52 56 </fieldset> 53 57 </fieldset> 54 58 55 59 </form> -
extensions/nbc_HistoryIPExcluder/trunk/language/fr_FR/plugin.lang.php
r5099 r5113 5 5 $lang['HIPE_description'] = 'Comme son nom l\'indique, ce plugin exclu des IP ou plages d\'IP de l\'historique et des statistiques.<br>En activant ce plugin, les IPs spécifiées dans le tableau ci-dessous ne seront plus enregistrées dans la table *.history de PWG.<br>Indiquez une seule IP ou plage par ligne.<br>Merci à Eric qui est à l\'origine de ce plugin !!!<br>Nicco'; 6 6 $lang['HIPE_admin_section1'] = 'Exclusion d\'IPs'; 7 $lang['HIPE_admin_description1'] = 'Renseignez le cadre ci-dessous avec les IPs ou plages d\'IP à exclure (une par ligne). <br>Vous pouvez utiliser des IP complètes ou une série en utilisant le caractère joker "%".<br>Par exemple : 74.6.2.1 ou 74.6.%';7 $lang['HIPE_admin_description1'] = 'Renseignez le cadre ci-dessous avec les IPs ou plages d\'IP à exclure (une par ligne). Vous pouvez utiliser des IP complètes ou une série en utilisant le caractère joker "%".<br>Par exemple : 74.6.2.1 ou 74.6.%<br><br>'; 8 8 $lang['HIPE_save_config']='Configuration enregistrée.'; 9 9 $lang['HIPE_CleanHist']='Nettoyer l\'histoique'; 10 10 11 $lang['HIPE_admin_section2'] = 'Resultat de la requête sur l\'historique'; 11 $lang['HIPE_admin_section2'] = 'Requêtes sur l\'historique'; 12 $lang['HIPE_admin_section3'] = 'Resultat de la requête sur l\'historique'; 12 13 $lang['HIPE_IPByMember'] = 'IP par membre'; 13 14 $lang['HIPE_IPByMember_description'] = 'Affiche les IPs attachées à des membres, classé par IP'; … … 25 26 $lang['HIPE_hist_cleaned'] = 'Nettoyage de l\'historique réussie.'; 26 27 27 $lang[' nbc_IP_geolocalisation'] = 'Géolocalisation';28 $lang['IP_geolocalisation'] = 'Géolocalisation'; 28 29 ?> -
extensions/nbc_HistoryIPExcluder/trunk/main.inc.php
r5099 r5113 38 38 global $conf; 39 39 40 $conf_HIPE = unserialize($conf['nbc_HistoryIPExcluder']); 41 //$conf_nbc_HistoryIPExcluder = explode("," , $conf['nbc_HistoryIPExcluder']); 40 $conf_HIPE = explode("," , $conf['nbc_HistoryIPExcluder']); 42 41 43 if ( !$do_log)42 if (!$do_log) 44 43 return $do_log; 45 44 else 46 45 { 47 $IP_Client = explode( ".", $_SERVER['REMOTE_ADDR']);46 $IP_Client = explode('.', $_SERVER['REMOTE_ADDR']); 48 47 49 foreach ( $conf_HIPE as $Exclusion)48 foreach ($conf_HIPE as $Exclusion) 50 49 { 51 $IP_Exclude = explode( ".", $Exclusion);50 $IP_Exclude = explode('.', $Exclusion); 52 51 53 52 if (
Note: See TracChangeset
for help on using the changeset viewer.