2009-01-07 Esteban Sanchez <estebans@artica.es>

* godmode/agentes/modificar_agente.php: Old functions replace with new
	ones. Removed one indentation level when there's no access rights.
	
	* include/functions_ui.php: Wrong variable was being used in
	print_group_icon() to store the output and an incosistent behaviour
	was happening.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1320 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
esanchezm 2009-01-07 10:49:42 +00:00
parent 8a0a6c05fb
commit ee4e38351e
3 changed files with 63 additions and 51 deletions

View File

@ -1,3 +1,12 @@
2009-01-07 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/modificar_agente.php: Old functions replace with new
ones. Removed one indentation level when there's no access rights.
* include/functions_ui.php: Wrong variable was being used in
print_group_icon() to store the output and an incosistent behaviour
was happening.
2009-01-07 Esteban Sanchez <estebans@artica.es> 2009-01-07 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added to repository. Functions that prints * include/functions_ui.php: Added to repository. Functions that prints

View File

@ -234,46 +234,49 @@ if (mysql_num_rows($result)){
$tdcolor = "datos2"; $tdcolor = "datos2";
$color = 1; $color = 1;
} }
if (give_acl($config["id_user"], $id_grupo, "AW")==1){ if (! give_acl($config["id_user"], $id_grupo, "AW"))
// Agent name continue;
echo "<tr><td class='$tdcolor'>";
if ($row["disabled"] == 1){ // Agent name
echo "<i>"; echo "<tr class='$tdcolor' >";
} echo "<td>";
echo "<b><a href='index.php?sec=gagente& if ($row["disabled"] == 1){
sec2=godmode/agentes/configurar_agente&tab=main& echo "<i>";
id_agente=".$row["id_agente"]."'>".substr(strtoupper($row["nombre"]),0,20)."</a></b>";
if ($row["disabled"] == 1){
echo "<i>";
}
echo "</td>";
echo "<td align='center' class='$tdcolor'>";
// Has remote configuration ?
$agent_md5 = md5($row["nombre"], FALSE);
if (file_exists($config["remote_config"] . "/" . $agent_md5 . ".md5")){
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente=".$row["id_agente"]."&disk_conf=" . $agent_md5 . "'>";
echo "<img src='images/application_edit.png' border='0' align='middle' title='".__('Edit remote config')."'>";
echo "</A>";
}
echo "</td>";
// Operating System icon
echo "<td class='$tdcolor' align='center'>";
print_os_icon ($row["id_os"], false);
echo "</td>";
// Group icon and name
echo "<td class='$tdcolor' align='center'>".print_group_icon ($id_grupo, true)."</td>";
// Description
echo "<td class='".$tdcolor."f9'>".$row["comentarios"]."</td>";
// Action
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
borrar_agente=".$row["id_agente"]."'";
echo ' onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
echo "<img border='0' src='images/cross.png'></a></td>";
} }
echo "<b><a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&tab=main&
id_agente=".$row["id_agente"]."'>".substr(strtoupper($row["nombre"]),0,20)."</a></b>";
if ($row["disabled"] == 1){
echo "<i>";
}
echo "</td>";
echo "<td align='center'>";
// Has remote configuration ?
$agent_md5 = md5 ($row["nombre"], false);
if (file_exists ($config["remote_config"]."/".$agent_md5.".md5")) {
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente=".$row["id_agente"]."&disk_conf=" . $agent_md5 . "'>";
echo "<img src='images/application_edit.png' border='0' align='middle' title='".__('Edit remote config')."'>";
echo "</A>";
}
echo "</td>";
// Operating System icon
echo "<td align='center'>";
print_os_icon ($row["id_os"], false);
echo "</td>";
// Group icon and name
echo "<td>";
print_group_icon ($id_grupo);
echo "&nbsp; ".get_group_name ($id_grupo)."</td>";
// Description
echo "<td class='".$tdcolor."f9'>".$row["comentarios"]."</td>";
// Action
echo "<td align='center'><a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
borrar_agente=".$row["id_agente"]."'";
echo ' onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
echo "<img src='images/cross.png'></a></td>";
} }
echo "</table>"; echo "</table>";
echo "<table width='750'><tr><td align='right'>"; echo "<table width='750'><tr><td align='right'>";
@ -282,10 +285,10 @@ if (mysql_num_rows($result)){
echo "&nbsp;</td></tr><tr><td>"; echo "&nbsp;</td></tr><tr><td>";
} }
// Create agent button // Create agent button
echo "<form method='post' action='index.php?sec=gagente& echo "<form method='post' action='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&create_agent=1'>"; sec2=godmode/agentes/configurar_agente&create_agent=1'>";
echo "<input type='submit' class='sub next' name='crt' echo "<input type='submit' class='sub next' name='crt'
value='".__('Create agent')."'>"; value='".__('Create agent')."'>";
echo "</form></td></tr></table>"; echo "</form></td></tr></table>";
?> ?>

View File

@ -18,7 +18,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/** /**
* Evaluates a result using empty () and then prints an error message or a * Evaluates a result using empty() and then prints an error message or a
* success message * success message
* *
* @param mixed $result the results to evaluate. 0, NULL, false, '' or array() * @param mixed $result the results to evaluate. 0, NULL, false, '' or array()
@ -155,14 +155,14 @@ function print_group_icon ($id_group, $return = false, $path = "groups_small") {
return "-"; return "-";
} }
$return = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$id_group.'">'; $output = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$id_group.'">';
$return .= '<img class="bot" src="images/'.$path.'/'.$icon.'.png" alt="'.get_group_name ($id_group).'" title="'.get_group_name ($id_group).'" />'; $output .= '<img class="bot" src="images/'.$path.'/'.$icon.'.png" alt="'.get_group_name ($id_group).'" title="'.get_group_name ($id_group).'" />';
$return .= '</a>'; $output .= '</a>';
if ($return) if ($return)
return $return; return $output;
echo $return; echo $output;
} }
/** /**