mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 20:51:30 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
f4003f72e9
|
@ -47,9 +47,21 @@ class SeedDMS_LdapAuthentication extends SeedDMS_Authentication {
|
||||||
if(isset($ldapgroups['count']))
|
if(isset($ldapgroups['count']))
|
||||||
$count = (int) $ldapgroups['count'];
|
$count = (int) $ldapgroups['count'];
|
||||||
for ($i = 0; $i < $count; $i++) {
|
for ($i = 0; $i < $count; $i++) {
|
||||||
|
if(0) {
|
||||||
|
/* ldap_explode_dn() turns all utf-8 chars into \xx
|
||||||
|
* This needs to be undone with the following regex.
|
||||||
|
*/
|
||||||
$tmp = ldap_explode_dn($ldapgroups[$i], 1);
|
$tmp = ldap_explode_dn($ldapgroups[$i], 1);
|
||||||
|
$tmp[0] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function ($matches) { return chr(hexdec($matches[1])); }, $tmp[0]);
|
||||||
|
} else {
|
||||||
|
/* Second option would be to not using ldap_explode_dn()
|
||||||
|
* and just extract the cn with
|
||||||
|
* preg_match('/[^cn=]([^,]*)/i', $ldapgroups[$i], $tmp);
|
||||||
|
*/
|
||||||
|
preg_match('/[^cn=]([^,]*)/i', $ldapgroups[$i], $tmp);
|
||||||
|
}
|
||||||
if (!in_array($tmp[0], $groupnames)) {
|
if (!in_array($tmp[0], $groupnames)) {
|
||||||
$groupnames[] = $tmp[0];
|
$groupnames[] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', function ($matches) { return chr(hexdec($matches[1])); }, $tmp[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user