From 5064d993cca52a53b18771e9b9988f80b6f35aef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sch=C3=BCler=20Daniel=20=28dschueler=29?=
 <daniel.schueler@iml.unibe.ch>
Date: Mon, 5 Sep 2016 16:52:48 +0000
Subject: [PATCH] Applying Pull Request 'User lookup is backward'
 (https://github.com/go2sh/concrete5-ldap-login/pull/2) manualy.

---
 authentication/ldap/controller.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/authentication/ldap/controller.php b/authentication/ldap/controller.php
index 6b594f6..317450b 100644
--- a/authentication/ldap/controller.php
+++ b/authentication/ldap/controller.php
@@ -178,10 +178,10 @@ class Controller extends AuthenticationTypeController {
     }
 
     if (Config::get('concrete.user.registration.email_registration')) {
-      $userInfo = UserInfo::getByUserName($uName);
+      $userInfo = UserInfo::getByEmail($uName);
     }
     else {
-      $userInfo = UserInfo::getByEmail($uName);
+      $userInfo = UserInfo::getByUserName($uName);
     }
     if (!is_object($userInfo)) {
       if (Config::get('auth.ldap.allowRegistration',false)) {
-- 
GitLab