From d06d8b48aa5d459ca77b0cdaec89a0bd3e2c0728 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Wed, 12 Mar 2008 12:08:17 +0000
Subject: [PATCH] Added debug line, and removed warnings with start ldap tls

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@399 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Auth/LDAP.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/SimpleSAML/Auth/LDAP.php b/lib/SimpleSAML/Auth/LDAP.php
index d9a0cb780..11674198e 100644
--- a/lib/SimpleSAML/Auth/LDAP.php
+++ b/lib/SimpleSAML/Auth/LDAP.php
@@ -7,7 +7,7 @@ require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSA
 /**
  * The LDAP class holds helper functions to access an LDAP database.
  *
- * @author Andreas Ĺkre Solberg, UNINETT AS. <andreas.solberg@uninett.no>
+ * @author Andreas Aakre Solberg, UNINETT AS. <andreas.solberg@uninett.no>
  * @author Anders Lund, UNINETT AS. <anders.lund@uninett.no>
  * @package simpleSAMLphp
  * @version $Id: Session.php 244 2008-02-04 08:36:24Z andreassolberg $
@@ -23,7 +23,9 @@ class SimpleSAML_Auth_LDAP {
 	/**
 	 * private constructor restricts instantiaton to getInstance()
 	 */
-	public function __construct($hostname, $enable_tls=true) {
+	public function __construct($hostname, $enable_tls = true) {
+
+		SimpleSAML_Logger::debug('Library - LDAP __construct(): Setup LDAP with host [' . $hostname . '] and tls [' . var_export($enable_tls, true) . ']');
 
 		$this->ldap = @ldap_connect($hostname);
 		if (empty($this->ldap)) 
@@ -32,7 +34,7 @@ class SimpleSAML_Auth_LDAP {
 		$this->setV3();
 		
         if ($enable_tls) {
-            if (!ldap_start_tls($this->ldap)) {
+            if (!@ldap_start_tls($this->ldap)) {
                 throw new Exception('Could not force LDAP into TLS-session. Please verify certificates and configuration');
             }
         }
-- 
GitLab