Ignore:
Timestamp:
Oct 26, 2010, 10:44:28 AM (13 years ago)
Author:
grum
Message:

Fix bugs on install/update process

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GMaps/admin/plugin_admin.php

    r7054 r7398  
    1414if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
    1515
    16 include(GMAPS_PATH."gmaps_aip.class.inc.php");
     16
    1717
    1818global $prefixeTable, $template;
     
    2323
    2424
    25 $plugin_aip = new GMaps_AIP($prefixeTable, $main_plugin_object->getFileLocation());
     25if(CommonPlugin::checkGPCRelease(GMAPS_GPC_NEEDED))
     26{
     27  $config=Array();
     28  GPCCore::loadConfig('gmaps', $config);
     29
     30
     31  if($config['installed']!=GMAPS_VERSION2)
     32  {
     33    /* the plugin was updated without being deactivated
     34     * deactivate + activate the plugin to process the database upgrade
     35     */
     36    include(GMAPS_PATH."gmaps_install.class.inc.php");
     37    $gmaps=new GMaps_Install($prefixeTable, dirname(__FILE__));
     38    $gmaps->deactivate();
     39    $gmaps->activate();
     40    $template->delete_compiled_templates();
     41    //$config['newInstall']='n';
     42  }
     43
     44  include(GMAPS_PATH."gmaps_aip.class.inc.php");
     45  $plugin_aip = new GMaps_AIP($prefixeTable, $main_plugin_object->getFileLocation());
     46}
     47else
     48{
     49  /*
     50   * plugin was upgraded, but GPC was not
     51   * display a page to inform user to upgrade GPC
     52   */
     53  include(GMAPS_PATH."gmaps_aip_release.class.inc.php");
     54  $plugin_aip = new GMaps_AIPRelease($prefixeTable, $main_plugin_object->getFileLocation());
     55}
     56
     57
     58
     59
    2660$plugin_aip->manage();
    2761
Note: See TracChangeset for help on using the changeset viewer.