2009-10-13 Sancho Lerena <slerena@artica.es>

Upps, Tuesday #13, bad day for a last commit before launch RC1 ! :-S
	
	* general/logon_ok.php: Fixed ugly format of table showing last activity 
	(has a too wide table width).
	
	* godmode/admin_access_logs.php: Removed that crappy div fashion code and
	replaced by old and reliable table-based-code :-) to fix the mess with the
	pagination.
	
	* godmode/agentes/configurar_agente.php: fixed problem with postprocess 
	values very bug (like 0.0000000123), parameter is now passed as string 
	because PHP is passing the value as scientific notation and mYsql don't 
	understand that.
	
	* operation/agentes/exportdata.php, 
	* operation/search_results.php, 
	* godmode/reporting/map_builder.php, 
	* godmode/agentes/agent_manager.php,
	* godmode/reporting/graph_builder.php,
	* godmode/agentes/modificar_agente.php: Added non-case search SQL code for make 
	agent searches non case sensitive (nombre COLLATE utf8_general_ci LIKE...)
	
	* module_manager_editor_common.php: More size for postprocess field.
	
	* pandora_console/godmode/alerts/configure_alert_action.php: More width for
	field2 in action form.
	
	* godmode/alerts/configure_alert_command.php: Command field has more width
	and added a help icon for macro subtitutions.
	
	* include/functions_db.php: get_agent_name() now defaults to non uppercase
	the agent names, because 3.0 has case sensitive agent names, and all
	data must show the real Case.
	
	* include/styles/pandora.css: removed uppercase transition for menu items
	and agent tabs.
	
	* operation/agentes/estado_agente.php: Agent is not shown in uppercase 
	anymore.
	
	* operation/agentes/estado_generalagente.php: Agent name and parent name 
	is not in uppercase. OS version shows only last 15 characters or full string
	if strlen() < 15.
	
	* operation/agentes/status_monitor.php: Agent name is not in uppercase
	 anymore.
	 


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2015 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2009-10-13 18:59:48 +00:00
parent 9f8ae07a3d
commit a7abb34a7c
19 changed files with 106 additions and 33 deletions

View File

@ -1,3 +1,52 @@
2009-10-13 Sancho Lerena <slerena@artica.es>
Upps, Tuesday #13, bad day for a last commit before launch RC1 ! :-S
* general/logon_ok.php: Fixed ugly format of table showing last activity
(has a too wide table width).
* godmode/admin_access_logs.php: Removed that crappy div fashion code and
replaced by old and reliable table-based-code :-) to fix the mess with the
pagination.
* godmode/agentes/configurar_agente.php: fixed problem with postprocess
values very bug (like 0.0000000123), parameter is now passed as string
because PHP is passing the value as scientific notation and mYsql don't
understand that.
* operation/agentes/exportdata.php,
* operation/search_results.php,
* godmode/reporting/map_builder.php,
* godmode/agentes/agent_manager.php,
* godmode/reporting/graph_builder.php,
* godmode/agentes/modificar_agente.php: Added non-case search SQL code for make
agent searches non case sensitive (nombre COLLATE utf8_general_ci LIKE...)
* module_manager_editor_common.php: More size for postprocess field.
* pandora_console/godmode/alerts/configure_alert_action.php: More width for
field2 in action form.
* godmode/alerts/configure_alert_command.php: Command field has more width
and added a help icon for macro subtitutions.
* include/functions_db.php: get_agent_name() now defaults to non uppercase
the agent names, because 3.0 has case sensitive agent names, and all
data must show the real Case.
* include/styles/pandora.css: removed uppercase transition for menu items
and agent tabs.
* operation/agentes/estado_agente.php: Agent is not shown in uppercase
anymore.
* operation/agentes/estado_generalagente.php: Agent name and parent name
is not in uppercase. OS version shows only last 15 characters or full string
if strlen() < 15.
* operation/agentes/status_monitor.php: Agent name is not in uppercase
anymore.
2009-10-08 Ramon Novoa <rnovoa@artica.es>
* include/functions_ui.php,

View File

@ -138,7 +138,7 @@ echo '<div id="activity" style="width:700px;">';
// Show last activity from this user
echo "<h2>" . __('This is your last activity in Pandora FMS console') . "</h2>";
$table->width = 700; //Don't specify px
$table->width = 650; //Don't specify px
$table->data = array ();
$table->size = array ();
$table->size[2] = '130px';

View File

@ -32,10 +32,15 @@ echo "<h2>" . __('Pandora audit') . " &raquo; " .__('Review Logs') . "</h2>";
$offset = get_parameter ("offset", 0);
$tipo_log = get_parameter ("tipo_log", 'all');
echo '<div style="width:450px; float:left;">';
echo '<table width=100% border=0>';
echo "<tr><td colspan=2>";
echo '<h3>'.__('Filter').'</h3>';
// generate select
echo "<td rowspan=2>";
if ($config['flash_charts']) {
echo graphic_user_activity (300, 140);
} else {
echo '<img src="include/fgraph.php?tipo=user_activity&width=300&height=140" />';
}
$rows = get_db_all_rows_sql ("SELECT DISTINCT(accion) FROM tsesion");
if (empty ($rows)) {
@ -47,20 +52,18 @@ $actions = array ();
foreach ($rows as $row) {
$actions[$row["accion"]] = $row["accion"];
}
echo "</td></td></tr>";
echo "<tr><td>";
echo '<form name="query_sel" method="post" action="index.php?sec=godmode&sec2=godmode/admin_access_logs">';
echo __('Action').': ';
echo "</td><td>";
print_select ($actions, 'tipo_log', $tipo_log, 'this.form.submit();', __('All'), 'all');
echo '<br /><noscript><input name="uptbutton" type="submit" class="sub" value="'.__('Show').'"></noscript>';
echo '</form></div>';
echo '</form>';
echo '<div style="width:300px; height:140px; float:left;">';
if ($config['flash_charts']) {
echo graphic_user_activity (300, 140);
} else {
echo '<img src="include/fgraph.php?tipo=user_activity&width=300&height=140" />';
}
echo '</div>';
echo "</td></td></tr>";
$filter = '';
if ($tipo_log != 'all') {
@ -71,8 +74,10 @@ $sql = "SELECT COUNT(*) FROM tsesion".$filter;
$count = get_db_sql ($sql);
$url = "index.php?sec=godmode&sec2=godmode/admin_access_logs&tipo_log=".$tipo_log;
pagination ($count, $url, $offset);
echo "<tr><td colspan=3>";
pagination ($count, $url, $offset);
echo "</td></td></tr></table>";
$sql = sprintf ("SELECT * FROM tsesion%s ORDER BY fecha DESC LIMIT %d, %d", $filter, $offset, $config["block_size"]);
$result = get_db_all_rows_sql ($sql);

View File

@ -23,7 +23,7 @@ if (is_ajax ()) {
$string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */
$filter = array ();
$filter[] = '(nombre LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
$filter[] = 'id_agente != '.$id_agent;
$agents = get_agents ($filter, array ('nombre', 'direccion'));

View File

@ -402,7 +402,12 @@ if ($update_module || $create_module) {
$description = (string) get_parameter ('description');
$id_module_group = (int) get_parameter ('id_module_group');
$flag = (bool) get_parameter ('flag');
$post_process = (float) get_parameter ('post_process');
// Don't read as (float) because it lost it's decimals when put into MySQL
// where are very big and PHP uses scientific notation, p.e:
// 1.23E-10 is 0.000000000123
$post_process = (string) get_parameter ('post_process');
$prediction_module = (int) get_parameter ('prediction_module');
$max_timeout = (int) get_parameter ('max_timeout');
$min = (int) get_parameter_post ("min");

View File

@ -109,7 +109,7 @@ echo "</td></table>";
$search_sql = '';
if ($search != ""){
$search_sql = " AND ( nombre LIKE '%$search%' OR direccion LIKE '%$search%') ";
$search_sql = " AND ( nombre COLLATE utf8_general_ci LIKE '%$search%' OR direccion LIKE '%$search%') ";
} else {
}
@ -193,7 +193,7 @@ if ($agents !== false) {
echo '<span class="left">';
echo "<strong><a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&tab=main&
id_agente=".$agent["id_agente"]."'>".substr(salida_limpia($agent["nombre"]),0,20)."</a></strong>";
id_agente=".$agent["id_agente"]."'>".$agent["nombre"]."</a></strong>";
if ($agent["disabled"]) {
echo "</em>";
}

View File

@ -174,7 +174,7 @@ $table_advanced->data[2][1] = print_input_text ('module_interval', $interval,
$table_advanced->data[2][2] = __('Post process').' '.print_help_icon ('postprocess', true);
$table_advanced->data[2][3] = print_input_text ('post_process',
$post_process, '', 7, 15, true);
$post_process, '', 12, 25, true);
$table_advanced->data[3][0] = __('Min. Value');
$table_advanced->data[3][1] = print_input_text ('min', $min, '', 5, 15, true);

View File

@ -61,7 +61,7 @@ $table->data[2][0] = __('Field 1');
$table->data[2][1] = print_input_text ('field1', $field1, '', 35, 255, true);
$table->data[3][0] = __('Field 2');
$table->data[3][1] = print_input_text ('field2', $field2, '', 35, 255, true);
$table->data[3][1] = print_input_text ('field2', $field2, '', 80, 255, true);
$table->data[4][0] = __('Field 3');
$table->data[4][1] = print_textarea ('field3', 10, 30, $field3, '', true);

View File

@ -49,7 +49,9 @@ $table->data = array ();
$table->data[0][0] = __('Name');
$table->data[0][1] = print_input_text ('name', $name, '', 35, 255, true);
$table->data[1][0] = __('Command');
$table->data[1][1] = print_input_text ('command', $command, '', 35, 255, true);
$table->data[1][0] .= print_help_icon ('alert_macros', true);
$table->data[1][1] = print_input_text ('command', $command, '', 80, 255, true);
$table->data[2][0] = __('Description');
$table->data[2][1] = print_textarea ('description', 10, 30, $description, '', true);

View File

@ -26,7 +26,7 @@ if (is_ajax ()) {
$id_group = (int) get_parameter('id_group');
$filter = array ();
$filter[] = '(nombre LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
$filter['id_grupo'] = $id_group;
$agents = get_agents ($filter, array ('nombre', 'direccion'));

View File

@ -24,7 +24,7 @@ if (is_ajax ()) {
$string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */
$filter = array ();
$filter[] = '(nombre LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
$agents = get_agents ($filter, array ('nombre', 'direccion'));
if ($agents === false)

View File

@ -596,8 +596,10 @@ function get_agent_id ($agent_name) {
*
* @return string Name of the given agent.
*/
function get_agent_name ($id_agent, $case = "upper") {
function get_agent_name ($id_agent, $case = "none") {
$agent = (string) get_db_value ('nombre', 'tagente', 'id_agente', (int) $id_agent);
// Version 3.0 has enforced case sensitive agent names
// so we always should show real case names.
switch ($case) {
case "upper":
return mb_strtoupper ($agent,"UTF-8");

View File

@ -541,7 +541,7 @@ div.title_line {
position: relative;
}
#menu_tab_left li a, #menu_tab_left li span {
text-transform: uppercase;
/* text-transform: uppercase; */
background: #d84437;
padding: 2px 5px 2px 5px;
color: #fff;

View File

@ -20,7 +20,7 @@ if (function_exists ('mb_internal_encoding')) {
}
// 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

@ -188,7 +188,7 @@ foreach ($agents as $agent) {
$data[0] .= '</a>&nbsp;';
}
$data[0] .= print_agent_name ($agent["id_agente"], true, "upper");
$data[0] .= print_agent_name ($agent["id_agente"], true, "none");
$data[1] = print_os_icon ($agent["id_os"], false, true);

View File

@ -69,7 +69,7 @@ echo '<div width="450px">';
echo '<table cellspacing="4" cellpadding="4" border="0" class="databox">';
//Agent name
echo '<tr><td class="datos"><b>'.__('Agent name').'</b></td>';
echo '<td class="datos"><b>'.strtoupper($agent["nombre"]).'</b></td>';
echo '<td class="datos"><b>'.$agent["nombre"].'</b></td>';
echo '<td class="datos" width="40"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&refr=60"><img src="images/refresh.png" border="0" title="'.__('Refresh data').'" /></a>&nbsp;';
echo '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&flag_agent=1&id_agente='.$id_agente.'"><img src="images/target.png" border="0" title="'.__('Flag').'" /></a></td></tr>';
@ -81,7 +81,17 @@ echo '</td></tr>';
//OS
echo '<tr><td class="datos"><b>'.__('OS').'</b></td>';
echo '<td class="datos" colspan="2">'.print_os_icon ($agent["id_os"], true, true).' '.$agent["os_version"].'</td></tr>';
echo '<td class="datos" colspan="2">'.print_os_icon ($agent["id_os"], true, true);
// Want to print last 15 characters of OS version, or start from 0 if smaller
$osversion_offset = strlen($agent["os_version"]);
if ($osversion_offset > 15)
$osversion_offset = $osversion_offset - 15;
else
$osversion_offset = 0;
echo '&nbsp;<i><span title="'.$agent["os_version"].'">'.substr($agent["os_version"],$osversion_offset,15).' </span></i></td></tr>';
// Parent
echo '<tr><td class="datos2"><b>'.__('Parent').'</b></td>';

View File

@ -25,7 +25,7 @@ if (is_ajax ()) {
$id_group = (int) get_parameter('id_group');
$filter = array ();
$filter[] = '(nombre LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
$filter['id_grupo'] = $id_group;
$agents = get_agents ($filter, array ('nombre', 'direccion'));

View File

@ -203,7 +203,7 @@ foreach ($result as $row) {
$data = array ();
$data[1] = '<strong><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row["id_agent"].'">';
$data[1] .= strtoupper (substr ($row["agent_name"], 0, 25));
$data[1] .= substr ($row["agent_name"], 0, 25);
$data[1] .= '</a></strong>';
$data[2] = '<img src="images/'.show_icon_type ($row["module_type"]).'" border="0" />';

View File

@ -45,7 +45,7 @@ if ($searchTab == 'agents') {
FROM tagente
INNER JOIN tgrupo
ON tgrupo.id_grupo = tagente.id_grupo
WHERE tagente.nombre LIKE '%" . $stringSearchSQL . "%' OR
WHERE tagente.nombre COLLATE utf8_general_ci LIKE '%" . $stringSearchSQL . "%' OR
tgrupo.nombre LIKE '%" . $stringSearchSQL . "%'
LIMIT " . $config['block_size'] . " OFFSET " . get_parameter ('offset',0);
$agents = process_sql($sql);
@ -54,7 +54,7 @@ if ($searchTab == 'agents') {
FROM tagente
INNER JOIN tgrupo
ON tgrupo.id_grupo = tagente.id_grupo
WHERE tagente.nombre LIKE '%" . $stringSearchSQL . "%' OR
WHERE tagente.nombre COLLATE utf8_general_ci LIKE '%" . $stringSearchSQL . "%' OR
tgrupo.nombre LIKE '%" . $stringSearchSQL . "%'";
$totalAgents = get_db_row_sql($sql);
$totalAgents = $totalAgents[0];