diff options
author | redmatrix <mike@macgirvin.com> | 2016-08-28 21:48:17 -0700 |
---|---|---|
committer | redmatrix <mike@macgirvin.com> | 2016-08-28 21:48:17 -0700 |
commit | fb13e69b8e6fcb05e17be6a6bff79491a9639152 (patch) | |
tree | ec3d71f87604d88ea073b99663c775280b261515 | |
parent | 689f232243c11dc4211d1daed353032ced0e7229 (diff) | |
download | volse-hubzilla-fb13e69b8e6fcb05e17be6a6bff79491a9639152.tar.gz volse-hubzilla-fb13e69b8e6fcb05e17be6a6bff79491a9639152.tar.bz2 volse-hubzilla-fb13e69b8e6fcb05e17be6a6bff79491a9639152.zip |
supercedes pull request #503
-rw-r--r-- | Zotlabs/Module/Admin.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php index 4c1d56f02..fa4f32c8c 100644 --- a/Zotlabs/Module/Admin.php +++ b/Zotlabs/Module/Admin.php @@ -1288,19 +1288,27 @@ class Admin extends \Zotlabs\Web\Controller { if (x($_GET,"a") && $_GET['a']=="t"){ check_form_security_token_redirectOnErr('/admin/plugins', 'admin_plugins', 't'); - + $pinstalled = false; // Toggle plugin status $idx = array_search($plugin, \App::$plugins); if ($idx !== false){ unset(\App::$plugins[$idx]); uninstall_plugin($plugin); + $pinstalled = false; info( sprintf( t("Plugin %s disabled."), $plugin ) ); } else { \App::$plugins[] = $plugin; install_plugin($plugin); + $pinstalled = true; info( sprintf( t("Plugin %s enabled."), $plugin ) ); } set_config("system","addon", implode(", ",\App::$plugins)); + + if($pinstalled) { + @require_once("addon/$plugin/$plugin.php"); + if(function_exists($plugin.'_plugin_admin')) + goaway(z_root() . '/admin/plugins/' . $plugin); + } goaway(z_root() . '/admin/plugins' ); } // display plugin details |