2013-10-10 Sergio Martin <sergio.martin@artica.es>
* include/functions_agents.php include/functions_alerts.php operation/agentes/status_monitor.php operation/agentes/status_events.php mobile/operation/modules.php: Fixed several calls to acl tags with same fixes of Juanma in previous commits git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8887 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
8c7a0b1ae8
commit
fd540f5880
|
@ -1,3 +1,12 @@
|
|||
2013-10-10 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_agents.php
|
||||
include/functions_alerts.php
|
||||
operation/agentes/status_monitor.php
|
||||
operation/agentes/status_events.php
|
||||
mobile/operation/modules.php: Fixed several calls
|
||||
to acl tags with same fixes of Juanma in previous commits
|
||||
|
||||
2013-10-10 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_agents.php: Change the way of
|
||||
|
|
|
@ -155,7 +155,9 @@ function agents_get_alerts_simple ($id_agent = false, $filter = '', $options = f
|
|||
}
|
||||
|
||||
if (($id_agent !== false) && ($idGroup !== false)) {
|
||||
$where_tags = tags_get_acl_tags($config['id_user'], $idGroup, 'AR', 'module_condition', 'AND', 'tagente_modulo');
|
||||
$groups = users_get_groups($config["id_user"]);
|
||||
|
||||
$where_tags = tags_get_acl_tags($config['id_user'], $groups, 'AR', 'module_condition', 'AND', 'tagente_modulo');
|
||||
if ($idGroup != 0) { //All group
|
||||
$subQuery = 'SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
|
@ -635,7 +637,12 @@ function agents_get_next_contact($idAgent, $maxModules = false) {
|
|||
|
||||
$difference = get_system_time () - strtotime ($agent["ultimo_contacto"]);
|
||||
|
||||
return round ($difference / ($agent["intervalo"] / 100));
|
||||
if ($agent["intervalo"] > 0 && strtotime($agent["ultimo_contacto"]) > 0) {
|
||||
return round ($difference / ($agent["intervalo"] / 100));
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1572,8 +1572,10 @@ function get_group_alerts($id_group, $filter = '', $options = false,
|
|||
|
||||
|
||||
if ($id_group !== false) {
|
||||
$groups = users_get_groups($config["id_user"]);
|
||||
|
||||
$where_tags = tags_get_acl_tags($config['id_user'],
|
||||
$idGroup, 'AR', 'module_condition', 'AND', 'tagente_modulo');
|
||||
array_keys($groups), 'AR', 'module_condition', 'AND', 'tagente_modulo');
|
||||
|
||||
if ($id_group != 0) {
|
||||
if (is_array($id_group)) {
|
||||
|
|
|
@ -289,7 +289,7 @@ class Modules {
|
|||
|
||||
// Part SQL for the Tag
|
||||
$sql_conditions_tags = tags_get_acl_tags($user->getIdUser(),
|
||||
$this->group, $this->acl, 'module_condition', 'AND', 'tagente_modulo');
|
||||
$user->getIdGroups($this->acl), $this->acl, 'module_condition', 'AND', 'tagente_modulo');
|
||||
|
||||
|
||||
$sql_conditions = " AND tagente_modulo.disabled = 0 AND tagente.disabled = 0";
|
||||
|
|
|
@ -29,7 +29,7 @@ echo "<h4 style='margin-top:0px !important;'>".__('Latest events for this agent'
|
|||
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
|
||||
$groups = users_get_groups($config["id_user"]);
|
||||
|
||||
$tags_condition = tags_get_acl_tags($config['id_user'], /*$agent['id_grupo']*/ array_keys($groups), 'ER', 'event_condition', 'AND');
|
||||
$tags_condition = tags_get_acl_tags($config['id_user'], array_keys($groups), 'ER', 'event_condition', 'AND');
|
||||
|
||||
events_print_event_table ("estado <> 1 $tags_condition", 10, '100%', false, $id_agente);
|
||||
|
||||
|
|
|
@ -175,7 +175,10 @@ if (defined('METACONSOLE') && $ag_group !== 0) {
|
|||
$ag_group = groups_get_id($ag_group);
|
||||
}
|
||||
|
||||
$sql_conditions_tags = tags_get_acl_tags($config['id_user'], $ag_group, 'AR', 'module_condition', 'AND', 'tagente_modulo');
|
||||
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
|
||||
$groups = users_get_groups($config["id_user"]);
|
||||
|
||||
$sql_conditions_tags = tags_get_acl_tags($config['id_user'], array_keys($groups), 'AR', 'module_condition', 'AND', 'tagente_modulo');
|
||||
|
||||
if(is_numeric($sql_conditions_tags)) {
|
||||
$sql_conditions_tags = ' AND 1 = 0';
|
||||
|
@ -334,7 +337,7 @@ if (!defined('METACONSOLE')) {
|
|||
<td valign="middle">' . __('Group') . '</td>
|
||||
<td valign="middle">' .
|
||||
html_print_select_groups(false, "AR", true, "ag_group",
|
||||
$ag_group, '', __('All'), '0', true, false, false, 'w130',
|
||||
$ag_group, '', '', '0', true, false, false, 'w130',
|
||||
false, 'width:150px;') . '
|
||||
</td>';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue