2010-05-14 Sergio Martin <sergio.martin@artica.es>
* include/functions_db.php operation/agentes/ver_agente.php godmode/agentes/massive_edit_modules.php: Fixed the ACL check into groups combo for bug 3001500 and All agents display for bug 2999431 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2727 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c06b11a83d
commit
d8d2d23ba1
|
@ -1,3 +1,11 @@
|
|||
2010-05-14 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_db.php
|
||||
operation/agentes/ver_agente.php
|
||||
godmode/agentes/massive_edit_modules.php: Fixed the
|
||||
ACL check into groups combo for bug 3001500 and
|
||||
All agents display for bug 2999431
|
||||
|
||||
2010-05-14 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/gettext.php: Sorry I forget part of changes in "fixed the bug of
|
||||
|
|
|
@ -160,7 +160,6 @@ $names = get_agent_modules (array_keys ($agents),
|
|||
foreach ($names as $name) {
|
||||
$modules[$name['nombre']] = $name['nombre'];
|
||||
}
|
||||
$agents = null;
|
||||
|
||||
$table->data[0][2] = __('Module name');
|
||||
$table->data[0][3] = print_select ($modules, 'module_name',
|
||||
|
|
|
@ -1334,14 +1334,20 @@ function give_agentmodule_flag ($id_agent_module) {
|
|||
function get_all_groups($groupWithAgents = false) {
|
||||
$sql = 'SELECT id_grupo, nombre FROM tgrupo';
|
||||
|
||||
global $config;
|
||||
|
||||
if ($groupWithAgents)
|
||||
$sql .= ' WHERE id_grupo IN (SELECT id_grupo FROM tagente GROUP BY id_grupo)';
|
||||
|
||||
$sql .= ' ORDER BY nombre DESC';
|
||||
|
||||
$rows = get_db_all_rows_sql ($sql);
|
||||
|
||||
$return = array();
|
||||
foreach ($rows as $row)
|
||||
$return[$row['id_grupo']] = $row['nombre'];
|
||||
foreach ($rows as $row) {
|
||||
if (give_acl ($config['id_user'], $row["id_grupo"], "AR"))
|
||||
$return[$row['id_grupo']] = $row['nombre'];
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
|
|
@ -36,8 +36,19 @@ if (is_ajax ()) {
|
|||
if ($get_agents_group_json) {
|
||||
$id_group = get_parameter('id_group');
|
||||
|
||||
$agents = get_db_all_rows_sql("SELECT id_agente, nombre FROM tagente WHERE id_grupo = ". $id_group);
|
||||
|
||||
if($id_group > 0)
|
||||
$filter = " WHERE id_grupo = ". $id_group;
|
||||
else {
|
||||
$groups_orig = get_user_groups();
|
||||
|
||||
$a = 0;
|
||||
$groups = array_keys($groups_orig);
|
||||
|
||||
$filter = " WHERE id_grupo IN (". implode(',', $groups) .")";
|
||||
}
|
||||
|
||||
$agents = get_db_all_rows_sql("SELECT id_agente, nombre FROM tagente". $filter);
|
||||
|
||||
echo json_encode($agents);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue