diff options
author | patdenice <patdenice@piwigo.org> | 2008-11-01 21:22:08 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2008-11-01 21:22:08 +0000 |
commit | 108937e81aa75c65d1b562260293c2e809bc1066 (patch) | |
tree | 5832988d5f921bbbb9683d8252998f9ea9ebe1c5 /admin/include | |
parent | 059a02f5a76dfe7de0d63373f3da7d1ab44c1bc0 (diff) |
merge -c2815 from trunk to branch 2.0
- bugs correction in upgrade_1.7.0.php.
- only non-standard plugins are deactivated during upgrade.
git-svn-id: http://piwigo.org/svn/branches/2.0@2816 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>' + ); + } +} + ?> |