Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Cacti/cacti into feature…
Browse files Browse the repository at this point in the history
…s/installupdate
  • Loading branch information
micke2k committed Mar 24, 2016
2 parents 88c3a99 + dfba135 commit 6671b75
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
2 changes: 2 additions & 0 deletions auth_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ function domains_ldap_search_dn($username, $realm) {
<script type='text/javascript' src='<?php echo $config['url_path']; ?>include/js/jquery-ui.js' language='javascript'></script>
<script type='text/javascript' src='<?php echo $config['url_path']; ?>include/js/jquery.cookie.js' language='javascript'></script>
<script type='text/javascript' src='<?php echo $config['url_path']; ?>include/js/jquery.hotkeys.js'></script>
<script type='text/javascript' src='<?php echo $config['url_path']; ?>include/js/jquery.metadata.js'></script>
<script type='text/javascript' src='<?php echo $config['url_path']; ?>include/js/jquery.tablesorter.js'></script>
<script type='text/javascript' src='<?php echo $config['url_path']; ?>include/layout.js'></script>
<script type='text/javascript' src='<?php echo $config['url_path']; ?>include/themes/<?php print get_selected_theme();?>/main.js'></script>
<script type='text/javascript'>var theme='<?php print get_selected_theme();?>';</script>
Expand Down
4 changes: 2 additions & 2 deletions include/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function use_plugin ($name) {

/* On startup, register all plugins configured for use. */
if (isset($plugins) && is_array($plugins) && !defined('IN_CACTI_INSTALL')) {
foreach ($plugins as $name) {
use_plugin($name);
foreach ($plugins as $plugin) {
use_plugin($plugin['directory']);
}
}
38 changes: 35 additions & 3 deletions lib/snmpagent.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,42 @@ function snmpagent_get_pluginslist(){
foreach ($registered_plugins as $t) {
$pluginslist[$t['directory']] = $t;
}
foreach ($plugins as $t) {
$pluginslist[$t] = $t;
}

$path = $config['base_path'] . '/plugins/';
$dh = opendir($path);
if ($dh !== false) {
while (($file = readdir($dh)) !== false) {
if ((is_dir("$path/$file")) && (file_exists("$path/$file/setup.php")) && (!array_key_exists($file, $pluginslist))) {
include_once("$path/$file/setup.php");
if (!function_exists('plugin_' . $file . '_install') && function_exists($file . '_version')) {
$function = $file . '_version';
$cinfo = $function();
if (!isset($cinfo['author'])) $cinfo['author'] = 'Unknown';
if (!isset($cinfo['homepage'])) $cinfo['homepage'] = 'Not Stated';
if (isset($cinfo['webpage'])) $cinfo['homepage'] = $cinfo['webpage'];
if (!isset($cinfo['longname'])) $cinfo['longname'] = ucfirst($file);
$cinfo['status'] = -2; /* old PIA -- disabled */
if (in_array($file, $plugins)) {
$cinfo['status'] = -1; /* old PIA -- enabled */
}
$cinfo['directory'] = $file;
$pluginslist[$file] = $cinfo;

} elseif (function_exists('plugin_' . $file . '_install') && function_exists('plugin_' . $file . '_version')) {
$function = $file . '_version';
$cinfo = $function();
$cinfo['status'] = 0;
if (!isset($cinfo['author'])) $cinfo['author'] = 'Unknown';
if (!isset($cinfo['homepage'])) $cinfo['homepage'] = 'Not Stated';
if (isset($cinfo['webpage'])) $cinfo['homepage'] = $cinfo['webpage'];
if (!isset($cinfo['longname'])) $cinfo['homepage'] = ucfirst($file);
$cinfo['directory'] = $file;
$pluginslist[$file] = $cinfo;
}
}
}
closedir($dh);
}
return $pluginslist;
}

Expand Down

0 comments on commit 6671b75

Please sign in to comment.