From 5157b75e725a6b5079c06e413e3264369703ad22 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 24 Feb 2010 10:12:39 +0000 Subject: [PATCH] Updated class ldap -get_objectclasses() will return an array containing MAY and MUST attributes, instead of string when only one attribute was given. e.g. -> gosaDeparment[MAY] = 'manager'; will now be -> gosaDeparment[MAY][0] = 'manager'; git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15684 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_ldap.inc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index 80cb94f32..af263e184 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -1295,7 +1295,11 @@ class LDAP{ break; case ')': if ($name != ""){ - $objectclasses[$ocname][$name]= $this->value2container($value); + $v = $this->value2container($value); + if(in_array($name, array('MUST', 'MAY')) && !is_array($v)){ + $v = array($v); + } + $objectclasses[$ocname][$name]= $v; } $name= ""; $value= ""; @@ -1310,7 +1314,11 @@ class LDAP{ case 'MUST': case 'MAY': if ($name != ""){ - $objectclasses[$ocname][$name]= $this->value2container($value); + $v = $this->value2container($value); + if(in_array($name, array('MUST', 'MAY')) && !is_array($v)){ + $v = array($v); + } + $objectclasses[$ocname][$name]= $v; } $name= $chunk; $value= ""; -- 2.30.2