Ignore:
Timestamp:
Aug 15, 2010, 3:03:21 AM (14 years ago)
Author:
Eric
Message:
  • Bug 1511 fixed - New function to blacklist excluded IPs or ranged IPs for registration
  • Bug 1792 fixed (Thx to TOnin)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/nbc_HistoryIPExcluder/trunk/maintain.inc.php

    r5615 r6758  
    1010INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
    1111VALUES ("HistoryIPExcluder","","History IP Excluder parameters");
     12';
     13     
     14  pwg_query($q);
     15
     16$default = array (
     17  'Blacklist' => "0",
     18  'Version'=> "2.1.1",
     19);
     20
     21  $q = '
     22INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
     23VALUES ("HistoryIPConfig","'.addslashes(serialize($default)).'","History IP Excluder options");
    1224';
    1325     
     
    3143        if ($count == 1)
    3244        {
    33   /* upgrade from branch 2.0.0 to 2.0.1 */
     45  /* upgrade from branch 2.0.0 to 2.0.1   */
    3446  /* ************************************ */
    3547                upgrade_200();
     48        }
     49
     50        $query = '
     51SELECT param
     52  FROM '.CONFIG_TABLE.'
     53WHERE param = "HistoryIPConfig"
     54;';
     55  $count = pwg_db_num_rows(pwg_query($query));
     56
     57        if ($count == 0)
     58        {
     59  /* upgrade from branch 2.1.0 to 2.1.1   */
     60  /* ************************************ */
     61                upgrade_210();
    3662        }
    3763}
     
    4268  global $conf;
    4369
    44   if (isset($conf['nbc_HistoryIPExcluder']))
     70  if (isset($conf['HistoryIPExcluder']))
    4571  {
    4672    $q = '
    4773DELETE FROM '.CONFIG_TABLE.'
    48 WHERE param="nbc_HistoryIPExcluder" LIMIT 1;
     74WHERE param="HistoryIPExcluder" LIMIT 1;
    4975';
    5076
    5177    pwg_query($q);
    5278  }
     79  if (isset($conf['HistoryIPConfig']))
     80  {
     81    $q = '
     82DELETE FROM '.CONFIG_TABLE.'
     83WHERE param="HistoryIPConfig" LIMIT 1;
     84';
     85
     86    pwg_query($q);
     87  } 
    5388}
    5489
     
    71106;';
    72107  pwg_query($q);
     108
     109  upgrade_210();
     110}
     111
     112function upgrade_210()
     113{
     114  global $conf;
     115 
     116  $default = array (
     117    'Blacklist' => "0",
     118    'Version'=> "2.1.1",
     119  );
     120
     121  $q = '
     122INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
     123VALUES ("HistoryIPConfig","'.addslashes(serialize($default)).'","History IP Excluder options");
     124';
     125     
     126  pwg_query($q);
    73127}
    74128?>
Note: See TracChangeset for help on using the changeset viewer.