From 2f33412ceacd51d9dccdb3dccc6b7b424f0911d0 Mon Sep 17 00:00:00 2001 From: mcfly Date: Sun, 17 Feb 2008 03:42:33 +0000 Subject: [PATCH] install/uninstall using plugin.xml doesn't lose setting in plugin table now --- e107_admin/plugin.php | 13 +++++++------ e107_handlers/plugin_class.php | 12 +++++++++--- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index f1b3402a0..5bc639d9e 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/plugin.php,v $ -| $Revision: 1.13 $ -| $Date: 2008-02-13 02:58:58 $ +| $Revision: 1.14 $ +| $Date: 2008-02-17 03:42:33 $ | $Author: mcfly_e107 $ +----------------------------------------------------------------------------+ */ @@ -241,13 +241,14 @@ if ($action == 'uninstall') { $plugin->manage_userclass('remove', $eplug_userclass); } + + $sql->db_Update('plugin', "plugin_installflag=0, plugin_version='{$eplug_version}' WHERE plugin_id='{$id}' "); + $plugin->manage_search('remove', $eplug_folder); + + $plugin->manage_notify('remove', $eplug_folder); } - $plugin->manage_search('remove', $eplug_folder); - $plugin->manage_notify('remove', $eplug_folder); - - $sql->db_Update('plugin', "plugin_installflag=0, plugin_version='{$eplug_version}' WHERE plugin_id='{$id}' "); if (isset($pref['plug_installed'][$plug['plugin_path']])) { unset($pref['plug_installed'][$plug['plugin_path']]); diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 23442c838..64fe38431 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $ -| $Revision: 1.33 $ -| $Date: 2008-02-13 02:58:58 $ +| $Revision: 1.34 $ +| $Date: 2008-02-17 03:42:33 $ | $Author: mcfly_e107 $ +----------------------------------------------------------------------------+ */ @@ -787,14 +787,20 @@ class e107plugin $txt .= $this->execute_function($path, $function, 'post'); + $eplug_addons = $this->getAddons($plug['plugin_path']); + if($function == 'install' || $function == 'upgrade') { - $eplug_addons = $this->getAddons($plug_vars['folder']); $sql->db_Update('plugin', "plugin_installflag = 1, plugin_addons = '{$eplug_addons}', plugin_version = '{$plug_vars['version']}' WHERE plugin_id = ".$id); $pref['plug_installed'][$plug['plugin_path']] = $plug_vars['version']; save_prefs(); } + if($function == 'uninstall') + { + $sql->db_Update('plugin', "plugin_installflag = 0, plugin_addons = '{$eplug_addons}', plugin_version = '{$plug_vars['version']}' WHERE plugin_id = ".$id); + } + if($function == 'install') { $txt .= LAN_INSTALL_SUCCESSFUL."
";