Skip to content

Commit

Permalink
Merge pull request librenms#214 from laf/issue-213
Browse files Browse the repository at this point in the history
Updated plugin system to force menu refresh and only run enabled plugins
  • Loading branch information
paulgear committed Mar 29, 2014
2 parents 3c96731 + 8dd6ca5 commit f580892
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
6 changes: 5 additions & 1 deletion html/pages/plugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
}
else
{
$plugin = dbFetchRow("SELECT `plugin_name` FROM `plugins` WHERE `plugin_name` = '".$vars['p']."'");
$plugin = dbFetchRow("SELECT `plugin_name` FROM `plugins` WHERE `plugin_name` = '".$vars['p']."' AND `plugin_active`='1'");
if(!empty($plugin))
{
require('plugins/'.$plugin['plugin_name'].'/'.$plugin['plugin_name'].'.inc.php');
}
else
{
print_error( "This plugin is either disabled or not available." );
}
}

?>
15 changes: 14 additions & 1 deletion html/pages/plugin/admin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,20 @@
$plugin_active = 0;
}

dbUpdate(array('plugin_active' => $plugin_active), 'plugins', '`plugin_id` = ?', array($plugin_id));
if(dbUpdate(array('plugin_active' => $plugin_active), 'plugins', '`plugin_id` = ?', array($plugin_id)))
{
echo('
<script type="text/javascript">
$.ajax({
url: "",
context: document.body,
success: function(s,x){
$(this).html(s);
}
});
</script>
');
}

}

Expand Down

0 comments on commit f580892

Please sign in to comment.