2009-11-03 Miguel de Dios <miguel.dedios@artica.es>
* godmode/alerts/alert_list.php: fix notice alert php describe in the tracker of sourceforge. * godmode/alerts/alert_compounds.php: fix the SQL query bug in PHP when load this page without agent in Pandora. Fixes: 2891215 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2075 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
047b8a1be7
commit
3fe5a883e7
|
@ -1,3 +1,10 @@
|
|||
2009-11-03 Miguel de Dios <miguel.dedios@artica.es>
|
||||
* godmode/alerts/alert_list.php: fix notice alert php describe in the
|
||||
tracker of sourceforge.
|
||||
* godmode/alerts/alert_compounds.php: fix the SQL query bug in PHP when
|
||||
load this page without agent in Pandora.
|
||||
Fixes: 2891215
|
||||
|
||||
2009-11-03 Miguel de Dios <miguel.dedios@artica.es>
|
||||
* godmode/agentes/module_manager_editor_plugin.php: fix the size of field
|
||||
"Plugin parameters".
|
||||
|
|
|
@ -121,10 +121,14 @@ if ($search != '')
|
|||
$search, $search);
|
||||
if ($id_agent)
|
||||
$agents = array ($id_agent => $id_agent);
|
||||
$sql = sprintf ('SELECT COUNT(*) FROM talert_compound
|
||||
WHERE id_agent in (%s)%s',
|
||||
implode (',', array_keys ($agents)), $where);
|
||||
$total = (int) get_db_sql ($sql);
|
||||
|
||||
$total = 0;
|
||||
if (count($agents) > 0) {
|
||||
$sql = sprintf ('SELECT COUNT(*) FROM talert_compound
|
||||
WHERE id_agent in (%s)%s',
|
||||
implode (',', array_keys ($agents)), $where);
|
||||
$total = (int) get_db_sql ($sql);
|
||||
}
|
||||
pagination ($total, $url);
|
||||
|
||||
$table->id = 'alert_list';
|
||||
|
@ -144,11 +148,14 @@ $table->head[1] = __('Name');
|
|||
$table->head[2] = __('Agent');
|
||||
$table->head[3] = __('Delete');
|
||||
|
||||
$sql = sprintf ('SELECT id FROM talert_compound
|
||||
WHERE id_agent in (%s)%s LIMIT %d OFFSET %d',
|
||||
implode (',', array_keys ($agents)), $where,
|
||||
$config['block_size'], get_parameter ('offset'));
|
||||
$id_alerts = get_db_all_rows_sql ($sql);
|
||||
$id_alerts = false;
|
||||
if (count($agents)) {
|
||||
$sql = sprintf ('SELECT id FROM talert_compound
|
||||
WHERE id_agent in (%s)%s LIMIT %d OFFSET %d',
|
||||
implode (',', array_keys ($agents)), $where,
|
||||
$config['block_size'], get_parameter ('offset'));
|
||||
$id_alerts = get_db_all_rows_sql ($sql);
|
||||
}
|
||||
|
||||
if ($id_alerts === false)
|
||||
$id_alerts = array ();
|
||||
|
|
|
@ -271,13 +271,13 @@ if ($id_agente) {
|
|||
$simple_alerts = get_agent_alerts_simple (array_keys ($agents));
|
||||
} else {
|
||||
$total = 0;
|
||||
$where = '';
|
||||
if (!empty ($agents)) {
|
||||
$sql = sprintf ('SELECT COUNT(*) FROM talert_template_modules
|
||||
WHERE id_agent_module IN (SELECT id_agente_modulo
|
||||
FROM tagente_modulo WHERE id_agente IN (%s))',
|
||||
implode (',', array_keys ($agents)));
|
||||
|
||||
$where = '';
|
||||
if (get_parameter('search',0)) {
|
||||
if ($priority != -1 )
|
||||
$where .= " AND priority = " . $priority;
|
||||
|
|
Loading…
Reference in New Issue