Commit e9a5f7af authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚑 fix(simpleplugin) Fix the way ACL are autodetected for tagged attributes

Make sure that ; is consistently replaced by _ when searching ACL for
 tagged attribute like userCertificate;binary

issue #5135
parent 98d92781
......@@ -453,6 +453,8 @@ class userinfo
return 'rwcdm';
}
$attribute = static::sanitizeAttributeName($attribute);
/* Push cache answer? */
$ACL_CACHE = &session::global_get_ref('ACL_CACHE');
if (isset($ACL_CACHE["$dn+$object+$attribute"])) {
......@@ -1013,6 +1015,8 @@ class userinfo
return TRUE;
}
$attribute = static::sanitizeAttributeName($attribute);
if (is_array($type)) {
/* Used for recursion through subtabs */
$tabs = $type;
......@@ -1065,5 +1069,11 @@ class userinfo
{
$this->currentBase = $base;
}
/* \brief Get ACL name or HTML id from attribute name
*/
public static function sanitizeAttributeName($name)
{
return preg_replace('/[\/\-,.#:;]/', '_', $name);
}
}
?>
......@@ -222,7 +222,7 @@ class Attribute
function getHtmlId ()
{
return $this->htmlid_prefix.preg_replace('/[\/\-,.#:;]/', '_', $this->getLdapName());
return $this->htmlid_prefix.userinfo::sanitizeAttributeName($this->getLdapName());
}
/* html id to put in the "for" attribute of our "label" tag */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment