From 280b47f9accdb5e36cd7008800dba09e7addc4a5 Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Thu, 18 Dec 2014 08:43:06 +0100
Subject: [PATCH] OO-1353: replace deprecated method

---
 .../olat/shibboleth/ShibbolethRegistrationController.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/olat/shibboleth/ShibbolethRegistrationController.java b/src/main/java/org/olat/shibboleth/ShibbolethRegistrationController.java
index 2b260c27a87..7ec0ee1fd1f 100644
--- a/src/main/java/org/olat/shibboleth/ShibbolethRegistrationController.java
+++ b/src/main/java/org/olat/shibboleth/ShibbolethRegistrationController.java
@@ -331,7 +331,11 @@ public class ShibbolethRegistrationController extends DefaultController implemen
 						email = ShibbolethHelper.getFirstValueOf(ShibbolethModule.getEMail(), shibbolethAttributesMap);
 					}
 
-					User user = UserManager.getInstance().findUserByEmail(email);
+					User user = null;
+					Identity id = UserManager.getInstance().findIdentityByEmail(email);
+					if (id != null) {
+						user = id.getUser();
+					}
 					
 					if (user != null) {
 						// error, email already exists. should actually not happen if OLAT Authenticator has
-- 
GitLab