]> git.sur5r.net Git - contagged/blobdiff - inc/functions.php
supress ldap_bind errors
[contagged] / inc / functions.php
index b0c28f67d6fff20ee4c09f4c3a3579d87c0e3252..f3b2ac05fac2660d67762f46e44793d5ea92059c 100644 (file)
@@ -67,7 +67,7 @@ function do_ldap_bind($user,$pass,$dn=""){
   if(empty($dn)){
     //anonymous bind to lookup users
     //blank binddn or blank bindpw will result in anonymous bind
-    if(!ldap_bind($LDAP_CON,$conf['anonbinddn'],$conf['anonbindpw'])){
+    if(!@ldap_bind($LDAP_CON,$conf['anonbinddn'],$conf['anonbindpw'])){
       die("can not bind for user lookup");
     }
 
@@ -89,7 +89,7 @@ function do_ldap_bind($user,$pass,$dn=""){
   }
 
   //bind with dn
-  if(ldap_bind($LDAP_CON,$dn,$pass)){
+  if(@ldap_bind($LDAP_CON,$dn,$pass)){
     //bind successful -> set up session
     set_session($user,$pass,$dn);
     return true;
@@ -230,12 +230,7 @@ function prepare_ldap_entry($in){
             $out[$FIELDS["_$key"]][] = $value; //shouldn't happen, but to be sure
         }
     }else{
-        // no mapping found - assume it to be a LDAP attribute (shouldn't happen)
-        if(is_array($value)){
-            $out[$key] = $value;
-        }else{
-            $out[$key][] = $value;
-        }
+        // no mapping found we ignore it
     }
   }