diff --git a/auth_login.php b/auth_login.php
index ae8bf4e94a..eadd0a1bc2 100644
--- a/auth_login.php
+++ b/auth_login.php
@@ -465,6 +465,8 @@ function domains_ldap_search_dn($username, $realm) {
+
+
diff --git a/include/plugins.php b/include/plugins.php
index 9c78ecf779..0aaf8b0432 100644
--- a/include/plugins.php
+++ b/include/plugins.php
@@ -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']);
}
}
diff --git a/lib/snmpagent.php b/lib/snmpagent.php
index 6080ff6cb6..a7fd5dccca 100644
--- a/lib/snmpagent.php
+++ b/lib/snmpagent.php
@@ -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;
}