From 95752b0f72830bc14bda4beda7da401629664cd1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 27 Oct 2016 11:13:38 -0700 Subject: [PATCH] Fixes #1875 - Remove crons installed by plugin. --- e107_handlers/plugin_class.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 713f8d9a0..b1b2272b7 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -1643,6 +1643,9 @@ class e107plugin e107::getConfig('core')->setPref('plug_installed', $p_installed); + + $this->removeCrons($plug_vars); + } e107::getMessage()->addDebug("updated Installed plugins pref: ".print_a($p_installed,true)); @@ -1701,6 +1704,25 @@ class e107plugin } + private function removeCrons($plug_vars) + { + + if(!file_exists(e_PLUGIN. $plug_vars['folder']."/e_cron.php")) + { + return false; + } + + if(e107::getDb()->delete('cron', 'cron_function LIKE "'. $plug_vars['folder'] . '::%"')) + { + e107::getMessage()->addDebug($plug_vars['folder']." crons removed successfully."); // No LAN necessary + } + + return false; + + } + + + /** * Parse {plugin}_sql.php file and install/upgrade/uninstall tables. * @param $function string install|upgrade|uninstall