From 70fcad7981b60b4f35a16b4c55f308aabf304d53 Mon Sep 17 00:00:00 2001 From: Joel Gilliland Date: Wed, 23 Oct 2013 22:23:42 -0400 Subject: [PATCH] Fixed bug in LdapAuth where it assumed authenticate returned boolean resulting in always a "successful" login. Also integrated ZfcRbac, however this needs refactored to be optional. --- src/ZfcUserLdap/Authentication/Adapter/LdapAuth.php | 2 +- src/ZfcUserLdap/Entity/User.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ZfcUserLdap/Authentication/Adapter/LdapAuth.php b/src/ZfcUserLdap/Authentication/Adapter/LdapAuth.php index 1805545..531b386 100644 --- a/src/ZfcUserLdap/Authentication/Adapter/LdapAuth.php +++ b/src/ZfcUserLdap/Authentication/Adapter/LdapAuth.php @@ -82,7 +82,7 @@ public function authenticate(AuthEvent $e) } } $ldapAuthAdapter = $this->serviceManager->get('ZfcUserLdap\LdapAdapter'); - if (!$ldapAuthAdapter->authenticate($identity, $credential)) { + if ($ldapAuthAdapter->authenticate($identity, $credential) !== true) { // Password does not match $e->setCode(AuthenticationResult::FAILURE_CREDENTIAL_INVALID) ->setMessages(array('Supplied credential is invalid.')); diff --git a/src/ZfcUserLdap/Entity/User.php b/src/ZfcUserLdap/Entity/User.php index bcb0b74..c005ff1 100755 --- a/src/ZfcUserLdap/Entity/User.php +++ b/src/ZfcUserLdap/Entity/User.php @@ -3,8 +3,9 @@ namespace ZfcUserLdap\Entity; use ZfcUser\Entity\UserInterface; +use ZfcRbac\Identity\IdentityInterface; -class User implements UserInterface +class User implements UserInterface, IdentityInterface { /**