Code

- added the notification of the module database used in the right place
[gosa.git] / gosa-core / include / class_ldap.inc
index 81e7dd044edf49c60ecf7343342f5d1aadffc287..29f82e7fcd4e460a4c7f41dc04c0aa81695cb9b6 100644 (file)
@@ -120,7 +120,8 @@ class LDAP{
      requests. I.e. member=....                                               */
   static function prepare4filter($dn)
   {
-    return normalizeLdap(str_replace('\\\\', '\\\\\\', LDAP::fix($dn)));
+    $fixed= normalizeLdap(str_replace('\\\\', '\\\\\\', LDAP::fix($dn)));
+    return str_replace('\\,', '\\\\,', $fixed);
   }
 
 
@@ -618,7 +619,7 @@ class LDAP{
 
       } else {
         $type= preg_replace('/^([^=]+)=.*$/', '\\1', $cdn);
-        $param= preg_replace('/^[^=]+=([^,]+),.*$/', '\\1', $cdn);
+        $param= preg_replace('/^[^=]+=([^,]+).*$/', '\\1', $cdn);
 
         $na= array();
 
@@ -702,6 +703,9 @@ class LDAP{
         $this->add($na);
     
         if (!$this->success()){
+
+          print_a(array($cdn,$na));
+
           msg_dialog::display(_("LDAP error"), msgPool::ldaperror($this->get_error(), $cdn, LDAP_ADD, get_class()));
           return FALSE;
         }
@@ -731,6 +735,7 @@ class LDAP{
     }
   }
 
+
   function get_attribute($dn, $name,$r_array=0)
   {
     $data= "";
@@ -746,12 +751,11 @@ class LDAP{
         }
       }
     }
-    if($r_array==0)
-    return ($data);
-    else
-    return ($info);
-  
-  
+    if($r_array==0) {
+      return ($data);
+    } else {
+      return ($info);
+    }
   }