From e111c7840e97859c64ebe1533665fcbfd4bfce1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Tue, 3 Feb 2009 11:02:14 +0000
Subject: [PATCH] Add new function for getting last LDAP error

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

diff --git a/lib/SimpleSAML/Auth/LDAP.php b/lib/SimpleSAML/Auth/LDAP.php
index 98555afc0..05a7c9462 100644
--- a/lib/SimpleSAML/Auth/LDAP.php
+++ b/lib/SimpleSAML/Auth/LDAP.php
@@ -44,6 +44,11 @@ class SimpleSAML_Auth_LDAP {
 
 	}
 	
+	public function getLastError() {
+		if (ldap_errno($this->ldap) == 0) return NULL;
+		return ldap_error($this->ldap);
+	}
+	
 	/**
 	 * Set LDAP version 3 option on the connection handler. Will throw an error if not possible.
 	 */
-- 
GitLab