Code

update: add debug line in func get_ldap_handle() if connection to ldap is not possible
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Sep 2008 08:42:51 +0000 (08:42 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Sep 2008 08:42:51 +0000 (08:42 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@12535 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server

index 0ed129cb468b41a57d02dc90a55a3d80b0b56aae..7e9e0a9ee582fac7ad97edb2905395b4ff914ba1 100755 (executable)
@@ -2062,7 +2062,11 @@ sub get_ldap_handle {
        if ($session_id == 0) {
                daemon_log("$session_id DEBUG: get_ldap_handle invoked without a session_id, create a new ldap_handle", 7); 
                $ldap_handle = Net::LDAP->new( $ldap_uri );
-               $ldap_handle->bind($ldap_admin_dn, password => $ldap_admin_password) or daemon_log("$session_id ERROR: Bind to LDAP $ldap_uri as $ldap_admin_dn failed!"); 
+               if (defined $ldap_handle) {
+                       $ldap_handle->bind($ldap_admin_dn, password => $ldap_admin_password) or daemon_log("$session_id ERROR: Bind to LDAP $ldap_uri as $ldap_admin_dn failed!");
+               } else {
+                       daemon_log("$session_id ERROR: creation of a new LDAP handle failed (ldap_uri '$ldap_uri')");
+               }
 
        } else {
                my $session_reference = $global_kernel->ID_id_to_session($session_id);