diff options
author | patdenice <patdenice@piwigo.org> | 2008-11-01 21:19:20 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2008-11-01 21:19:20 +0000 |
commit | 9a7de2b6b1b85a0642d34b24fa1daacbf119c0a9 (patch) | |
tree | e97cd0333f7b396382a96f8e7dc0098f2704c873 /admin/include/functions_upgrade.php | |
parent | ae4e04da07998024fae600bf403ed58cfbed6515 (diff) |
- bugs correction in upgrade_1.7.0.php.
- only non-standard plugins are deactivated during upgrade.
git-svn-id: http://piwigo.org/svn/trunk@2815 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/include/functions_upgrade.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/admin/include/functions_upgrade.php b/admin/include/functions_upgrade.php index 06bba375a..b21cc7c01 100644 --- a/admin/include/functions_upgrade.php +++ b/admin/include/functions_upgrade.php @@ -94,4 +94,50 @@ function create_empty_local_files() } } +// Deactivate all non-standard plugins +function deactivate_non_standard_plugins() +{ + global $page; + + $standard_plugins = array( + 'add_index', + 'admin_advices', + 'admin_multi_view', + 'c13y_upgrade', + 'event_tracer', + 'language_switch', + 'LocalFilesEditor' + ); + + $query = ' +SELECT id +FROM '.PREFIX_TABLE.'plugins +WHERE state = "active" +AND id NOT IN ("' . implode('","', $standard_plugins) . '") +;'; + + $result = pwg_query($query); + $plugins = array(); + while ($row = mysql_fetch_assoc($result)) + { + array_push($plugins, $row['id']); + } + + if (!empty($plugins)) + { + $query = ' +UPDATE '.PREFIX_TABLE.'plugins +SET state="inactive" +WHERE id IN ("' . implode('","', $plugins) . '") +;'; + mysql_query($query); + + array_push( + $page['infos'], + 'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them: +<pre>' . implode(', ', $plugins) . '</pre>' + ); + } +} + ?> |