2011-05-13 Miguel de Dios <miguel.dedios@artica.es>
* operation/agentes/estado_agente.php: fixed ACL when the user have a "Pandora Management" in any group that show agents of all groups. Fixes: #3300611 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4350 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
2b18e2ff02
commit
5de63d0177
|
@ -1,3 +1,10 @@
|
||||||
|
2011-05-13 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* operation/agentes/estado_agente.php: fixed ACL when the user have a
|
||||||
|
"Pandora Management" in any group that show agents of all groups.
|
||||||
|
|
||||||
|
Fixes: #3300611
|
||||||
|
|
||||||
2011-05-13 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
2011-05-13 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
* include/functions_servers.php
|
* include/functions_servers.php
|
||||||
|
|
|
@ -248,15 +248,13 @@ if ($group_id > 0) {
|
||||||
$agent_names = agents_get_group_agents ($group_id, $filter, "upper");
|
$agent_names = agents_get_group_agents ($group_id, $filter, "upper");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Not selected any specific group
|
$groups = array();
|
||||||
if (check_acl ($config['id_user'], 0, "PM")){
|
|
||||||
$agent_names = agents_get_group_agents(0, $filter, "upper", true);
|
$user_group = users_get_groups($config["id_user"], "PM");
|
||||||
}
|
|
||||||
else{
|
|
||||||
$user_group = users_get_groups($config["id_user"], "AR");
|
|
||||||
$groups = array_keys($user_group);
|
$groups = array_keys($user_group);
|
||||||
$agent_names = agents_get_group_agents(array_keys ($user_group), $filter, "upper");
|
$user_group = users_get_groups($config["id_user"], "AR");
|
||||||
}
|
$groups = array_unique(array_merge($groups, array_keys($user_group)));
|
||||||
|
$agent_names = agents_get_group_agents($groups, $filter, "upper");
|
||||||
}
|
}
|
||||||
|
|
||||||
$total_agents = 0;
|
$total_agents = 0;
|
||||||
|
@ -267,41 +265,6 @@ if (! empty ($agent_names)) {
|
||||||
$subquery_enterprise = subquery_acl_enterprise();
|
$subquery_enterprise = subquery_acl_enterprise();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
|
||||||
$sql = sprintf ('SELECT COUNT(*) FROM tagente WHERE 1=1 %s %s', $search_sql, $subquery_enterprise);
|
|
||||||
$total_agents = db_get_sql ($sql);
|
|
||||||
|
|
||||||
switch ($config["dbtype"]) {
|
|
||||||
case "mysql":
|
|
||||||
case "postgresql":
|
|
||||||
$sql = sprintf ('SELECT * FROM tagente
|
|
||||||
WHERE 1=1 %s %s
|
|
||||||
ORDER BY %s %s LIMIT %d, %d', $search_sql, $subquery_enterprise,
|
|
||||||
$order['field'], $order['order'], $offset, $config["block_size"]);
|
|
||||||
break;
|
|
||||||
case "oracle":
|
|
||||||
$set = array ();
|
|
||||||
$set['limit'] = $config["block_size"];
|
|
||||||
$set['offset'] = $offset;
|
|
||||||
$sql = sprintf ('SELECT * FROM tagente
|
|
||||||
WHERE 1=1 %s %s
|
|
||||||
ORDER BY %s %s', $search_sql, $subquery_enterprise,
|
|
||||||
$order['field'], $order['order']);
|
|
||||||
$sql = oracle_recode_query ($sql, $set);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$agents = db_get_all_rows_sql ($sql);
|
|
||||||
|
|
||||||
// Delete rnum row generated by oracle_recode_query() function
|
|
||||||
if (($config['dbtype'] == 'oracle') && ($agents !== false)) {
|
|
||||||
for ($i=0; $i < count($agents); $i++) {
|
|
||||||
unset($agents[$i]['rnum']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$total_agents = agents_get_agents(array ('id_agente' => array_keys ($agent_names),
|
$total_agents = agents_get_agents(array ('id_agente' => array_keys ($agent_names),
|
||||||
'order' => 'nombre ASC',
|
'order' => 'nombre ASC',
|
||||||
'disabled' => 0,
|
'disabled' => 0,
|
||||||
|
@ -321,7 +284,6 @@ if (! empty ($agent_names)) {
|
||||||
'intervalo'),
|
'intervalo'),
|
||||||
'AR',
|
'AR',
|
||||||
$order);
|
$order);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty ($agents)) {
|
if (empty ($agents)) {
|
||||||
|
|
Loading…
Reference in New Issue