2008-08-24 Sancho Lerena <slerena@gmail.com>

* include/functions_db.php: Fixed some warning messages
	due missing check before several foreachs.
	
	* index.php: Disabled development flag to detect config.

	* operation/agentes/networkmap.php: String too short for
	names, long IP address was being shortened.

	* operation/servers/view_server.php,
	operation/servers/view_server_detail.php
	godmode/servers/manage_recontask_form.php: Fixed some warnings
	and added proper message for empty screens.

	After this commit a beta1 package has been made.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1027 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2008-08-24 23:59:10 +00:00
parent 9b10a1e57b
commit 2574c60623
7 changed files with 50 additions and 6 deletions

View File

@ -1,3 +1,20 @@
2008-08-24 Sancho Lerena <slerena@gmail.com>
* include/functions_db.php: Fixed some warning messages
due missing check before several foreachs.
* index.php: Disabled development flag to detect config.
* operation/agentes/networkmap.php: String too short for
names, long IP address was being shortened.
* operation/servers/view_server.php,
operation/servers/view_server_detail.php
godmode/servers/manage_recontask_form.php: Fixed some warnings
and added proper message for empty screens.
After this commit a beta1 package has been made.
2008-08-22 Sancho Lerena <slerena@gmail.com>
* Massive header update. We're now officially on Beta1.

View File

@ -119,7 +119,7 @@ $table->data[] = array (__('OS'),print_select ($selectbox, "id_os", $id_os,'',''
unset ($selectbox);
// Group
$sql = "SELECT id_grupo, nombre FROM tgrupo";
$sql = "SELECT id_grupo, nombre FROM tgrupo WHERE id_grupo > 1";
$result = get_db_all_rows_sql ($sql);
foreach ($result as $row) {
$selectbox[$row["id_grupo"]] = $row["nombre"];

View File

@ -83,6 +83,10 @@ AND tusuario_perfil.id_usuario = '%s' AND (tusuario_perfil.id_grupo = %d OR tusu
$rowdup = get_db_all_rows_sql($query1);
$result = 0;
if (!$rowdup)
return $result;
foreach($rowdup as $row) {
// For each profile for this pair of group and user do...
switch ($access) {
@ -622,6 +626,8 @@ function get_alert_fires_in_period ($id_agent_module, $period, $date = 0) {
function get_alerts_in_group ($id_group) {
$alerts = array ();
$agents = get_agents_in_group ($id_group);
if (!$agents)
return;
foreach ($agents as $agent) {
$agent_alerts = get_alerts_in_agent ($agent["id_agente"]);
$alerts = array_merge ($alerts, $agent_alerts);
@ -982,6 +988,8 @@ function list_group ($id_user, $show_all = 1){
$mis_grupos = array (); // Define array mis_grupos to put here all groups with Agent Read permission
$sql = 'SELECT id_grupo, nombre FROM tgrupo';
$result = get_db_all_rows_sql ($sql);
if (!$result)
return $mis_grupos;
foreach ($result as $row) {
if (($row["id_grupo"] != 1 || $show_all == 1) && $row["id_grupo"] != 0 && give_acl($id_user,$row["id_grupo"], "AR") == 1) {
//Put in an array all the groups the user belongs to
@ -1004,7 +1012,8 @@ function list_group ($id_user, $show_all = 1){
function list_group2 ($id_user) {
$mis_grupos = array (); // Define array mis_grupos to put here all groups with Agent Read permission
$result = get_db_all_fields_in_table ("tgrupo","id_grupo");
if (!$result)
return $mis_grupos;
foreach ($result as $row) {
if (give_acl ($id_user, $row["id_grupo"], "AR") == 1) {
array_push ($mis_grupos, $row["id_grupo"]); //Put in array all the groups the user belongs to
@ -1024,6 +1033,10 @@ function list_group2 ($id_user) {
function get_user_groups ($id_user) {
$user_groups = array ();
$groups = get_db_all_rows_in_table ('tgrupo', 'nombre');
if (!$groups)
return $user_groups;
foreach ($groups as $group) {
if (! give_acl ($id_user, $group["id_grupo"], "AR"))
continue;
@ -1695,6 +1708,7 @@ function get_agent_module_value_sumatory ($id_agent_module, $period, $date = 0)
$timestamp_end = 0;
$sum = 0;
$data_value = 0;
foreach ($datas as $data) {
$timestamp_end = $data["utimestamp"];
$elapsed = $timestamp_end - $timestamp_begin;
@ -1782,6 +1796,10 @@ function show_alert_row_mini ($id_combined_alert) {
$sql = sprintf("SELECT talerta_agente_modulo.*, tcompound_alert.operation FROM talerta_agente_modulo, tcompound_alert
WHERE tcompound_alert.id_aam = talerta_agente_modulo.id_aam AND tcompound_alert.id = %d",$id_combined_alert);
$result = get_db_all_rows_sql ($sql);
if (!$result)
return;
echo "<table width=400 cellpadding=2 cellspacing=2 class='databox'>";
echo "<th>".__('Name')."</th>";
echo "<th>".__('Oper')."</th>";
@ -1793,6 +1811,7 @@ function show_alert_row_mini ($id_combined_alert) {
echo "<th>".__('MinMax.Al')."</th>";
echo "<th>".__('Days')."</th>";
echo "<th>".__('Fired')."</th>";
foreach ($result as $row2) {
if ($color == 1) {
$tdcolor = "datos";

View File

@ -26,7 +26,7 @@ global $build_version;
global $pandora_version;
// Set to 1 to do not check for installer or config file (for development!).
$develop_bypass = 1;
$develop_bypass = 0;
if ($develop_bypass != 1){
// If no config file, automatically try to install

View File

@ -115,8 +115,8 @@ function create_node ($agent, $simple = 0, $font_size = 10) {
// Short name
$name = strtolower ($agent["nombre"]);
if (strlen ($name) > 12)
$name = substr ($name, 0, 12);
if (strlen ($name) > 16)
$name = substr ($name, 0, 16);
if ($simple == 0){
// Set node icon
@ -125,6 +125,7 @@ function create_node ($agent, $simple = 0, $font_size = 10) {
} else {
$img_node = 'images/networkmap/0.png';
}
$node = $agent['id_agente'].' [ color="'.$status_color.'", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.40, height=0.40, label=<<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD><IMG SRC="'.$img_node.'"/></TD></TR>
<TR><TD>'.$name.'</TD></TR></TABLE>>,
shape="ellipse", URL="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'",

View File

@ -60,6 +60,11 @@ $table->head[6] = __('Version');
$table->head[7] = __('Updated at');
$table->data = array ();
if (!$servers){
echo "<div class='nf'>".__('There are no servers configured into the database')."</div>";
return;
}
foreach ($servers as $server) {
$data = array ();
$serverinfo = server_status ($server['id_server']);

View File

@ -159,7 +159,9 @@ if ($row["recon_server"]) {
}
echo "</table>";
} else {
echo "This server has no recon tasks assigned";
echo "<div class='nf'>";
echo __("This server has no recon tasks assigned");
echo "</div>";
}
}