Private GIT

Skip to content
Snippets Groups Projects
Commit 7a680e03 authored by Laurent Pinsivy's avatar Laurent Pinsivy Committed by loiclau
Browse files

fix(acl): SNMP trap poller generation (#6069)

parent 58d86be4
No related branches found
No related tags found
No related merge requests found
...@@ -49,30 +49,27 @@ if (defined('_CENTREON_VARLIB_')) { ...@@ -49,30 +49,27 @@ if (defined('_CENTREON_VARLIB_')) {
/* /*
* Get Poller List * Get Poller List
*/ */
$DBRESULT = $pearDB->query("SELECT * FROM `nagios_server` WHERE `ns_activate` = '1' ORDER BY name ASC"); $acl = $centreon->user->access;
$n = $DBRESULT->numRows(); $tab_nagios_server = $acl->getPollerAclConf(array('get_row' => 'name',
'order' => array('name'),
'keys' => array('id'),
'conditions' => array('ns_activate' => 1)));
/* /* Sort the list of poller server */
* Display null option $pollersId = explode(',', $_GET['poller']);
*/ foreach ($tab_nagios_server as $key => $name) {
if ($n > 1) { if (in_array($key, $pollersId)) {
$tab_nagios_server = array(-1 => ""); $tab_nagios_server[$key] = $name;
} }
/*
* Display all servers list
*/
for ($i = 0; $nagios = $DBRESULT->fetchRow(); $i++) {
$tab_nagios_server[$nagios['id']] = $nagios['name'];
} }
$DBRESULT->free();
$n = count($tab_nagios_server);
/* /*
* Display all server options * Display all server options
*/ */
if ($n > 1) { if ($n > 1) {
$tab_nagios_server[0] = _("All Pollers"); $tab_nagios_server = array_merge(array(0 => _("All Pollers")), $tab_nagios_server);
} }
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment