diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-22 19:00:45 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-22 19:00:45 +0000 |
commit | a66bf4c5f663d16d6c2ceb4a6cb0a85f642dde43 (patch) | |
tree | 0eb8916039977a20e44260ab8fe522eae1522376 /admin | |
parent | 91eab2086875ad35aa93af00fc8b37d039d9f93c (diff) | |
download | ampache-a66bf4c5f663d16d6c2ceb4a6cb0a85f642dde43.tar.gz ampache-a66bf4c5f663d16d6c2ceb4a6cb0a85f642dde43.tar.bz2 ampache-a66bf4c5f663d16d6c2ceb4a6cb0a85f642dde43.zip |
Plugin work. Plugins are now pluggable: no plugin-specific code in the main Ampache
code. Plugins are now updatable, if configuration changes are needed for a new
version.
Diffstat (limited to 'admin')
-rw-r--r-- | admin/modules.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/admin/modules.php b/admin/modules.php index fd1e14b9..669840d9 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -123,7 +123,19 @@ switch ($_REQUEST['action']) { show_confirmation($title,$body,$url); break; case 'upgrade_plugin': - + /* Verify that this plugin exists */ + $plugins = Plugin::get_plugins(); + if (!array_key_exists($_REQUEST['plugin'],$plugins)) { + debug_event('plugins','Error: Invalid Plugin: ' . $_REQUEST['plugin'] . ' selected','1'); + break; + } + $plugin = new Plugin($_REQUEST['plugin']); + $plugin->upgrade(); + User::rebuild_all_preferences(); + $url = Config::get('web_path') . '/admin/modules.php?action=show_plugins'; + $title = _('Plugin Upgraded'); + $body = ''; + show_confirmation($title, $body, $url); break; case 'show_plugins': $plugins = Plugin::get_plugins(); |