diff options
author | Kevin Chabowski <kevin@kch42.de> | 2012-02-01 21:49:39 +0100 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2012-02-01 21:49:39 +0100 |
commit | 2c2b3c89f8b69b42220c19a811feb6a7b85e989f (patch) | |
tree | 578738860d8a61188919ece43b2f0805aa30bd9b /ratatoeskr/backend.php | |
parent | e4e0bf836669b5419a0e2c86409c46898beef5b4 (diff) | |
download | ratatoeskr-cms-2c2b3c89f8b69b42220c19a811feb6a7b85e989f.tar.gz ratatoeskr-cms-2c2b3c89f8b69b42220c19a811feb6a7b85e989f.tar.bz2 ratatoeskr-cms-2c2b3c89f8b69b42220c19a811feb6a7b85e989f.zip |
Plugin deletion can now be enforced.
This will skip the RatatoeskrPlugin::delete() part and will not load the
plugin before deletion, so you can delete a plugin if it contained
syntax errors without disabling plugins in config.php
Diffstat (limited to 'ratatoeskr/backend.php')
-rw-r--r-- | ratatoeskr/backend.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ratatoeskr/backend.php b/ratatoeskr/backend.php index 0f010d1..406219e 100644 --- a/ratatoeskr/backend.php +++ b/ratatoeskr/backend.php @@ -1649,19 +1649,22 @@ $backend_subactions = url_action_subactions(array( $ste->vars["pagetitle"] = $translation["menu_pluginlist"]; /* Delete plugins? */ - if(isset($_POST["delete"]) and ($_POST["really_delete"] == "yes") and (!empty($_POST["plugins_multiselect"]))) + if(isset($_POST["delete"]) and (($_POST["really_delete"] == "yes") or ($_POST["really_delete"] == "force")) and (!empty($_POST["plugins_multiselect"]))) { foreach($_POST["plugins_multiselect"] as $pid) { try { $plugin = Plugin::by_id($pid); - if(!isset($plugin_objs[$pid])) + if($_POST["really_delete"] != "force") { - eval($plugin->code); - $plugin_objs[$pid] = new $plugin->classname($pid); + if(!isset($plugin_objs[$pid])) + { + eval($plugin->code); + $plugin_objs[$pid] = new $plugin->classname($pid); + } + $plugin_objs[$pid]->uninstall(); } - $plugin_objs[$pid]->uninstall(); $plugin->delete(); } catch(DoesNotExistError $e) |