From 8cf493cfdff851f71e0b4f3f7b41ed77f0cdb5cd Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Tue, 17 Jun 2014 13:58:23 +0200
Subject: [PATCH] OO-1105: lower case + trim for email in registration forms

---
 src/main/java/org/olat/registration/EmailSendingForm.java | 2 +-
 .../shibboleth/ShibbolethRegistrationWithEmailForm.java   | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/olat/registration/EmailSendingForm.java b/src/main/java/org/olat/registration/EmailSendingForm.java
index 4a60081793a..795594a09d9 100644
--- a/src/main/java/org/olat/registration/EmailSendingForm.java
+++ b/src/main/java/org/olat/registration/EmailSendingForm.java
@@ -71,7 +71,7 @@ public class EmailSendingForm extends FormBasicController {
 	}
 
 	protected String getEmailAddress() {
-		return mail.getValue().trim();
+		return mail.getValue().toLowerCase().trim();
 	}
 	
 	@Override
diff --git a/src/main/java/org/olat/shibboleth/ShibbolethRegistrationWithEmailForm.java b/src/main/java/org/olat/shibboleth/ShibbolethRegistrationWithEmailForm.java
index 5f6a89fca4d..fd8fe08c207 100644
--- a/src/main/java/org/olat/shibboleth/ShibbolethRegistrationWithEmailForm.java
+++ b/src/main/java/org/olat/shibboleth/ShibbolethRegistrationWithEmailForm.java
@@ -88,13 +88,17 @@ public class ShibbolethRegistrationWithEmailForm extends FormBasicController {
 	/**
 	 * @return Login field.
 	 */
-	protected String getLogin() { return login.getValue(); }
+	protected String getLogin() {
+		return login.getValue();
+	}
 	
 	/**
 	 * 
 	 * @return E-mail field
 	 */
-	protected String getEmail() { return eMail.getValue(); }
+	protected String getEmail() {
+		return eMail.getValue().toLowerCase().trim();
+	}
 
 	@Override
 	protected void formOK(UserRequest ureq) {
-- 
GitLab