Ignore:
Timestamp:
Mar 11, 2010, 11:03:23 PM (14 years ago)
Author:
Eric
Message:

[nbc_HistoryIPExcluder]

This set works fine. A fist release will be build ASAP.

Location:
extensions/nbc_HistoryIPExcluder/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.php

    r5099 r5113  
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44
    5 //include_once(get_language_filepath('plugin.lang.php', NBC_HISTORYIPEXCLUDER_PATH));
    65load_language('plugin.lang', HIPE_PATH);
    76
    87
    98$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>';
    1110
    1211$ip_ripe1 = '<a href="http://www.ripe.net/whois?form_type=simple&amp;full_query_string=&amp;searchtext=';
     
    2120  $v = str_replace( "\r\n", ",", $v );
    2221  $v = str_replace( ",,", ",", $v );
    23  
    24   $conf['nbc_HistoryIPExcluder'] = serialize($v);
    25   //$conf['nbc_HistoryIPExcluder'] = stripslashes($v);
     22
     23  $conf['nbc_HistoryIPExcluder'] = stripslashes($v);
    2624
    2725  $query = '
    2826    UPDATE '.CONFIG_TABLE.'
    29     SET value="'.addslashes($conf['nbc_HistoryIPExcluder']).'"
     27    SET value="'.$conf['nbc_HistoryIPExcluder'].'"
    3028    WHERE param="nbc_HistoryIPExcluder"
    3129    LIMIT 1';
     
    3331
    3432  // information message
    35   array_push($page['infos'], $lang['HIPE_save_config']);
     33  array_push($page['infos'], l10n('HIPE_save_config'));
    3634}
    3735elseif ( isset($_POST['CleanHist']) )
    3836{
    39   $conf_HIPE = unserialize($conf['nbc_HistoryIPExcluder']);
    40   //$conf_nbc_HistoryIPExcluder = explode("," , $conf['nbc_HistoryIPExcluder']);
     37  $conf_HIPE = explode("," , $conf['nbc_HistoryIPExcluder']);
    4138
    4239  foreach ( $conf_HIPE as $Exclusion )
     
    5956
    6057  // information message
    61   array_push($page['infos'], $lang['HIPE_hist_cleaned']);
     58  array_push($page['infos'], l10n('HIPE_hist_cleaned'));
    6259}
    6360elseif ( isset($_POST['HIPE_IPByMember']) )
     
    6562  $template->assign(
    6663    array(
    67       'HIPE_DESCRIPTION2' => $lang['HIPE_IPByMember_description'],
     64      'HIPE_DESCRIPTION2' => l10n('HIPE_IPByMember_description'),
    6865    )
    6966  );
     
    200197}
    201198
    202 
    203 $conf_HIPE = unserialize($conf['nbc_HistoryIPExcluder']);
    204 //$conf_nbc_HistoryIPExcluder = explode("," , $conf['nbc_HistoryIPExcluder']);
     199$conf_HIPE = explode("," , $conf['nbc_HistoryIPExcluder']);
    205200
    206201$template->assign(
    207202  array(
    208203    'HIPE_F_ACTION' => PHPWG_ROOT_PATH.'admin.php?page=plugin&section=nbc_HistoryIPExcluder%2Fadmin%2FHIPE_admin.php',
    209     'IPs_EXCLUDED' => $conf_HIPE,
     204    'IPs_EXCLUDED' => implode("\n", $conf_HIPE),
    210205  )
    211206);
     
    214209  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    215210
    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 
    220211?>
  • extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.tpl

    r5099 r5113  
    1111    <br>
    1212
    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 
    1621  </fieldset>
    1722
    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>
    2125 
    2226  <p style="text-align:center;">
     
    3337
    3438  <fieldset>
    35          <legend>{'HIPE_admin_section2'|@translate}</legend>
     39         <legend>{'HIPE_admin_section3'|@translate}</legend>
    3640         
    3741    <label>{$HIPE_DESCRIPTION2}</label>
     
    5155
    5256  </fieldset>
    53 
     57</fieldset>
    5458
    5559</form>
  • extensions/nbc_HistoryIPExcluder/trunk/language/fr_FR/plugin.lang.php

    r5099 r5113  
    55$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';
    66$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>';
    88$lang['HIPE_save_config']='Configuration enregistrée.';
    99$lang['HIPE_CleanHist']='Nettoyer l\'histoique';
    1010
    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';
    1213$lang['HIPE_IPByMember'] = 'IP par membre';
    1314$lang['HIPE_IPByMember_description'] = 'Affiche les IPs attachées à des membres, classé par IP';
     
    2526$lang['HIPE_hist_cleaned'] = 'Nettoyage de l\'historique réussie.';
    2627
    27 $lang['nbc_IP_geolocalisation'] = 'Géolocalisation';
     28$lang['IP_geolocalisation'] = 'Géolocalisation';
    2829?>
  • extensions/nbc_HistoryIPExcluder/trunk/main.inc.php

    r5099 r5113  
    3838  global $conf;
    3939
    40   $conf_HIPE = unserialize($conf['nbc_HistoryIPExcluder']);
    41   //$conf_nbc_HistoryIPExcluder = explode("," , $conf['nbc_HistoryIPExcluder']);
     40  $conf_HIPE = explode("," , $conf['nbc_HistoryIPExcluder']);
    4241
    43   if ( !$do_log )
     42  if (!$do_log)
    4443    return $do_log;
    4544  else
    4645  {
    47     $IP_Client = explode(".", $_SERVER['REMOTE_ADDR']);
     46    $IP_Client = explode('.', $_SERVER['REMOTE_ADDR']);
    4847 
    49     foreach ( $conf_HIPE as $Exclusion )
     48    foreach ($conf_HIPE as $Exclusion)
    5049    {
    51       $IP_Exclude = explode(".", $Exclusion);
     50      $IP_Exclude = explode('.', $Exclusion);
    5251 
    5352      if (
Note: See TracChangeset for help on using the changeset viewer.