Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Commit

Permalink
[fix] fixed validation when register a user
Browse files Browse the repository at this point in the history
  • Loading branch information
dacrome committed Oct 16, 2014
1 parent dd38160 commit 7fc63c2
Show file tree
Hide file tree
Showing 28 changed files with 964 additions and 537 deletions.
21 changes: 21 additions & 0 deletions RELEASE.NOTES
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# OSIAM addon-self-administration

## X.X - 2014-xx-xx
- [fix] translation property files parsed as UTF-8
Before this fix, the translation messages were parsed as ISO-8859-1
- [cleanup] cleanup logging handling in all controllers
Before this cleanup JUL was used to log messages, now the slf4j logger will be used.
The main concept is the following: When an error occurred which happen because of a
bad request (e.g. missing authorization token) the message will be logged as warn,
when it occurred because of an internal error (e.g. the mail server is not available
or the requested template file is missing) the message will be logged as error.
- [fix] fixed https://github.com/osiam/addon-self-administration/issues/63
When the password reset was already done by the user a FORBIDDEN with an error
description will be returned. Before an exception occurred and it wasn't caught,
so an internal error/500 was returned with a servlet container specific HTML error
page.
- [fix] fixed validation when register a user
Before this fix, the validation wasn't working for the JSR-330 Bean Validation
annotations, but only for the custom user validator. So an exception occurred when
a malformed e-mail-address was send, which response with an internal error and a
servlet container specific HTML error page. This fix switch to only JSR-330
Bean Validation annotations and returns with an error message prepared HTML form.

## 1.2 - 2014-09-30
- [feature] the users password can also changed by clients
Before this feature, the password can only changed with the users access token.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,55 +1,53 @@
registration.title=Registration
registration.headline=Please register
registration.html.title=Registration
registration.html.headline=Please register

registration.userName=Username
registration.formattedName=Formatted name
registration.familyName=Familyname
registration.givenName=Givenname
registration.middleName=Middlename
registration.honorificPrefix=Salutation
registration.honorificSuffix=Honorific suffix
registration.displayName=Displayname
registration.nickName=Nickname
registration.profileUrl=Profile-URL
registration.title=Title
registration.preferredLanguage=Preferred language
registration.locale=Locale
registration.timezone=Timezone
registration.password=Password
registration.confirmPassword=Confirm password
registration.email=Email address
registration.phoneNumber=Phone number
registration.im=Instant messaging ID
registration.photo=Photo-URL
registration.formattedAddress=Formatted address
registration.streetAddress=Street address
registration.locality=Locality
registration.region=Region
registration.postalCode=Postal code
registration.country=Country
registration.urn\:client\:extension.age=age
registration.user.userName=Username
registration.user.formattedName=Formatted name
registration.user.familyName=Familyname
registration.user.givenName=Givenname
registration.user.middleName=Middlename
registration.user.honorificPrefix=Salutation
registration.user.honorificSuffix=Honorific suffix
registration.user.displayName=Displayname
registration.user.nickName=Nickname
registration.user.profileUrl=Profile-URL
registration.user.title=Title
registration.user.preferredLanguage=Preferred language
registration.user.locale=Locale
registration.user.timezone=Timezone
registration.user.password=Password
registration.user.confirmPassword=Confirm password
registration.user.email=Email address
registration.user.phoneNumber=Phone number
registration.user.im=Instant messaging ID
registration.user.photo=Photo-URL
registration.user.formattedAddress=Formatted address
registration.user.streetAddress=Street address
registration.user.locality=Locality
registration.user.region=Region
registration.user.postalCode=Postal code
registration.user.country=Country

registration.success=Dear {0}.<br/><br/>Your user account has been created. Please check your email account to activate your profile.

activation.success=Dear {0}.<br/><br/>Your user account has been activated. Thank you for your registration.
activation.exception=Your account could not be confirmed.

registration.form.register=register
registration.form.error=Error during registration process
Email.registrationUser.email=Your email is not well-formed.
registration.exception.noEmail=No Email set.
registration.exception.email.metadata=Could not send the registration email.
registration.exception.photo=Your Photo URI is not well formed.
registration.exception.username.alreadytaken=Your username is already taken.
registration.exception.email.alreadytaken=Your email address is already taken.

registration.exception.title=Error
registration.exception.message=We're sorry. An internal Server Error occurred.
registration.exception.password.equality=Your passwords don't match.
registration.exception.password.length=Your password is not long enough. Your password has to be at least {0} characters.

registration.exception.usernameEqualsEmail=Username not set.
registration.exception.usernameEqualsEmail.registrationUser.userName=Username not set.
registration.validation.email=Your email is not well-formed.
registration.validation.email.alreadytaken=Your email address is already taken.
registration.validation.photo=Your Photo URI is not well formed.
registration.validation.username=Username not set.
registration.validation.username.alreadytaken=Your username is already taken.
registration.validation.profile.url=Please use a valid profile url.
registration.validation.password=Password not set.
registration.validation.password.equality=Your passwords don't match.
registration.validation.password.length=Your password is not long enough. Your password has to be at least {0} characters.
activation.exception=Your account could not be confirmed.
registration.exception.email.metadata=Could not send the registration email.
registration.exception.noEmail=No email set.
registration.exception.title=Error
exception.email.template.not.found=We're sorry. An internal Server Error occurred.
exception.email.template.malformed=We're sorry. An internal Server Error occurred.
template.email.exception.malformed=We're sorry. An internal Server Error occurred.
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
registration.title=Registration
registration.headline=Bitte registrieren
registration.html.title=Registration
registration.html.headline=Bitte registrieren

registration.formattedName=Formatierter Name
registration.familyName=Nachname
registration.givenName=Vorname
registration.middleName=Zweitname
registration.honorificPrefix=Anrede
registration.honorificSuffix=Nachsilbe
registration.displayName=Anzeigename
registration.nickName=Spitzname
registration.profileUrl=Profil-URL
registration.title=Titel
registration.preferredLanguage=Bevorzugte Sprache
registration.locale=Aufenthaltsort
registration.timezone=Zeitzone
registration.password=Passwort
registration.confirmPassword=Bestätigungspasswort
registration.email=E-Mail-Adresse
registration.phoneNumber=Telefonnummer
registration.im=Sofortnachrichtendienst
registration.photo=Photo URL
registration.formattedAddress=Formatierte Adresse
registration.streetAddress=Straße
registration.locality=Stadt
registration.region=Region
registration.postalCode=Postleitzahl
registration.country=Land
registration.user.userName=Benutzername
registration.user.formattedName=Formatierter Name
registration.user.familyName=Nachname
registration.user.givenName=Vorname
registration.user.middleName=Zweitname
registration.user.honorificPrefix=Anrede
registration.user.honorificSuffix=Nachsilbe
registration.user.displayName=Anzeigename
registration.user.nickName=Spitzname
registration.user.profileUrl=Profil-URL
registration.user.title=Titel
registration.user.preferredLanguage=Bevorzugte Sprache
registration.user.locale=Aufenthaltsort
registration.user.timezone=Zeitzone
registration.user.password=Passwort
registration.user.confirmPassword=Bestätigungspasswort
registration.user.email=E-Mail-Adresse
registration.user.phoneNumber=Telefonnummer
registration.user.im=Sofortnachrichtendienst
registration.user.photo=Photo URL
registration.user.formattedAddress=Formatierte Adresse
registration.user.streetAddress=Straße
registration.user.locality=Stadt
registration.user.region=Region
registration.user.postalCode=Postleitzahl
registration.user.country=Land

registration.success=Sehr geehrte(r) {0}.<br/><br/>Ihr Benutzerkonto wurde angelegt. Bitte prüfen Sie ihre E-Mails und bestätigen Sie Ihr Profil.
activation.success=Sehr geehrte(r) {0}.<br/><br/>Ihr Benutzerkonto wurde aktiviert. Vielen Dank für die Registrierung.
registration.success=Sehr geehrte(r) {0}.<br/><br/>Ihr Benutzerkonto wurde angelegt. Bitte prüfen Sie ihre E-Mails und bestätigen Sie Ihr Profil.

activation.success=Sehr geehrte(r) {0}.<br/><br/>Ihr Benutzerkonto wurde aktiviert. Vielen Dank für die Registrierung.
activation.exception=Ihr Account konnte nicht verifiziert werden.

registration.form.register=Registrieren
registration.form.error=Bei der Registrierung ist ein Fehler aufgetreten.
Email.registrationUser.email=Ihre E-Mail ist fehlerhaft.
registration.exception.noEmail=Es wurde keine E-Mail gesetzt.
registration.exception.email.metadata=Es konnte keine E-Mail verschickt werden.
registration.exception.photo=Ihre Foto-URL ist nicht korrekt.
registration.exception.username.alreadytaken=Der Benutzername ist bereits vergeben.
registration.exception.email.alreadytaken=Die E-Mail-Adresse ist bereits vergeben.

registration.exception.title=Fehler
registration.exception.message=Bitte entschuldigen Sie. Ein interner Fehler ist aufgetreten.
registration.exception.password.equality=Ihre Passwörter stimmen nicht überein.
registration.exception.password.length=Ihr Passwort entspricht nicht der Mindestlänge von {0} Zeichen.

registration.exception.usernameEqualsEmail=Bitte setzen Sie den Benutzernamen.
registration.exception.usernameEqualsEmail.registrationUser.userName=Bitte setzen Sie den Benutzernamen.
registration.validation.email=Bitte geben Sie eine gültige E-Mail-Adresse ein.
registration.validation.email.alreadytaken=Die E-Mail-Adresse ist bereits vergeben.
registration.validation.photo=Ihre Foto-URL ist nicht korrekt.
registration.validation.username=Bitte geben Sie einen Benutzernamen ein.
registration.validation.username.alreadytaken=Der Benutzername ist bereits vergeben.
registration.validation.profile.url=Bitte geben Sie eine gültige URL ein.
registration.validation.password=Bitte geben Sie ein Passwort ein.
registration.validation.password.equality=Die eingegebenen Passwörter stimmen nicht überein.
registration.validation.password.length=Ihr Passwort entspricht nicht der Mindestlänge von {0} Zeichen.

activation.exception=Ihr Account konnte nicht verifiziert werden.
registration.exception.email.metadata=Es konnte keine E-Mail verschickt werden.
registration.exception.noEmail=Es wurde keine E-Mail-Adresse gesetzt.
registration.exception.title=Fehler

template.email.exception.not.found=Bitte entschuldigen Sie. Ein interner Fehler ist aufgetreten.
template.email.exception.malformed=Bitte entschuldigen Sie. Ein interner Fehler ist aufgetreten.
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<title th:text="#{registration.title}">Registration</title>

<link rel="stylesheet" type="text/css" href="../../resources/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}"/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>

<title th:text="#{registration.html.title}">Registration</title>

<link rel="stylesheet" type="text/css" href="../../resources/css/bootstrap.min.css"
th:href="@{/css/bootstrap.min.css}"/>
<link rel="stylesheet" type="text/css" href="../../resources/css/style.css" th:href="@{/css/style.css}"/>
</head>

<body>

<div class="container">
<div class="info-container">
<div class="alert alert-success" th:utext="#{activation.success(${user.userName})}">
SUCCESS
</div>
<div class="container">
<div class="info-container">
<div class="alert alert-success"
th:utext="#{activation.success(${user.userName})}">
SUCCESS
</div>
</div>
</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div class="form-group" th:fragment="defaultInput(attribute, type, required)"
th:if="${#arrays.contains(allowedFields, attribute)}">
<div th:if="${#fields.hasErrors(attribute)}"
th:errors="*{__${attribute}__}"
class="error-message alert-danger">
Error
</div>
<input th:type="${type}"
th:field="*{__${attribute}__}"
class="form-control"
th:placeholder="#{registration.__${attribute}__} + (${required} ? ' *' : '')"
th:errorclass="alert-danger"
th:required="${required}"
th:classappend="${required}? 'required'"/>
</div>

<div class="form-group" th:fragment="extensioninput(urn, field, type, required)"
th:with="attribute='extensions[\'' + ${urn} + '\'].fields[\'' + ${field} + '\']'">
<div th:if="${#fields.hasErrors(attribute)}"
th:errors="*{__${attribute}__}"
class="error-message alert-danger">
Error
</div>
<input
th:type="${type}"
th:field="*{__${attribute}__}"
class="form-control"
th:placeholder="#{registration.__${urn}+'.'+${field}__} + (${required} ? ' *' : '')"
th:errorclass="alert-danger"
th:required="${required}"
th:classappend="${required}? 'required'"/>
</div>

</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<div class="form-group" th:fragment="defaultInput(attribute, type, required)"
th:if="${#arrays.contains(allowedFields, attribute)}">
<div th:if="${#fields.hasErrors(attribute)}"
th:errors="*{__${attribute}__}"
class="error-message alert-danger">
Error
</div>
<input th:type="${type}"
th:field="*{__${attribute}__}"
class="form-control"
th:placeholder="#{registration.user.__${attribute}__} + (${required} ? ' *' : '')"
th:errorclass="alert-danger"
th:required="${required}"
th:classappend="${required}? 'required'"/>
</div>
<div class="form-group" th:fragment="extensioninput(urn, field, type, required)"
th:with="attribute='extensions[\'' + ${urn} + '\'].fields[\'' + ${field} + '\']'">
<div th:if="${#fields.hasErrors(attribute)}"
th:errors="*{__${attribute}__}"
class="error-message alert-danger">
Error
</div>
<input th:type="${type}"
th:field="*{__${attribute}__}"
class="form-control"
th:placeholder="#{registration.user.__${urn}+'.'+${field}__} + (${required} ? ' *' : '')"
th:errorclass="alert-danger"
th:required="${required}"
th:classappend="${required}? 'required'"/>
</div>
</body>
</html>
Loading

0 comments on commit 7fc63c2

Please sign in to comment.