mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Fix the ACL tags in the edit module view. Ticket: #1602
This commit is contained in:
parent
33b1393a6c
commit
ce6aaa0d9d
@ -1003,6 +1003,9 @@ function tags_get_user_tags($id_user = false, $access = 'AR') {
|
|||||||
function tags_check_acl_by_module($id_module = 0, $id_user = false,
|
function tags_check_acl_by_module($id_module = 0, $id_user = false,
|
||||||
$access = 'AW') {
|
$access = 'AW') {
|
||||||
|
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
|
||||||
$return = false;
|
$return = false;
|
||||||
|
|
||||||
if (!empty($id_module)) {
|
if (!empty($id_module)) {
|
||||||
@ -1013,7 +1016,7 @@ function tags_check_acl_by_module($id_module = 0, $id_user = false,
|
|||||||
$id_user = $config["id_user"];
|
$id_user = $config["id_user"];
|
||||||
}
|
}
|
||||||
|
|
||||||
$return = tags_check_acl($id_user, $group, $access, $tags);
|
$return = tags_check_acl($id_user, $group, $access, $tags, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
@ -1029,7 +1032,7 @@ function tags_check_acl_by_module($id_module = 0, $id_user = false,
|
|||||||
*
|
*
|
||||||
* @return bool true if the acl check has success, false otherwise
|
* @return bool true if the acl check has success, false otherwise
|
||||||
*/
|
*/
|
||||||
function tags_check_acl($id_user, $id_group, $access, $tags = array()) {
|
function tags_check_acl($id_user, $id_group, $access, $tags = array(), $flag_id_tag = false) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if ($id_user === false) {
|
if ($id_user === false) {
|
||||||
@ -1079,7 +1082,8 @@ function tags_check_acl($id_user, $id_group, $access, $tags = array()) {
|
|||||||
}
|
}
|
||||||
else if (isset($acls[$group])) {
|
else if (isset($acls[$group])) {
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
$tag = tags_get_id($tag);
|
if (!$flag_id_tag)
|
||||||
|
$tag = tags_get_id($tag);
|
||||||
|
|
||||||
if (in_array($tag, $acls[$group])) {
|
if (in_array($tag, $acls[$group])) {
|
||||||
return true;
|
return true;
|
||||||
@ -1091,9 +1095,12 @@ function tags_check_acl($id_user, $id_group, $access, $tags = array()) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
foreach ($acls as $acl_tags) {
|
foreach ($acls as $acl_tags) {
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
$tag = tags_get_id($tag);
|
if (!$flag_id_tag)
|
||||||
|
$tag = tags_get_id($tag);
|
||||||
|
|
||||||
if (in_array($tag, $acl_tags)) {
|
if (in_array($tag, $acl_tags)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1106,7 +1113,8 @@ function tags_check_acl($id_user, $id_group, $access, $tags = array()) {
|
|||||||
if ($id_group > 0) {
|
if ($id_group > 0) {
|
||||||
if (isset($acls[$id_group])) {
|
if (isset($acls[$id_group])) {
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
$tag = tags_get_id($tag);
|
if (!$flag_id_tag)
|
||||||
|
$tag = tags_get_id($tag);
|
||||||
|
|
||||||
if (in_array($tag, $acls[$id_group])) {
|
if (in_array($tag, $acls[$id_group])) {
|
||||||
return true;
|
return true;
|
||||||
@ -1120,7 +1128,9 @@ function tags_check_acl($id_user, $id_group, $access, $tags = array()) {
|
|||||||
else {
|
else {
|
||||||
foreach ($acls as $acl_tags) {
|
foreach ($acls as $acl_tags) {
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
$tag = tags_get_id($tag);
|
if (!$flag_id_tag)
|
||||||
|
$tag = tags_get_id($tag);
|
||||||
|
|
||||||
if (in_array($tag, $acl_tags)) {
|
if (in_array($tag, $acl_tags)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user