2012-07-24 Miguel de Dios <miguel.dedios@artica.es>

* godmode/servers/manage_recontask_form.php,
	godmode/alerts/configure_alert_compound.php,
	godmode/modules/manage_network_components.php,
	include/functions_ui.php, include/functions_incidents.php,
	include/functions_agents.php, include/functions_alerts.php,
	include/functions_messages.php, include/db/mysql.php,
	include/functions_reporting.php, include/functions_filemanager.php,
	include/auth/ldap.php, operation/events/events.php,
	operation/incidents/incident_detail.php, operation/tree.php,
	operation/agentes/estado_agente.php, operation/agentes/sla_view.php,
	operation/users/user_edit.php: cleaned source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6798 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-07-24 08:54:40 +00:00
parent 7e8201c2ac
commit 9cde128f7c
19 changed files with 218 additions and 145 deletions

View File

@ -1,3 +1,17 @@
2012-07-24 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/manage_recontask_form.php,
godmode/alerts/configure_alert_compound.php,
godmode/modules/manage_network_components.php,
include/functions_ui.php, include/functions_incidents.php,
include/functions_agents.php, include/functions_alerts.php,
include/functions_messages.php, include/db/mysql.php,
include/functions_reporting.php, include/functions_filemanager.php,
include/auth/ldap.php, operation/events/events.php,
operation/incidents/incident_detail.php, operation/tree.php,
operation/agentes/estado_agente.php, operation/agentes/sla_view.php,
operation/users/user_edit.php: cleaned source code style.
2012-07-23 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager_editor_prediction.php,

View File

@ -123,7 +123,8 @@ function update_compound ($step) {
}
alerts_set_alerts_compound_disable ($id, false);
} elseif ($step == 2) {
}
elseif ($step == 2) {
$monday = (bool) get_parameter ('monday');
$tuesday = (bool) get_parameter ('tuesday');
$wednesday = (bool) get_parameter ('wednesday');
@ -194,7 +195,8 @@ function update_compound ($step) {
/* TODO: fires_min and fires_max missing */
alerts_add_alert_compound_action ($id, (int) $id_action);
}
} elseif ($step == 3) {
}
elseif ($step == 3) {
$recovery_notify = (bool) get_parameter ('recovery_notify');
$field2_recovery = (bool) get_parameter ('field2_recovery');
$field3_recovery = (bool) get_parameter ('field3_recovery');
@ -203,7 +205,8 @@ function update_compound ($step) {
array ('recovery_notify' => $recovery_notify,
'field2_recovery' => $field2_recovery,
'field3_recovery' => $field3_recovery));
} else {
}
else {
return false;
}

View File

@ -86,16 +86,16 @@ if (isset ($_GET["update"]) or (isset($_GET["crt"]))) { // Edit mode
$parent_detection = $row["parent_detection"];
$parent_recursion = $row["parent_recursion"];
}
} elseif (isset ($_GET["create"]) or isset($_GET["crt"])) {
}
elseif (isset ($_GET["create"]) or isset($_GET["crt"])) {
$create_recon = true;
if (isset ($_GET["crt"])){
if ($_GET["crt"] != "Create"){
if (isset ($_GET["crt"])) {
if ($_GET["crt"] != "Create") {
$create_recon = false;
}
}
if ($create_recon){
if ($create_recon) {
$id_rt = -1;
$name = "";
$network = "";

View File

@ -22,23 +22,23 @@ if (!isset ($config)) {
die ('
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Pandora FMS - The Flexible Monitoring System - Console error</title>
<meta http-equiv="expires" content="0">
<meta http-equiv="content-type" content="text/html; charset=utf8">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="author" content="Sancho Lerena">
<meta name="copyright" content="This is GPL software. Created by Sancho Lerena and others">
<meta name="keywords" content="pandora, monitoring, system, GPL, software">
<meta name="robots" content="index, follow">
<link rel="icon" href="../../images/pandora.ico" type="image/ico">
<link rel="stylesheet" href="../styles/pandora.css" type="text/css">
</head>
<body>
<div id="main" style="float:left; margin-left: 100px">
<div align="center">
<div id="login_f">
<head>
<title>Pandora FMS - The Flexible Monitoring System - Console error</title>
<meta http-equiv="expires" content="0">
<meta http-equiv="content-type" content="text/html; charset=utf8">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="author" content="Sancho Lerena">
<meta name="copyright" content="This is GPL software. Created by Sancho Lerena and others">
<meta name="keywords" content="pandora, monitoring, system, GPL, software">
<meta name="robots" content="index, follow">
<link rel="icon" href="../../images/pandora.ico" type="image/ico">
<link rel="stylesheet" href="../styles/pandora.css" type="text/css">
</head>
<body>
<div id="main" style="float:left; margin-left: 100px">
<div align="center">
<div id="login_f">
<h1 id="log_f" class="error">You cannot access this file</h1>
<div>
<img src="../../images/pandora_logo.png" border="0"></a>
@ -47,9 +47,10 @@ if (!isset ($config)) {
<span class="error"><b>ERROR:</b>
You can\'t access this file directly!</span>
</div>
</div>
</div>
</body>
</div>
</div>
</div>
</body>
</html>
');
}
@ -127,7 +128,8 @@ function process_user_login ($login, $pass) {
if ($profile === false && empty ($config["auth"]["create_user_undefined"])) {
$config["auth_error"] = "No profile"; //Error message, don't translate
return false; //User doesn't have a profile so doesn't have access
} elseif ($profile === false && !empty ($config["auth"]["create_user_undefined"])) {
}
elseif ($profile === false && !empty ($config["auth"]["create_user_undefined"])) {
$ret = profile_create_user_profile ($login); //User doesn't have a profile but we are asked to create one
if ($ret === false) {
$config["auth_error"] = "Profile creation failed"; //Error message, don't translate
@ -164,8 +166,10 @@ function is_user_admin ($user_id) {
*/
function is_user ($id_user) {
$user = get_user_info ($id_user);
if (empty ($user))
return false;
return true;
}
@ -182,6 +186,7 @@ function get_user_fullname ($id_user) {
//User doesn't exist
return '';
}
return (string) $info["fullname"];
}
@ -194,6 +199,7 @@ function get_user_fullname ($id_user) {
*/
function get_user_email ($id_user) {
$info = get_user_info ($id_user);
return (string) $info["email"];
}
@ -209,6 +215,7 @@ function get_user_id ($user) {
if (is_array ($user))
/* FIXME: Is this right? */
return $user['id_user'];
return (int) $user;
}
@ -245,7 +252,8 @@ function get_user_admins () {
if (! empty ($ldap_cache["cached_admins"])) {
return $ldap_cache["cached_admins"];
} else {
}
else {
$ldap_cache["cached_admins"] = array ();
}
@ -254,12 +262,14 @@ function get_user_admins () {
$sr = ldap_search ( $ldap_cache["ds"], $config["auth"]["ldap_admin_group_name"], $search_filter, array ($config["auth"]["ldap_admin_group_attr"]));
if (!$sr) {
$ldap_cache["error"] .= 'Error searching LDAP server (get_user_admins): ' . ldap_error ($ldap_cache["ds"]);
} else {
}
else {
$admins = ldap_get_entries( $ldap_cache["ds"], $sr);
for( $x = 0; $x < $admins[0][$config["auth"]["ldap_admin_group_attr"]]['count']; $x++) {
if ($config["auth"]["ldap_admin_group_type"] != 'posixgroup') {
$ldap_cache["cached_admins"][] = stripdn ($admins[0][$config["auth"]["ldap_admin_group_attr"]][$x]);
} else {
}
else {
$ldap_cache["cached_admins"][] = $admins[0][$config["auth"]["ldap_admin_group_attr"]][$x];
}
}
@ -305,17 +315,20 @@ function ldap_search_user ($login) {
if (!$sr) {
$ldap_cache["error"] .= 'Error searching LDAP server: ' . ldap_error ($ldap_cache["ds"]);
} else {
}
else {
$info = @ldap_get_entries ($ldap_cache["ds"], $sr );
if ( $info['count'] != 1 ) {
$ldap_cache["error"] .= 'Invalid user';
} else {
}
else {
$nick = $info[0]['dn'];
}
@ldap_free_result ($sr);
}
@ldap_close ($ldap_cache["ds"]);
}
return $nick;
}
@ -337,7 +350,8 @@ function ldap_valid_login ($login, $password) {
$ret = false;
if (!empty ($config["auth"]["ldap_port"])) {
$ds = @ldap_connect ($config["auth"]["ldap_server"], $config["auth"]["ldap_port"]); //Since this is a separate bind, we don't store it global
} else {
}
else {
$ds = @ldap_connect ($config["auth"]["ldap_server"]); //Since this is a separate bind we don't store it global
}
if ($ds) {
@ -355,15 +369,18 @@ function ldap_valid_login ($login, $password) {
if (!$r) {
$ldap_cache["error"] .= 'Invalid login';
//$ldap_cache["error"] .= ': incorrect password'; // uncomment for debugging
} else {
}
else {
$ret = true;
}
} else {
}
else {
$ldap_cache["error"] .= 'Invalid login';
//$ldap_cache["error"] .= ': no such user';
}
@ldap_close ($ds);
} else {
}
else {
$ldap_cache["error"] .= 'Error connecting to LDAP server';
}
return $ret;
@ -387,12 +404,14 @@ function ldap_load_user ($login) {
if (!$sr) {
$ldap_cache["error"] .= 'Error searching LDAP server (load_user): ' . ldap_error( $ldap_cache["ds"] );
} else {
}
else {
$info = @ldap_get_entries ($ldap_cache["ds"], $sr);
if ($info['count'] != 1) {
$ldap_cache["error"] .= 'Invalid login';
//$ldap_cache["error"] .= ', could not load user'; //Uncomment for debugging
} else {
}
else {
$ret = array ();
foreach ($config["auth"]["ldap_user_attr"] as $internal_key => $ldap_key) {
$ret["last_connect"] = $time;
@ -408,7 +427,8 @@ function ldap_load_user ($login) {
@ldap_free_result ($sr);
}
@ldap_close ( $ldap_cache["ds"] );
} else {
}
else {
$ldap_cache["error"] .= 'Could not connect to LDAP server';
}
@ -540,9 +560,11 @@ function ldap_connect_bind () {
if (!empty ($config["auth"]["ldap_port"]) && !is_resource ($ldap_cache["ds"])) {
$ldap_cache["ds"] = @ldap_connect ($config["auth"]["ldap_server"], $config["auth"]["ldap_port"]);
} elseif (!is_resource ($ldap_cache["ds"])) {
}
elseif (!is_resource ($ldap_cache["ds"])) {
$ldap_cache["ds"] = @ldap_connect ($config["auth"]["ldap_server"]);
} else {
}
else {
return true;
}
@ -560,7 +582,8 @@ function ldap_connect_bind () {
if (!empty ($config["auth"]["ldap_admin_dn"])) {
$r = @ldap_bind ($ldap_cache["ds"], $config["auth"]["ldap_admin_dn"], $config["auth"]["ldap_admin_pwd"]);
} else {
}
else {
$r = @ldap_bind ($ldap_cache["ds"]);
}
@ -569,10 +592,10 @@ function ldap_connect_bind () {
return $ret;
}
return true;
} else {
}
else {
$ldap_cache["error"] .= 'Error connecting to LDAP server';
return $ret;
}
}
?>

View File

@ -1046,5 +1046,4 @@ function mysql_db_get_table_count($sql, $search_history_db = false) {
return $count;
}
?>

View File

@ -1897,7 +1897,15 @@ function agents_monitor_critical ($id_agent, $filter="") {
$filter = " AND ".$filter;
}
return db_get_sql ("SELECT COUNT( DISTINCT tagente_modulo.id_agente_modulo) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.disabled = 0 AND tagente_estado.utimestamp != 0 AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo AND tagente_modulo.disabled = 0 AND estado = 1 AND tagente_estado.id_agente = tagente.id_agente AND tagente.id_agente = $id_agent".$filter);
return db_get_sql ("SELECT COUNT( DISTINCT tagente_modulo.id_agente_modulo)
FROM tagente_estado, tagente, tagente_modulo
WHERE tagente.disabled = 0
AND tagente_estado.utimestamp != 0
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
AND tagente_modulo.disabled = 0
AND estado = 1
AND tagente_estado.id_agente = tagente.id_agente
AND tagente.id_agente = $id_agent" . $filter);
}
// Get warning monitors by using the status code in modules.
@ -1908,7 +1916,15 @@ function agents_monitor_warning ($id_agent, $filter="") {
$filter = " AND ".$filter;
}
return db_get_sql ("SELECT COUNT( DISTINCT tagente_modulo.id_agente_modulo) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.disabled = 0 AND tagente_estado.utimestamp != 0 AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo AND tagente_modulo.disabled = 0 AND estado = 2 AND tagente_estado.id_agente = tagente.id_agente AND tagente.id_agente = $id_agent".$filter);
return db_get_sql ("SELECT COUNT( DISTINCT tagente_modulo.id_agente_modulo)
FROM tagente_estado, tagente, tagente_modulo
WHERE tagente.disabled = 0
AND tagente_estado.utimestamp != 0
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
AND tagente_modulo.disabled = 0
AND estado = 2
AND tagente_estado.id_agente = tagente.id_agente
AND tagente.id_agente = $id_agent" . $filter);
}
// Get unknown monitors by using the status code in modules.
@ -1919,18 +1935,33 @@ function agents_monitor_unknown ($id_agent, $filter="") {
$filter = " AND ".$filter;
}
return db_get_sql ("SELECT COUNT( DISTINCT tagente_modulo.id_agente_modulo) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.disabled = 0 AND tagente_estado.utimestamp != 0 AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo AND tagente_modulo.disabled = 0 AND estado = 3 AND tagente_estado.id_agente = tagente.id_agente AND tagente.id_agente = $id_agent".$filter);
return db_get_sql ("SELECT COUNT( DISTINCT tagente_modulo.id_agente_modulo)
FROM tagente_estado, tagente, tagente_modulo
WHERE tagente.disabled = 0
AND tagente_estado.utimestamp != 0
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
AND tagente_modulo.disabled = 0
AND estado = 3
AND tagente_estado.id_agente = tagente.id_agente
AND tagente.id_agente = $id_agent" . $filter);
}
// Get ok monitors by using the status code in modules.
function agents_monitor_ok ($id_agent, $filter="") {
if ($filter) {
$filter = " AND ".$filter;
}
return db_get_sql ("SELECT COUNT( DISTINCT tagente_modulo.id_agente_modulo) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.disabled = 0 AND tagente_estado.utimestamp != 0 AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo AND tagente_modulo.disabled = 0 AND estado = 0 AND tagente_estado.id_agente = tagente.id_agente AND tagente.id_agente = $id_agent".$filter);
return db_get_sql ("SELECT COUNT( DISTINCT tagente_modulo.id_agente_modulo)
FROM tagente_estado, tagente, tagente_modulo
WHERE tagente.disabled = 0
AND tagente_estado.utimestamp != 0
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
AND tagente_modulo.disabled = 0
AND estado = 0
AND tagente_estado.id_agente = tagente.id_agente
AND tagente.id_agente = $id_agent" . $filter);
}
/**

View File

@ -1523,7 +1523,8 @@ function alerts_validate_alert_compound ($id_alert_compound) {
$group_id, $agent_id, 1, $config["id_user"],
"alert_manual_validation", 1, $alert["id"],
$id);
} elseif ($result === false) {
}
elseif ($result === false) {
return false;
}
}

View File

@ -94,12 +94,14 @@ if (!function_exists ('mime_content_type')) {
$ext = strtolower (array_pop (explode ('.', $filename)));
if (array_key_exists ($ext, $mime_types)) {
return $mime_types[$ext];
} elseif (function_exists ('finfo_open')) {
}
elseif (function_exists ('finfo_open')) {
$finfo = finfo_open (FILEINFO_MIME);
$mimetype = finfo_file ($finfo, $filename);
finfo_close ($finfo);
return $mimetype;
} else {
}
else {
$temp = exec ("file ".$filename);
if (isset($temp) && $temp != '')
return $temp;

View File

@ -300,12 +300,15 @@ function incidents_delete_note ($id_note, $transact = true) {
if ($transact == true && $errors > 0) {
db_process_sql_rollback ();
return false;
} elseif ($transact == true) {
}
elseif ($transact == true) {
db_process_sql_commit ();
return true;
} elseif ($errors > 0) {
}
elseif ($errors > 0) {
return false;
} else {
}
else {
return true;
}
}

View File

@ -74,7 +74,8 @@ function messages_create_group ($usuario_origen, $dest_group, $subject, $mensaje
if (! array_key_exists ($usuario_origen, $users)) {
//Users don't exist in the system
return false;
} elseif (empty ($group_users)) {
}
elseif (empty ($group_users)) {
//There are no users in the group, so it hasn't failed although it hasn't done anything.
return true;
}

View File

@ -1023,7 +1023,8 @@ function reporting_get_group_stats ($id_group = 0) {
function reporting_event_reporting ($id_group, $period, $date = 0, $return = false) {
if (empty ($date)) {
$date = get_system_time ();
} elseif (!is_numeric ($date)) {
}
elseif (!is_numeric ($date)) {
$date = strtotime ($date);
}
@ -1326,6 +1327,7 @@ function reporting_alert_reporting ($id_group, $period = 0, $date = 0, $return =
if (! sizeof ($alerts_fired)) {
if (!$return)
echo $output;
return $output;
}
$table = reporting_get_fired_alerts_table ($alerts_fired);
@ -1340,6 +1342,7 @@ function reporting_alert_reporting ($id_group, $period = 0, $date = 0, $return =
if (!$return)
echo $output;
return $output;
}
@ -1435,13 +1438,15 @@ function reporting_get_monitors_down_table ($monitors_down) {
$data[0] = '';
if ($monitor['descripcion'] != '') {
$data[1] = $monitor['descripcion'];
} else {
}
else {
$data[1] = $monitor['nombre'];
}
array_push ($table->data, $data);
}
}
}
return $table;
}
@ -1457,7 +1462,9 @@ function reporting_get_monitors_down_table ($monitors_down) {
*/
function reporting_print_group_reporting ($id_group, $return = false) {
$agents = agents_get_group_agents ($id_group, false, "none");
$output = '<strong>'.__('Agents in group').': '.count ($agents).'</strong><br />';
$output = '<strong>' .
sprintf(__('Agents in group: %s'), count($agents)) .
'</strong><br />';
if ($return === false)
echo $output;
@ -1532,6 +1539,7 @@ function reporting_get_agent_alerts_table ($id_agent, $period = 0, $date = 0) {
array_push ($table->data, $data);
}
return $table;
}
@ -1612,11 +1620,12 @@ function reporting_get_agent_modules_table ($id_agent, $period = 0, $date = 0) {
*/
function reporting_get_agent_detailed ($id_agent, $period = 0, $date = 0, $return = false) {
$output = '';
$n_a_string = __('N/A').'(*)';
$n_a_string = __('N/A(*)');
/* Show modules in agent */
$output .= '<div class="agent_reporting">';
$output .= '<h3 style="text-decoration: underline">'.__('Agent').' - '.agents_get_name ($id_agent).'</h3>';
$output .= '<h3 style="text-decoration: underline">' .
__('Agent') . ' - ' . agents_get_name ($id_agent) . '</h3>';
$output .= '<h4>'.__('Modules').'</h3>';
$table_modules = reporting_get_agent_modules_table ($id_agent, $period, $date);
$table_modules->width = '99%';

View File

@ -469,12 +469,6 @@ foreach ($agents as $agent) {
}
$data[0] .= '</div>';
/*if (check_acl ($config['id_user'], $agent["id_grupo"], "AW")) {
$data[0] .= '<a href="index.php?sec=estado&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$agent["id_agente"].'">';
$data[0] .= html_print_image ("images/setup.png", true, array ("border" => 0, "width" => 16));
$data[0] .= '</a>&nbsp;';
}*/
$data[1] = ui_print_truncate_text($agent["description"], 'description', false, true, true, '[&hellip;]', 'font-size: 6.5pt');
$data[2] = ui_print_os_icon ($agent["id_os"], false, true);
@ -494,15 +488,15 @@ foreach ($agents as $agent) {
$data[5] .= $agent_info["modules"];
if ($agent_info["monitor_alertsfired"] > 0)
$data[5] .= ' : <span class="orange">'.$agent_info["monitor_alertsfired"].'</span>';
$data[5] .= ' : <span class="orange">' . $agent_info["monitor_alertsfired"] . '</span>';
if ($agent_info["monitor_critical"] > 0)
$data[5] .= ' : <span class="red">'.$agent_info["monitor_critical"].'</span>';
$data[5] .= ' : <span class="red">' . $agent_info["monitor_critical"] . '</span>';
if ($agent_info["monitor_warning"] > 0)
$data[5] .= ' : <span class="yellow">'.$agent_info["monitor_warning"].'</span>';
$data[5] .= ' : <span class="yellow">' . $agent_info["monitor_warning"] . '</span>';
if ($agent_info["monitor_unknown"] > 0)
$data[5] .= ' : <span class="grey">'.$agent_info["monitor_unknown"].'</span>';
$data[5] .= ' : <span class="grey">' . $agent_info["monitor_unknown"] . '</span>';
if ($agent_info["monitor_normal"] > 0)
$data[5] .= ' : <span class="green">'.$agent_info["monitor_normal"].'</span>';
$data[5] .= ' : <span class="green">' . $agent_info["monitor_normal"] . '</span>';
$data[5] .= '</b>';
$data[6] = $agent_info["status_img"];
@ -550,19 +544,6 @@ if (!empty ($table->data)) {
} else {
echo '<div class="nf">'.__('There are no defined agents').'</div>';
}
/* Godmode controls SHOULD NOT BE HERE
if (check_acl ($config['id_user'], 0, "LM") || check_acl ($config['id_user'], 0, "AW")
|| check_acl ($config['id_user'], 0, "PM") || check_acl ($config['id_user'], 0, "DM")
|| check_acl ($config['id_user'], 0, "UM")) {
echo '<form method="post" action="index.php?sec=estado&amp;sec2=godmode/agentes/configurar_agente">';
html_print_input_hidden ('new_agent', 1);
html_print_submit_button (__('Create agent'), 'crt', false, 'class="sub next"');
echo '</form>';
}
*/
?>
<script type="text/javascript">
@ -583,6 +564,5 @@ $(document).ready (function () {
$("#group_id").blur (function () {
$(this).css ("width", "180px");
});
});
</script>

View File

@ -71,31 +71,35 @@ foreach ($modules as $module_id => $module) {
if ($loc < $offset) {
$loc++;
continue; //Skip offset
} elseif ($loc >= $offset + $config["block_size"]) {
}
elseif ($loc >= $offset + $config["block_size"]) {
continue;
}
$data = array ();
$data[0] = ui_print_moduletype_icon ($module["id_tipo_modulo"], true);
$data[1] = ui_print_string_substr ($module["nombre"], 25, true);
if ($module["min_critical"] != 0){
if ($module["min_critical"] != 0) {
$sla_min = $module["min_critical"];
$data[2] = format_numeric (reporting_get_agentmodule_sla ($module_id, $config["sla_period"], $sla_min));
$data[2] = 100 - $data[2]. "%";
} else {
}
else {
$data[2] = format_numeric (reporting_get_agentmodule_sla ($module_id, $config["sla_period"], 1)).'%';
}
//TODO: Make this work for all new status
$status = modules_get_agentmodule_status ($module_id);
if ($status == 1){
if ($status == 1) {
$data[3] = html_print_image ("images/pixel_red.png", true, array ("width" => 40, "height" => 18, "title" => __('Module Down')));
} else {
}
else {
$data[3] = html_print_image ("images/pixel_green.png", true, array ("width" => 40, "height" => 18, "title" => __('Module Up')));
}
if ($module["module_interval"] > 0) {
$data[4] = $module["module_interval"];
} else {
}
else {
$data[4] = $interval;
}
array_push ($table->data, $data);

View File

@ -226,7 +226,8 @@ if (isset ($id_inc)) { //If $id_inc is set (when $_GET["id"] is set, not $_GET["
ui_print_page_header (__('Incident details'). ' #'.$id_inc, "images/book_edit.png", false, "", false, "");
echo '<form name="accion_form" method="POST" action="index.php?sec=workspace&sec2=operation/incidents/incident&action=update">';
echo '<input type="hidden" name="id_inc" value="'.$id_inc.'">';
} else {
}
else {
ui_print_page_header (__('Create incident'), "images/book_edit.png", false, "", false, "");
echo '<form name="accion_form" method="POST" action="index.php?sec=workspace&sec2=operation/incidents/incident&action=insert">';
}

View File

@ -135,7 +135,8 @@ if (is_ajax ())
if ($agent["ultimo_contacto_remoto"] == "01-01-1970 00:00:00") {
echo __('Never');
} else {
}
else {
echo $agent["ultimo_contacto_remoto"];
}
echo '</td></tr>';

View File

@ -39,7 +39,8 @@ if ((!check_acl ($config["id_user"], users_get_groups ($id), "UM")) AND ($id !=
//If current user is editing himself or if the user has UM (User Management) rights on any groups the user is part of AND the authorization scheme allows for users/admins to update info
if (($config["id_user"] == $id || check_acl ($config["id_user"], users_get_groups ($id), "UM")) && $config["user_can_update_info"]) {
$view_mode = false;
} else {
}
else {
$view_mode = true;
}