Changeset 9882


Ignore:
Timestamp:
Mar 26, 2011, 6:39:10 PM (14 years ago)
Author:
Eric
Message:

Bug fixed on plugin upgrade_211()

Location:
extensions/HistoryIPExcluder/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/HistoryIPExcluder/trunk/main.inc.php

    r9870 r9882  
    22/*
    33Plugin Name: History IP Excluder
    4 Version: 2.2.0
     4Version: 2.2.1
    55Description: 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!
    66Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=147
     
    26262.2.0             - Compliance with Piwigo 2.2.x
    2727                  - Plugin directory renamed from nbc_HistoryIPExcluder to HistoryIPExcluder
     28
     292.2.1             - Bug fixed on plugin upgrade from 2.1.x version
    2830
    2931--------------------------------------------------------------------------------
  • extensions/HistoryIPExcluder/trunk/maintain.inc.php

    r9881 r9882  
    9797    upgrade_211();
    9898  }
     99
     100  /* upgrade from version 2.2.0 to 2.2.1 */
     101  /* *********************************** */
     102  $HIPE_Config = unserialize($conf['HistoryIPConfig']);
     103  if ($HIPE_Config['Version'] != '2.2.1')
     104  {
     105    upgrade_220();
     106  }
    99107}
    100108
     
    190198;';
    191199
    192         pwg_query($query); 
     200        pwg_query($query);
    193201
    194202  // Create new HIPE entry in plugins table
     
    215223  }
    216224}
     225
     226
     227function upgrade_220()
     228{
     229  global $conf;
     230
     231// Update plugin version
     232  $query = '
     233SELECT value
     234  FROM '.CONFIG_TABLE.'
     235WHERE param = "HistoryIPConfig"
     236;';
     237  $result = pwg_query($query);
     238 
     239  $conf_HIPE = pwg_db_fetch_assoc($result);
     240   
     241  $Newconf_HIPE = unserialize($conf_HIPE['value']);
     242 
     243  $Newconf_HIPE['Version'] = '2.2.1';
     244 
     245  $update_conf = serialize($Newconf_HIPE);
     246
     247  $query = '
     248UPDATE '.CONFIG_TABLE.'
     249SET value="'.addslashes($update_conf).'"
     250WHERE param="HistoryIPConfig"
     251LIMIT 1
     252;';
     253
     254        pwg_query($query);
     255}
    217256?>
Note: See TracChangeset for help on using the changeset viewer.