Merge branch 'develop' of https://github.com/pandorafms/pandorafms into develop

This commit is contained in:
m-lopez-f 2015-07-21 13:26:21 +02:00
commit 3e7264a470
6 changed files with 49 additions and 14 deletions

View File

@ -495,6 +495,7 @@ if ($paginate_module) {
ui_pagination($total_modules, $url);
}
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox data';
$table->head = array ();

View File

@ -798,31 +798,39 @@ function html_print_extended_select_for_time ($name, $selected = '',
* @return string HTML code if return parameter is true.
*/
function html_print_extended_select_for_cron ($hour = '*', $minute = '*', $mday = '*', $month = '*', $wday = '*', $return = false) {
# Hours
for ($i = 0; $i < 24; $i++) {
$hours[$i] = $i;
}
# Minutes
for ($i = 0; $i < 60; $i+=5) {
$minutes[$i] = $i;
}
# Month days
for ($i = 0; $i < 31; $i++) {
$mdays[$i] = $i;
}
# Months
for ($i = 0; $i < 12; $i++) {
$months[$i] = date('F', mktime (0, 0, 0, $i, 1));
}
# Days of the week
$wdays = array(__('Sunday'), __('Monday'), __('Tuesday'), __('Wednesday'), __('Thursday'), __('Friday'), __('Saturday'));
$wdays = array(
__('Sunday'),
__('Monday'),
__('Tuesday'),
__('Wednesday'),
__('Thursday'),
__('Friday'),
__('Saturday'));
# Print selectors
$table = new stdClass();
$table->id = 'cron';
$table->width = '100%';
$table->class = 'databox data';
@ -831,7 +839,7 @@ function html_print_extended_select_for_cron ($hour = '*', $minute = '*', $mday
$table->head[2] = __('Month day');
$table->head[3] = __('Month');
$table->head[4] = __('Week day');
$table->data[0][0] = html_print_select ($hours, 'hour', $hour, '', __('Any'), '*', true, false, false);
$table->data[0][1] = html_print_select ($minutes, 'minute', $minute, '', __('Any'), '*', true, false, false);
$table->data[0][2] = html_print_select ($mdays, 'mday', $mday, '', __('Any'), '*', true, false, false);
@ -1012,7 +1020,10 @@ function html_print_div ($options, $return = false) {
*
* @return string HTML code if return parameter is true.
*/
function html_print_input_password ($name, $value, $alt = '', $size = 50, $maxlength = 255, $return = false, $disabled = false) {
function html_print_input_password ($name, $value, $alt = '',
$size = 50, $maxlength = 255, $return = false, $disabled = false,
$required = false) {
if ($maxlength == 0)
$maxlength = 255;

View File

@ -23,6 +23,15 @@ include_once($config['homedir'] . "/include/functions_agents.php");
include_once($config['homedir'] . '/include/functions_users.php');
include_once($config['homedir'] . '/include/functions_tags.php');
function modules_is_not_init($id_agent_module) {
$row = db_get_row('tagente_estado', 'id_agente_modulo', $id_agent_module);
if ($row['estado'] == AGENT_MODULE_STATUS_NO_DATA)
return true;
else
return false;
}
function modules_is_disable_agent($id_agent_module) {
$sql = "
SELECT disabled

View File

@ -626,7 +626,8 @@ function reporting_SLA($report, $content, $type = 'dinamic',
}
}
if (modules_is_disable_agent($sla['id_agent_module'])) {
if (modules_is_disable_agent($sla['id_agent_module'])
|| modules_is_not_init($item['id_agent_module'])) {
if ($metaconsole_on) {
//Restore db connection
metaconsole_restore_db();
@ -3673,7 +3674,10 @@ function reporting_availability($report, $content) {
}
}
if (modules_is_disable_agent($item['id_agent_module'])) {
if (modules_is_disable_agent($item['id_agent_module'])
|| modules_is_not_init($item['id_agent_module'])) {
//Restore dbconnection
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
metaconsole_restore_db();
@ -3905,7 +3909,14 @@ function reporting_general($report, $content) {
}
}
if (modules_is_disable_agent($row['id_agent_module'])) {
if (modules_is_disable_agent($row['id_agent_module']) ||
modules_is_not_init($item['id_agent_module'])) {
if (is_metaconsole()) {
//Restore db connection
metaconsole_restore_db();
}
continue;
}

View File

@ -487,6 +487,7 @@ function snmp_browser_print_oid ($oid = array(), $custom_action = '',
function snmp_browser_print_container ($return = false, $width = '100%', $height = '500px', $display = '') {
// Target selection
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->size = array ();
@ -506,10 +507,11 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height
'2c' => 'v. 2c',
'3' => 'v. 3'),
'snmp_browser_version', '', 'checkSNMPVersion();', '', '', true, false, false, '');
$table->data[0][4] = html_print_button(__('Browse'), 'browse', false, 'snmpBrowse()', 'class="sub search" style="margin-top:0px;"', true);
// SNMP v3 options
$table3 = new stdClass();
$table3->width = '100%';
$table3->valign[0] = '';
@ -533,6 +535,7 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height
'authNoPriv' => __('Auth and not privacy method'), 'authPriv' => __('Auth and privacy method')), 'snmp3_browser_security_level', '', '', '', '', true);
// Search tools
$table2 = new stdClass();
$table2->width = '100%';
$table2->class = 'databox filters';
$table2->size = array ();

View File

@ -132,7 +132,7 @@ if (!defined('METACONSOLE')) {
}
}
else {
if ($ag_group != "0" && check_acl ($config["id_user"], $id_ag_group, "AR")) {
$sql_conditions_group = sprintf (" AND tagente.id_grupo IN (%s) ", $ag_group);
}