2008-06-23 Esteban Sanchez <estebans@artica.es>

* include/functions_db.php: Deleted a debug output. list_group2 marked
        as deprecated function. Added get_user_groups(). Fixed an undefined 
        variable in return_moduledata_sum_value().



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@896 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Esteban Sanchez 2008-06-23 16:07:00 +00:00
parent 1bd3b7c38a
commit 82ab3f85aa
2 changed files with 31 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2008-06-23 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Deleted a debug output. list_group2 marked
as deprecated function. Added get_user_groups(). Fixed an undefined
variable in return_moduledata_sum_value().
2008-06-23 Sancho Lerena <slerena@gmail.com>
* include/functions.php,

View File

@ -220,7 +220,6 @@ function give_disabled_group ($id_group) {
* @return An array with all agents in the group.
*/
function get_agents_in_group ($id_group, $disabled = false) {
echo "GROUP: ".$id_group;
/* 'All' group must return all agents */
if ($id_group == 1) {
if ($disabled)
@ -904,6 +903,8 @@ function list_group ($id_user, $show_all = 1){
/**
* Get a list of the groups a user has reading privileges.
*
* DEPRECATED: Use get_user_groups () instead
*
* @param id_user User id
*
* @return A list of the groups the user has reading privileges.
@ -920,6 +921,26 @@ function list_group2 ($id_user) {
return ($mis_grupos);
}
/**
* Get all the groups a user has reading privileges.
*
* @param id_user User id
*
* @return A list of the groups the user has reading privileges.
*/
function get_user_groups ($id_user) {
$user_groups = array ();
$groups = get_db_all_rows_in_table ('tgrupo');
foreach ($groups as $group) {
if (! give_acl ($id_user, $group["id_grupo"], "AR"))
continue;
$user_groups[$group['id_grupo']] = $group['nombre'];
}
return $user_groups;
}
/**
* Get group icon
*
@ -1521,7 +1542,9 @@ function return_moduledata_sum_value ($id_agent_module, $period, $date = 0) {
if (! $date)
$date = time ();
$datelimit = $date - $period; // limit date
$module_name = get_db_value ('nombre', 'ttipo_modulo', 'id_tipo', $agent_module['id_tipo_modulo']);
$id_module_type = get_db_value ('id_tipo_modulo', 'tagente_modulo',
'id_agente_modulo', $id_agent_module);
$module_name = get_db_value ('nombre', 'ttipo_modulo', 'id_tipo', $id_module_type);
if (is_module_data_string ($module_name)) {
return lang_string ('wrong_module_type');