[Fusionforge-commits] r12753 - trunk/src/plugins/ldapextauth/www

Roland Mas lolando at fusionforge.org
Mon Mar 14 17:48:24 CET 2011


Author: lolando
Date: 2011-03-14 17:48:24 +0100 (Mon, 14 Mar 2011)
New Revision: 12753

Modified:
   trunk/src/plugins/ldapextauth/www/post-login.php
Log:
Fixed logic error

Modified: trunk/src/plugins/ldapextauth/www/post-login.php
===================================================================
--- trunk/src/plugins/ldapextauth/www/post-login.php	2011-03-14 16:48:09 UTC (rev 12752)
+++ trunk/src/plugins/ldapextauth/www/post-login.php	2011-03-14 16:48:24 UTC (rev 12753)
@@ -72,8 +72,8 @@
 	if (!form_key_is_valid(getStringFromRequest('form_key'))) {
 		exit_form_double_submit();
 	}
-	$success = $plugin->checkLDAPCredentials(strtolower($form_loginname),$form_pw);
-	if ($success) {
+	$test = $plugin->checkLDAPCredentials(strtolower($form_loginname),$form_pw);
+	if ($test == FORGE_AUTH_AUTHORITATIVE_ACCEPT) {
 		if ($plugin->isSufficient()) {
 			$plugin->login(user_get_object_by_name($form_loginname));
 		}
@@ -84,14 +84,15 @@
 			header ("Location: " . util_make_url("/my"));
 			exit;
 		}
-	} else {
+	} elseif ($test == FORGE_AUTH_AUTHORITATIVE_REJECT) {
 		if ($form_loginname && $form_pw) {
 			$warning_msg = _('Invalid Password Or User Name');
 		} else {
 			$warning_msg = _('Missing Password Or Users Name');
 		}
-		
-	}
+	} else {
+		$warning_msg = _('LDAP server unreachable');
+	}		
 }
 
 if (isset($session_hash)) {




More information about the Fusionforge-commits mailing list