Code

Added setup patches from stable
[gosa.git] / include / class_ldap.inc
index e5809d72099e075eb69c1fdbd23d80e1c098f6b7..1e086ecb5b2486cc7f47ece760c23cccc8c01dcb 100644 (file)
@@ -826,7 +826,7 @@ class LDAP{
 
   function gen_xls ($dn, $filter= "(objectClass=*)", $attributes= array('*'), $recursive= TRUE,$r_array=0)
   {
-    $display= "";
+    $display= array();
 
       $this->cd($dn);
       $this->search("$filter");
@@ -1217,6 +1217,19 @@ class LDAP{
       }
     }
   }
+
+  /* added by Guido Serra aka Zeph <zeph@purotesto.it> */
+  function getCn($dn){
+    $simple= split(",", $dn);
+
+    foreach($simple as $piece) {
+      $partial= split("=", $piece);
+
+      if($partial[0] == "cn"){
+        return $partial[1];
+      }
+    }
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: