[Fusionforge-commits] r12760 - trunk/src/plugins/ldapextauth/include

Roland Mas lolando at fusionforge.org
Mon Mar 14 17:50:06 CET 2011


Author: lolando
Date: 2011-03-14 17:50:06 +0100 (Mon, 14 Mar 2011)
New Revision: 12760

Modified:
   trunk/src/plugins/ldapextauth/include/LdapExtAuthPlugin.class.php
Log:
Fixes

Modified: trunk/src/plugins/ldapextauth/include/LdapExtAuthPlugin.class.php
===================================================================
--- trunk/src/plugins/ldapextauth/include/LdapExtAuthPlugin.class.php	2011-03-14 16:49:51 UTC (rev 12759)
+++ trunk/src/plugins/ldapextauth/include/LdapExtAuthPlugin.class.php	2011-03-14 16:50:06 UTC (rev 12760)
@@ -108,7 +108,9 @@
 			foreach (explode(',', forge_get_config('mapping', $this->name))
 				 as $map_entry) {
 				list ($fffield, $ldapfield) = explode('=',$map_entry);
-				$user_data[$fffield] = $data[$ldapfield][0];
+				if (array_key_exists($ldapfield, $data)) {
+					$user_data[$fffield] = $data[$ldapfield][0];
+				}
 			}
 
 			if (!$u->create ($user_data['unix_name'],
@@ -161,7 +163,9 @@
 		foreach (explode(',', forge_get_config('mapping', $this->name))
 			 as $map_entry) {
 			list ($fffield, $ldapfield) = explode('=',$map_entry);
-			$mapped_data[$fffield] = $data[$ldapfield][0];
+			if (array_key_exists($ldapfield, $data)) {
+				$mapped_data[$fffield] = $data[$ldapfield][0];
+			}
 		}
 		
 		$u->update($mapped_data['firstname'],
@@ -309,8 +313,9 @@
 
 		// If the ldap server does not allow anonymous bind,
 		// then authentificate with the server.
-		if ($this->ldap_bind_dn) {
-			if (!@ldap_bind($conn, $this->ldap_bind_dn, $this->ldap_bind_pwd)) {
+		if (forge_get_config('manager_dn', $this->name)) {
+			if (!@ldap_bind($conn, forge_get_config('manager_dn', $this->name),
+					forge_get_config('ldap_password'))) {
 				error_log("LDAP application bind failed.");
 				return false;
 			}




More information about the Fusionforge-commits mailing list