mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
2011-05-18 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_agents.php: changed the source code to fixed the enterprise call in function "agents_get_agents". * operation/agentes/estado_agente.php: apply the change to the call "agents_get_agents". Fixes: #3303426 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4367 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c0aa08e3c8
commit
fdd58aa486
@ -1,3 +1,13 @@
|
|||||||
|
2011-05-18 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_agents.php: changed the source code to fixed the
|
||||||
|
enterprise call in function "agents_get_agents".
|
||||||
|
|
||||||
|
* operation/agentes/estado_agente.php: apply the change to the call
|
||||||
|
"agents_get_agents".
|
||||||
|
|
||||||
|
Fixes: #3303426
|
||||||
|
|
||||||
2011-05-18 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
2011-05-18 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
* include/functions_graph.php
|
* include/functions_graph.php
|
||||||
|
@ -151,8 +151,7 @@ function agents_get_alerts_simple ($id_agent = false, $filter = '', $options = f
|
|||||||
$filter .= db_format_array_where_clause_sql ($options);
|
$filter .= db_format_array_where_clause_sql ($options);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($id_agent !== false) && ($idGroup !== false)) {
|
if (($id_agent === false) && ($idGroup !== false)) {
|
||||||
|
|
||||||
if ($idGroup != 0) { //All group
|
if ($idGroup != 0) { //All group
|
||||||
$subQuery = 'SELECT id_agente_modulo
|
$subQuery = 'SELECT id_agente_modulo
|
||||||
FROM tagente_modulo
|
FROM tagente_modulo
|
||||||
@ -372,7 +371,11 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
|
|||||||
$filter['order'] = $order['field'] . ' ' . $order['order'];
|
$filter['order'] = $order['field'] . ' ' . $order['order'];
|
||||||
|
|
||||||
if ($enterprise_include) {
|
if ($enterprise_include) {
|
||||||
add_enterprise_agents_get_agents_filter_acl($filter);
|
$ids = get_id_agents_user_profile_policy();
|
||||||
|
|
||||||
|
if (!empty($filter['id_agente'])) {
|
||||||
|
$filter['id_agente'] = array_intersect($filter['id_agente'], $ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return db_get_all_rows_filter ('tagente', $filter, $fields);
|
return db_get_all_rows_filter ('tagente', $filter, $fields);
|
||||||
@ -804,7 +807,7 @@ function agents_get_group_agents ($id_group = 0, $search = false, $case = "lower
|
|||||||
$search_sql .= ' AND nombre COLLATE utf8_general_ci LIKE \'' . $name . '\' ';
|
$search_sql .= ' AND nombre COLLATE utf8_general_ci LIKE \'' . $name . '\' ';
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$search_sql .= ' AND UPPER(nombre) LIKE UPPER(\'' . $name . '\') ';
|
$search_sql .= ' AND nombre LIKE UPPER("' . $name . '") ';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -959,29 +962,13 @@ function agents_get_modules ($id_agent = null, $details = false, $filter = false
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($value[0] == '%') {
|
if ($value[0] == '%') {
|
||||||
switch ($config['dbtype']){
|
array_push ($fields, $field.' LIKE "'.$value.'"');
|
||||||
case "mysql":
|
|
||||||
case "postgresql":
|
|
||||||
array_push ($fields, $field.' LIKE "'.$value.'"');
|
|
||||||
break;
|
|
||||||
case "oracle":
|
|
||||||
array_push ($fields, $field.' LIKE \''.$value.'\'');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if ($operatorDistin) {
|
else if ($operatorDistin) {
|
||||||
array_push($fields, $field.' <> ' . substr($value, 2));
|
array_push($fields, $field.' <> ' . substr($value, 2));
|
||||||
}
|
}
|
||||||
else if (substr($value, -1) == '%') {
|
else if (substr($value, -1) == '%') {
|
||||||
switch ($config['dbtype']){
|
array_push ($fields, $field.' LIKE "'.$value.'"');
|
||||||
case "mysql":
|
|
||||||
case "postgresql":
|
|
||||||
array_push ($fields, $field.' LIKE "'.$value.'"');
|
|
||||||
break;
|
|
||||||
case "oracle":
|
|
||||||
array_push ($fields, $field.' LIKE \''.$value.'\'');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
|
@ -269,30 +269,25 @@ else {
|
|||||||
$total_agents = 0;
|
$total_agents = 0;
|
||||||
$agents = false;
|
$agents = false;
|
||||||
if (! empty ($agent_names)) {
|
if (! empty ($agent_names)) {
|
||||||
$subquery_enterprise = '';
|
$total_agents = agents_get_agents(array ('id_agente' => array_keys ($agent_names),
|
||||||
if (ENTERPRISE_NOT_HOOK !== enterprise_include_once('include/functions_policies.php')) {
|
'order' => 'nombre ASC',
|
||||||
$subquery_enterprise = subquery_acl_enterprise();
|
'disabled' => 0,
|
||||||
}
|
'id_grupo' => $groups),
|
||||||
|
array ('COUNT(*) as total'));
|
||||||
$total_agents = agents_get_agents(array ('id_agente' => array_keys ($agent_names),
|
$total_agents = isset ($total_agents[0]['total']) ? $total_agents[0]['total'] : 0;
|
||||||
'order' => 'nombre ASC',
|
|
||||||
'disabled' => 0,
|
$agents = agents_get_agents(array ('id_agente' => array_keys ($agent_names),
|
||||||
'id_grupo' => $groups),
|
'order' => 'nombre ASC',
|
||||||
array ('COUNT(*) as total'));
|
'id_grupo' => $groups,
|
||||||
$total_agents = isset ($total_agents[0]['total']) ? $total_agents[0]['total'] : 0;
|
'offset' => (int) get_parameter ('offset'),
|
||||||
|
'limit' => (int) $config['block_size']),
|
||||||
$agents = agents_get_agents(array ('id_agente' => array_keys ($agent_names),
|
array ('id_agente',
|
||||||
'order' => 'nombre ASC',
|
'id_grupo',
|
||||||
'id_grupo' => $groups,
|
'id_os',
|
||||||
'offset' => (int) get_parameter ('offset'),
|
'ultimo_contacto',
|
||||||
'limit' => (int) $config['block_size']),
|
'intervalo'),
|
||||||
array ('id_agente',
|
'AR',
|
||||||
'id_grupo',
|
$order);
|
||||||
'id_os',
|
|
||||||
'ultimo_contacto',
|
|
||||||
'intervalo'),
|
|
||||||
'AR',
|
|
||||||
$order);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty ($agents)) {
|
if (empty ($agents)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user