Merge pull request #4674 from annando/acl-fix

Fix the ACL problem issue 4616
This commit is contained in:
Hypolite Petovan 2018-03-24 15:48:02 -04:00 committed by GitHub
commit 641bd5eaa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 2625 additions and 2614 deletions

View file

@ -221,6 +221,11 @@ class ACL extends BaseObject
return $o; return $o;
} }
private static function fixACL(&$item)
{
$item = intval(str_replace(['<', '>'], ['', ''], $item));
}
/** /**
* Return the default permission of the provided user array * Return the default permission of the provided user array
* *
@ -242,6 +247,12 @@ class ACL extends BaseObject
preg_match_all($acl_regex, defaults($user, 'deny_gid', ''), $matches); preg_match_all($acl_regex, defaults($user, 'deny_gid', ''), $matches);
$deny_gid = $matches[1]; $deny_gid = $matches[1];
// Reformats the ACL data so that it is accepted by the JS frontend
array_walk($allow_cid, 'self::fixACL');
array_walk($allow_gid, 'self::fixACL');
array_walk($deny_cid, 'self::fixACL');
array_walk($deny_gid, 'self::fixACL');
Contact::pruneUnavailable($allow_cid); Contact::pruneUnavailable($allow_cid);
return [ return [