add strict comparator

Former-commit-id: 0561976f26d6bc59f3076f48a5a4261dafaad28b
This commit is contained in:
alejandro-campos 2019-03-20 15:26:42 +01:00
parent 36119ebb85
commit b5e1487736

View File

@ -91,7 +91,7 @@ if ($id_group > 0 && in_array($id_group, array_keys($groups))) {
$childrens_str = implode(',', $childrens_ids); $childrens_str = implode(',', $childrens_ids);
$sql_post .= " AND (id_grupo IN ($childrens_str)"; $sql_post .= " AND (id_grupo IN ($childrens_str)";
if ($is_using_secondary_group) if ($is_using_secondary_group === true)
$sql_post .= " OR id_group IN ($childrens_str)"; $sql_post .= " OR id_group IN ($childrens_str)";
$sql_post .= ")"; $sql_post .= ")";
@ -99,14 +99,14 @@ if ($id_group > 0 && in_array($id_group, array_keys($groups))) {
// If a group is selected and it's in the groups allowed. // If a group is selected and it's in the groups allowed.
$sql_post .= " AND (id_grupo = $id_group"; $sql_post .= " AND (id_grupo = $id_group";
if ($is_using_secondary_group) if ($is_using_secondary_group === true)
$sql_post .= " OR id_group = $id_group"; $sql_post .= " OR id_group = $id_group";
$sql_post .= ")"; $sql_post .= ")";
} }
} else { } else {
if (!users_is_admin() && !users_can_manage_group_all('ER')) { if (!users_is_admin() && !users_can_manage_group_all('ER')) {
if ($is_using_secondary_group) { if ($is_using_secondary_group === true) {
$sql_post .= sprintf( $sql_post .= sprintf(
' AND (id_grupo IN (%s) OR id_group IN (%s)) ', ' AND (id_grupo IN (%s) OR id_group IN (%s)) ',
implode(',', array_keys($groups)), implode(',', array_keys($groups)),