2013-10-23 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php: fixed the get events filtered by the group in the parameters. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8952 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
2e210880e4
commit
2125245841
|
@ -1,3 +1,8 @@
|
|||
2013-10-23 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_api.php: fixed the get events filtered by the
|
||||
group in the parameters.
|
||||
|
||||
2013-10-22 Hirofumi Kosaka <kosaka@rworks.jp>
|
||||
|
||||
* include/ajax/module.php: changed the code to avoid to try to
|
||||
|
|
|
@ -5377,15 +5377,28 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
|||
//to a function.
|
||||
|
||||
$groups = users_get_groups ($user_in_db, "IR");
|
||||
$id_groups_user = array();
|
||||
if (!empty($groups))
|
||||
$id_groups_user = array_keys ($groups);
|
||||
$is_admin = (bool)db_get_value('is_admin', 'tusuario', 'id_user', $user_in_db);
|
||||
|
||||
$sql_post = '';
|
||||
|
||||
if (!empty($groups)) {
|
||||
$sql_post = " AND id_grupo IN (".implode (",", array_keys ($groups)).")";
|
||||
if (($id_group == -1) || ($id_group == 0)) {
|
||||
if (!empty($groups)) {
|
||||
$sql_post = " AND id_grupo IN (".implode (",", $id_groups_user).")";
|
||||
}
|
||||
else if ($is_admin) {
|
||||
$sql_post = " AND 1 = 0";
|
||||
}
|
||||
}
|
||||
else if ($is_admin) {
|
||||
$sql_post = " AND 1 = 0";
|
||||
else {
|
||||
if (array_search($id_group, $id_groups_user) !== false) {
|
||||
$sql_post = " AND id_grupo = " . $id_group;
|
||||
}
|
||||
else {
|
||||
$sql_post = " AND 1 = 0";
|
||||
}
|
||||
}
|
||||
|
||||
// Skip system messages if user is not PM
|
||||
|
|
Loading…
Reference in New Issue