2013-01-29 Miguel de Dios <miguel.dedios@artica.es>
* godmode/modules/manage_network_components_form.php, godmode/servers/manage_recontask.php, godmode/servers/manage_recontask_form.php, operation/menu.php, operation/agentes/status_monitor.php, operation/agentes/exportdata.excel.php, operation/agentes/datos_agente.php, operation/agentes/estado_generalagente.php, operation/agentes/estado_agente.php, general/login_help_dialog.php, general/shortcut_bar.php: uploaded a lost changes for to clean the source code structure. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7538 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
8c5ac783bd
commit
c4b33db131
|
@ -1,3 +1,16 @@
|
|||
2013-01-29 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/modules/manage_network_components_form.php,
|
||||
godmode/servers/manage_recontask.php,
|
||||
godmode/servers/manage_recontask_form.php, operation/menu.php,
|
||||
operation/agentes/status_monitor.php,
|
||||
operation/agentes/exportdata.excel.php,
|
||||
operation/agentes/datos_agente.php,
|
||||
operation/agentes/estado_generalagente.php,
|
||||
operation/agentes/estado_agente.php, general/login_help_dialog.php,
|
||||
general/shortcut_bar.php: uploaded a lost changes for to clean the
|
||||
source code structure.
|
||||
|
||||
2013-01-28 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_reporting.php: fixed the calculate the min,
|
||||
|
|
|
@ -22,24 +22,24 @@ global $config;
|
|||
|
||||
if (is_ajax()) {
|
||||
$skip_login_help = get_parameter('skip_login_help', 0);
|
||||
|
||||
|
||||
// Updates config['skip_login_help_dialog'] in order to don't show login help message
|
||||
if ($skip_login_help) {
|
||||
if (isset ($config['skip_login_help_dialog']))
|
||||
$result_config = db_process_sql_update('tconfig', array("value" => 1), array("token" => "skip_login_help_dialog"));
|
||||
$result_config = db_process_sql_update('tconfig', array("value" => 1), array("token" => "skip_login_help_dialog"));
|
||||
else
|
||||
$result_config = db_process_sql_insert ('tconfig', array ("value" => 1, "token" => "skip_login_help_dialog"));
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Prints help dialog information
|
||||
echo '<div id="login_help_dialog" title="' . __('Welcome to Pandora FMS') . '" style="">';
|
||||
|
||||
|
||||
echo '<div style="position:absolute; top:30px; left: 10px; text-align: left; right:0%; height:70px; width:560px; margin: 0 auto; border: 1px solid #FFF; line-height: 19px;">';
|
||||
echo '<span style="font-size: 15px;">' . __('If this is your first time with Pandora FMS, we propose you a few links to learn more about Pandora FMS. Monitoring could be overwhelm, but take your time to learn how to use the power of Pandora!') . '</span>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="position:absolute; top:110px; text-align: center; left:0%; right:0%; height:210px; width:580px; margin: 0 auto; border: 1px solid #FFF">';
|
||||
echo '<table cellspacing=0 cellpadding=0 style="border:1px solid #FFF; width:100%; height: 100%">';
|
||||
|
@ -61,7 +61,7 @@ echo '<div id="login_help_dialog" title="' . __('Welcome to Pandora FMS') . '" s
|
|||
echo '</div>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo '<tr>';
|
||||
echo '<td style="border:1px solid #FFF; width:50%; height: 50%">';
|
||||
echo '<div style="position: relative; float: left; width:40%;">';
|
||||
echo '<a href="http://pandorafms.com/" target="_blank" style="text-decoration:none;">' . html_print_image('images/enterprise_version.png', true, array("alt" => __('Enterprise version'), "border" => 0)) . '</a>';
|
||||
|
@ -80,9 +80,9 @@ echo '<div id="login_help_dialog" title="' . __('Welcome to Pandora FMS') . '" s
|
|||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="position:absolute; margin: 0 auto; top: 340px; right: 10px; border: 1px solid #FFF; width: 570px">';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="position:absolute; margin: 0 auto; top: 340px; right: 10px; border: 1px solid #FFF; width: 570px">';
|
||||
echo '<div style="float: left; margin-top: 3px; margin-left: 0px; width: 80%; text-align: left;">';
|
||||
html_print_checkbox('skip_login_help', 1, false, false, false, 'cursor: \'pointer\'');
|
||||
echo ' <span style="font-size: 12px;">' .__("Click here to don't show again this message") . '</span>';
|
||||
|
@ -99,18 +99,18 @@ echo '</div>';
|
|||
/* <![CDATA[ */
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
$("#login_help_dialog").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 400,
|
||||
width: 600,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
bgiframe: jQuery.browser.msie
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 400,
|
||||
width: 600,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
bgiframe: jQuery.browser.msie
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ else {
|
|||
$own_groups = array_keys(users_get_groups($config['id_user'], "AR", false));
|
||||
if (!empty($own_groups)) {
|
||||
$alerts_group = array_shift($own_groups);
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/alerts_status&refr=120&filter=fired&free_search=&ag_group=$alerts_group&filter_button=Filter'>";
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/alerts_status&refr=120&filter=fired&free_search=&ag_group=$alerts_group&filter_button=Filter'>";
|
||||
}
|
||||
}
|
||||
html_print_image("images/bell.png", false, array("title" => __("Alerts fired"), "style" => "margin-bottom: -5px;"));
|
||||
|
@ -163,17 +163,17 @@ $own_info = get_user_info ($config['id_user']);
|
|||
|
||||
// If user is admin can see all groups
|
||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")){
|
||||
echo "<a href='index.php?sec=eventos&sec2=operation/events/events&status=3&severity=4&event_view_hr=8&ev_group=0&group_rep=1&filter_only_alert=-1'>";
|
||||
echo "<a href='index.php?sec=eventos&sec2=operation/events/events&status=3&severity=4&event_view_hr=8&ev_group=0&group_rep=1&filter_only_alert=-1'>";
|
||||
}
|
||||
else {
|
||||
$own_groups = array_keys(users_get_groups($config['id_user'], "IR", false));
|
||||
if (!empty($own_groups)){
|
||||
$events_group = array_shift($own_groups);
|
||||
echo "<a href='index.php?sec=eventos&sec2=operation/events/events&status=3&severity=4&event_view_hr=8&ev_group=0&group_rep=1&ev_group=$events_group&filter_only_alert=-1'>";
|
||||
}
|
||||
echo "<a href='index.php?sec=eventos&sec2=operation/events/events&status=3&severity=4&event_view_hr=8&ev_group=0&group_rep=1&ev_group=$events_group&filter_only_alert=-1'>";
|
||||
}
|
||||
}
|
||||
html_print_image("images/lightning_go.png", false, array("title" => __("Critical events"), "style" => "margin-bottom: -5px;"));
|
||||
echo " ";
|
||||
echo " ";
|
||||
|
||||
// Calculate critical events (not validated)
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
|
@ -190,14 +190,14 @@ if ($shortcut_events == false)
|
|||
|
||||
$critical_events = 0;
|
||||
foreach($shortcut_events as $event){
|
||||
if ($event['criticity'] == 4 and $event['estado'] == 0){
|
||||
if ($event['criticity'] == 4 and $event['estado'] == 0) {
|
||||
$critical_events++;
|
||||
}
|
||||
}
|
||||
|
||||
echo "<span id='shortcut_critical_events' style='font-size: 9pt; color:#696969; font-weight: bold;' title='" . __('Critical events') . "'>" . $critical_events . "</span>";
|
||||
echo "</a>";
|
||||
echo " ";
|
||||
echo " ";
|
||||
// Calculate opened incidents (id integria incidents are not enabled)
|
||||
if ($config['integria_enabled'] == 0){
|
||||
echo "<a href='index.php?sec=incidencias&sec2=operation/incidents/incident&estado=0'>";
|
||||
|
@ -223,7 +223,7 @@ if ($config['integria_enabled'] == 0){
|
|||
|
||||
echo "<span id='shortcut_incidents_opened' style='font-size: 9pt; color:#696969; font-weight: bold;' title='" . __('Incidents opened') . "'>" . $shortcut_incidents . "</span>";
|
||||
echo "</a>";
|
||||
echo " ";
|
||||
echo " ";
|
||||
}
|
||||
echo " ";
|
||||
echo "<span style='font-size: 9pt; color:#696969; font-weight: bold;'>|</span>";
|
||||
|
@ -291,7 +291,7 @@ echo "</div>";
|
|||
}
|
||||
else{
|
||||
$('#shotcut_bar').css('height', '20px');
|
||||
$('#shortcut_button').css('height', '40px');
|
||||
$('#shortcut_button').css('height', '40px');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -306,7 +306,7 @@ echo "</div>";
|
|||
},
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
else {
|
||||
$('#shotcut_bar').css({height: 20}).animate({ height: '0' }, 900);
|
||||
|
@ -322,7 +322,7 @@ echo "</div>";
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
var id_user = $('#hidden-shortcut_id_user').val();
|
||||
function shortcut_check_alerts() {
|
||||
jQuery.post ("ajax.php",
|
||||
|
|
|
@ -425,13 +425,13 @@ $(document).ready (function () {
|
|||
$("input[name=snmp3_auth_user]").css({backgroundColor: '#fff'});
|
||||
$("input[name=snmp3_auth_user]").removeAttr('disabled');
|
||||
|
||||
$("input[name=snmp3_auth_pass]").css({backgroundColor: '#fff'});
|
||||
$("input[name=snmp3_auth_pass]").css({backgroundColor: '#fff'});
|
||||
$("input[name=snmp3_auth_pass]").removeAttr('disabled');
|
||||
|
||||
$("#snmp3_privacy_method").css({backgroundColor: '#fff'});
|
||||
$("#snmp3_privacy_method").css({backgroundColor: '#fff'});
|
||||
$("#snmp3_privacy_method").removeAttr('disabled');
|
||||
|
||||
$("input[name=snmp3_privacy_pass]").css({backgroundColor: '#fff'});
|
||||
|
||||
$("input[name=snmp3_privacy_pass]").css({backgroundColor: '#fff'});
|
||||
$("input[name=snmp3_privacy_pass]").removeAttr('disabled');
|
||||
|
||||
$("#snmp3_auth_method").css({backgroundColor: '#fff'});
|
||||
|
@ -452,20 +452,20 @@ $(document).ready (function () {
|
|||
$("input[name=snmp3_auth_pass]").val("");
|
||||
$("input[name=snmp3_auth_pass]").css({backgroundColor: '#ddd'});
|
||||
$("input[name=snmp3_auth_pass]").attr("disabled", true);
|
||||
|
||||
|
||||
$("#snmp3_privacy_method").css({backgroundColor: '#ddd'});
|
||||
$("#snmp3_privacy_method").attr("disabled", true);
|
||||
|
||||
|
||||
$("input[name=snmp3_privacy_pass]").val("");
|
||||
$("input[name=snmp3_privacy_pass]").css({backgroundColor: '#ddd'});
|
||||
$("input[name=snmp3_privacy_pass]").attr("disabled", true);
|
||||
|
||||
|
||||
$("#snmp3_auth_method").css({backgroundColor: '#ddd'});
|
||||
$("#snmp3_auth_method").attr("disabled", true);
|
||||
|
||||
|
||||
$("#snmp3_security_level").css({backgroundColor: '#ddd'});
|
||||
$("#snmp3_security_level").attr("disabled", true);
|
||||
|
||||
|
||||
$("input[name=active_snmp_v3]").val(0);
|
||||
$("input[name=snmp_community]").css({backgroundColor: '#fff'});
|
||||
$("input[name=snmp_community]").removeAttr('disabled');
|
||||
|
|
|
@ -135,7 +135,7 @@ if (isset($_GET["update"])) {
|
|||
$result = db_process_sql_update('trecon_task', $values, $where);
|
||||
else {
|
||||
if (!preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network))
|
||||
$reason = __('Incorrect format in Subnet field');
|
||||
$reason = __('Incorrect format in Subnet field');
|
||||
$result = false;
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ if (isset($_GET["update"])) {
|
|||
}
|
||||
else {
|
||||
echo '<h3 class="error">'.__('Error updating recon task').'</h3>';
|
||||
echo $reason;
|
||||
echo $reason;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,14 +43,14 @@ if (is_ajax ()) {
|
|||
}
|
||||
|
||||
if (isset ($_GET["update"]) or (isset($_GET["crt"]))) { // Edit mode
|
||||
|
||||
|
||||
$update_recon = true;
|
||||
if (isset ($_GET["crt"])){
|
||||
if ($_GET["crt"] != "update"){
|
||||
$update_recon = false;
|
||||
}
|
||||
else{
|
||||
$id_rt = get_parameter("upd");
|
||||
$id_rt = get_parameter("upd");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -235,26 +235,27 @@ foreach ($result as $row) {
|
|||
foreach($columns as $col => $attr) {
|
||||
if ($attr[1] != "modules_format_data")
|
||||
$data[] = $attr[1] ($row[$attr[0]]);
|
||||
|
||||
|
||||
// Its a single-data, multiline data (data snapshot) ?
|
||||
elseif (preg_match ("/[\n]+/i", $row[$attr[0]])){
|
||||
|
||||
|
||||
// Detect string data with \n and convert to <br>'s
|
||||
$datos = preg_replace ('/\n/i','<br>',$row[$attr[0]]);
|
||||
$datos = preg_replace ('/\s/i',' ',$datos);
|
||||
|
||||
// Because this *SHIT* of print_table monster, I cannot format properly this cells
|
||||
// so, eat this, motherfucker :))
|
||||
|
||||
|
||||
$datos = "<span style='font-family: mono,monospace;'>".$datos."</span>";
|
||||
|
||||
|
||||
// I dont why, but using index (value) method, data is automatically converted to html entities ¿?
|
||||
$data[$attr[1]]=$datos;
|
||||
|
||||
} else {
|
||||
// Just a string of alphanumerical data... just do print
|
||||
|
||||
$data[$attr[1]]=$row[$attr[0]];
|
||||
|
||||
}
|
||||
else {
|
||||
// Just a string of alphanumerical data... just do print
|
||||
|
||||
$data[$attr[1]]=$row[$attr[0]];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ if (is_ajax ()) {
|
|||
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
|
||||
|
||||
$filter_groups = '';
|
||||
$filter_groups = implode(',', array_keys($usr_groups));
|
||||
$filter_groups = implode(',', array_keys($usr_groups));
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
|
@ -442,7 +442,7 @@ foreach ($agents as $agent) {
|
|||
$data[0] .= '<div class="left actions" style="visibility: hidden; clear: left">';
|
||||
$data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'">'.__('View').'</a>';
|
||||
$data[0] .= ' | ';
|
||||
$data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'&tab=data">'.__('Data').'</a>';
|
||||
$data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'&tab=data">'.__('Data').'</a>';
|
||||
if (check_acl ($config['id_user'], $agent["id_grupo"], "AW")) {
|
||||
$data[0] .= ' | ';
|
||||
$data[0] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$agent["id_agente"].'">'.__('Edit').'</a>';
|
||||
|
|
|
@ -52,7 +52,7 @@ if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && !$is_extra) {
|
|||
|
||||
// Blank space below title, DONT remove this, this
|
||||
// Breaks the layout when Flash charts are enabled :-o
|
||||
echo '<div style="height: 10px"> </div>';
|
||||
echo '<div style="height: 10px"> </div>';
|
||||
|
||||
//Floating div
|
||||
echo '<div id="agent_access" style="float:right; width:320px; padding-top:10px;">';
|
||||
|
|
|
@ -124,7 +124,7 @@ if (!empty ($module)) {
|
|||
$arr["module_name"] = modules_get_agentmodule_name ($selected);
|
||||
$arr["agent_name"] = modules_get_agentmodule_agent_name ($selected);
|
||||
$arr["agent_id"] = modules_get_agentmodule_agent ($selected);
|
||||
$arr["utimestamp"] = $end;
|
||||
$arr["utimestamp"] = $end;
|
||||
array_push ($data, $arr);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -298,7 +298,7 @@ if (defined('METACONSOLE')) {
|
|||
if (!empty($modules_temp))
|
||||
$modules = array_merge($modules, $modules_temp);
|
||||
if (!empty($tags_temp))
|
||||
$tags = array_merge($tags, $tags_temp);
|
||||
$tags = array_merge($tags, $tags_temp);
|
||||
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
@ -872,7 +872,7 @@ foreach ($result as $row) {
|
|||
if (defined('METACONSOLE')) {
|
||||
$data[1] = '<strong><a href="'. $row["server_url"] .'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='. $row["id_agent"] . '&loginhash=auto&loginhash_data=' . $row["hashdata"] . '&loginhash_user=' . $row["user"] . '">';
|
||||
$data[1] .= ui_print_truncate_text($row["agent_name"], 'agent_small', false, true, false, '[…]', 'font-size:7.5pt;');
|
||||
$data[1] .= '</a></strong>';
|
||||
$data[1] .= '</a></strong>';
|
||||
}
|
||||
else {
|
||||
$data[1] = '<strong><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row["id_agent"].'">';
|
||||
|
|
|
@ -79,7 +79,7 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
|
||||
$sub2["godmode/snmpconsole/snmp_alert"]["text"] = __("SNMP alerts");
|
||||
$sub2['godmode/snmpconsole/snmp_filters']['text'] = __('SNMP filters');
|
||||
enterprise_hook ('snmpconsole_submenu');
|
||||
enterprise_hook ('snmpconsole_submenu');
|
||||
$sub2['godmode/snmpconsole/snmp_trap_generator']['text'] = __('SNMP trap generator');
|
||||
|
||||
$sub["operation/snmpconsole/snmp_view"]["sub2"] = $sub2;
|
||||
|
@ -104,7 +104,7 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
$menu_operation["network"]["sub"] = $sub;
|
||||
//End networkview
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Reports read
|
||||
if (check_acl ($config['id_user'], 0, "RR")) {
|
||||
|
@ -178,7 +178,7 @@ if (check_acl ($config['id_user'], 0, "RR")) {
|
|||
|
||||
$sub["godmode/reporting/map_builder"]["sub2"] = $sub2;
|
||||
|
||||
$sub["godmode/reporting/graphs"]["text"] = __('Custom graphs');
|
||||
$sub["godmode/reporting/graphs"]["text"] = __('Custom graphs');
|
||||
//Set godomode path
|
||||
$sub["godmode/reporting/graphs"]["subsecs"] = array(
|
||||
"operation/reporting/graph_viewer",
|
||||
|
@ -195,9 +195,9 @@ if (check_acl ($config['id_user'], 0, "RR")) {
|
|||
//End reporting
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Agent read, Server read
|
||||
if (check_acl ($config['id_user'], 0, "AR")) {
|
||||
if (check_acl ($config['id_user'], 0, "AR")) {
|
||||
|
||||
//INI GIS Maps
|
||||
if ($config['activate_gis']) {
|
||||
|
@ -329,7 +329,7 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
|
||||
// Messages
|
||||
$sub["operation/messages/message_list"]["text"] = __('Messages');
|
||||
$sub["operation/messages/message_list"]["refr"] = 0;
|
||||
$sub["operation/messages/message_list"]["refr"] = 0;
|
||||
|
||||
$sub2 = array ();
|
||||
$sub2["operation/messages/message_edit&new_msg=1"]["text"] = __('New message');
|
||||
|
|
Loading…
Reference in New Issue