Code

Updated class ldap
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Feb 2010 10:12:39 +0000 (10:12 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Feb 2010 10:12:39 +0000 (10:12 +0000)
-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

index 80cb94f32264260ac5b108947b78c06b9f3661c2..af263e184ce2e20d7da94a5c1b93db695829b8bd 100644 (file)
@@ -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= "";