Changeset 2815 for trunk/admin


Ignore:
Timestamp:
Nov 1, 2008, 10:19:20 PM (15 years ago)
Author:
patdenice
Message:
  • bugs correction in upgrade_1.7.0.php.
  • only non-standard plugins are deactivated during upgrade.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_upgrade.php

    r2516 r2815  
    9595}
    9696
     97// Deactivate all non-standard plugins
     98function deactivate_non_standard_plugins()
     99{
     100  global $page;
     101
     102  $standard_plugins = array(
     103    'add_index',
     104    'admin_advices',
     105    'admin_multi_view',
     106    'c13y_upgrade',
     107    'event_tracer',
     108    'language_switch',
     109    'LocalFilesEditor'
     110    );
     111
     112  $query = '
     113SELECT id
     114FROM '.PREFIX_TABLE.'plugins
     115WHERE state = "active"
     116AND id NOT IN ("' . implode('","', $standard_plugins) . '")
     117;';
     118
     119  $result = pwg_query($query);
     120  $plugins = array();
     121  while ($row = mysql_fetch_assoc($result))
     122  {
     123    array_push($plugins, $row['id']);
     124  }
     125
     126  if (!empty($plugins))
     127  {
     128    $query = '
     129UPDATE '.PREFIX_TABLE.'plugins
     130SET state="inactive"
     131WHERE id IN ("' . implode('","', $plugins) . '")
     132;';
     133    mysql_query($query);
     134
     135    array_push(
     136      $page['infos'],
     137      'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:
     138<pre>' . implode(', ', $plugins) . '</pre>'
     139      );
     140  }
     141}
     142
    97143?>
Note: See TracChangeset for help on using the changeset viewer.