From 583498d0cfe843a64d8d7de336b3e0b897b78743 Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 12 Feb 2010 12:48:36 +0000 Subject: [PATCH] Added wildcard dummy to acl's git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15615 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_acl.inc | 34 ++++++++++++++++------------ gosa-core/include/class_userinfo.inc | 5 ++++ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/gosa-core/include/class_acl.inc b/gosa-core/include/class_acl.inc index 3e6099a7e..80d5481cd 100644 --- a/gosa-core/include/class_acl.inc +++ b/gosa-core/include/class_acl.inc @@ -979,24 +979,30 @@ class acl extends plugin /* Decode dn's, fill with informations from LDAP */ $ldap= $config->get_ldap_link(); foreach ($ma as $memberdn){ - $dn= base64_decode($memberdn); - $ldap->cat($dn, array('cn', 'objectClass', 'description', 'uid')); - - /* Found entry... */ - if ($ldap->count()){ - $attrs= $ldap->fetch(); - if (in_array_ics('gosaAccount', $attrs['objectClass'])){ - $a['U:'.$dn]= $attrs['cn'][0]." [".$attrs['uid'][0]."]"; - } else { - $a['G:'.$dn]= $attrs['cn'][0]; - if (isset($attrs['description'][0])){ - $a['G:'.$dn].= " [".$attrs['description'][0]."]"; + // Check for wildcard here + if ($memberdn != "*") { + $dn= base64_decode($memberdn); + $ldap->cat($dn, array('cn', 'objectClass', 'description', 'uid')); + + /* Found entry... */ + if ($ldap->count()){ + $attrs= $ldap->fetch(); + if (in_array_ics('gosaAccount', $attrs['objectClass'])){ + $a['U:'.$dn]= $attrs['cn'][0]." [".$attrs['uid'][0]."]"; + } else { + $a['G:'.$dn]= $attrs['cn'][0]; + if (isset($attrs['description'][0])){ + $a['G:'.$dn].= " [".$attrs['description'][0]."]"; + } } + + /* ... or not */ + } else { + $a['U:'.$dn]= sprintf(_("Unknown entry '%s'!"), $dn); } - /* ... or not */ } else { - $a['U:'.$dn]= sprintf(_("Unknown entry '%s'!"), $dn); + $a['*']= sprintf(_("Wildcard ACL")); } } diff --git a/gosa-core/include/class_userinfo.inc b/gosa-core/include/class_userinfo.inc index 1d5cefee5..f972e9962 100644 --- a/gosa-core/include/class_userinfo.inc +++ b/gosa-core/include/class_userinfo.inc @@ -175,6 +175,11 @@ class userinfo if (preg_replace('/^U:/', '', $grp) == $this->dn){ $interresting= TRUE; } + + /* Wildcard? */ + if (preg_match('/^\*/', $grp)){ + $interresting= TRUE; + } } } -- 2.30.2