From: Roland Häder Date: Fri, 12 Aug 2016 08:43:16 +0000 (+0200) Subject: Continued with i18n: (please cherry-pick) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=af0b6f41d8b192022bd32e88833f82d5dbae1cbb;p=jjobs-war.git Continued with i18n: (please cherry-pick) - now these messages from managed beans can be localized Signed-off-by: Roland Häder --- diff --git a/src/java/de/chotime/landingpage/beans/phone/JobsPhoneWebApplicationBean.java b/src/java/de/chotime/landingpage/beans/phone/JobsPhoneWebApplicationBean.java new file mode 100644 index 00000000..148f855e --- /dev/null +++ b/src/java/de/chotime/landingpage/beans/phone/JobsPhoneWebApplicationBean.java @@ -0,0 +1,349 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package de.chotime.landingpage.beans.phone; + +import java.text.MessageFormat; +import java.util.LinkedList; +import java.util.List; +import java.util.Objects; +import javax.annotation.PostConstruct; +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Observes; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent; +import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent; +import org.mxchange.jjobs.beans.BaseJobsController; +import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote; +import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; + +/** + * Regular controller (bean) for phone numbers + *

+ * @author Roland Haeder + */ +@Named ("phoneController") +@ApplicationScoped +public class JobsPhoneWebApplicationBean extends BaseJobsController implements JobsPhoneWebApplicationController { + + /** + * Serial number + */ + private static final long serialVersionUID = 491_058_674_675_690_105L; + + /** + * All cell phone numbers + */ + private final List cellphoneNumbers; + + /** + * All fax numbers + */ + private final List faxNumbers; + + /** + * All land-line numbers + */ + private final List landLineNumbers; + + /** + * General EJB for phone numbers + */ + private PhoneSessionBeanRemote phoneBean; + + /** + * Default constructor + */ + public JobsPhoneWebApplicationBean () { + // Try it + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup the beans + this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jlandingpage-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N + } catch (final NamingException e) { + // Throw it again + throw new FaceletException(e); + } + + // Init all lists + this.cellphoneNumbers = new LinkedList<>(); + this.faxNumbers = new LinkedList<>(); + this.landLineNumbers = new LinkedList<>(); + } + + @Override + public void afterAdminAddedContact (@Observes final AdminAddedContactEvent event) { + // The event must be valid + if (null == event) { + // Throw NPE + throw new NullPointerException("event is null"); //NOI18N + } else if (event.getAddedContact() == null) { + // Throw again ... + throw new NullPointerException("event.addedContact is null"); //NOI18N + } else if (event.getAddedContact().getContactId() == null) { + // ... and again + throw new NullPointerException("event.addedContact.contactId is null"); //NOI18N + } else if (event.getAddedContact().getContactId() < 1) { + // Not valid + throw new IllegalArgumentException(MessageFormat.format("event.addedContact.contactId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N //NOI18N + } + + // Update contact's cellphone, land-line and fax number + this.updateContactPhoneNumbers(event.getAddedContact()); + + // Clear this bean + this.clear(); + } + + @Override + public void afterAdminAddedUserEvent (@Observes final AdminAddedUserEvent event) { + // event should not be null + if (null == event) { + // Throw NPE + throw new NullPointerException("event is null"); //NOI18N + } else if (event.getAddedUser() == null) { + // Throw NPE again + throw new NullPointerException("event.addedUser is null"); //NOI18N + } else if (event.getAddedUser().getUserId() == null) { + // userId is null + throw new NullPointerException("event.addedUser.userId is null"); //NOI18N + } else if (event.getAddedUser().getUserId() < 1) { + // Not avalid id + throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getAddedUser(), event.getAddedUser().getUserId())); //NOI18N + } + + // Update contact's cellphone, land-line and fax number + this.updateContactPhoneNumbers(event.getAddedUser().getUserContact()); + + // Clear all data + this.clear(); + } + + @Override + public void afterAdminUpdatedContactDataEvent (@Observes final AdminUpdatedContactEvent event) { + // event should not be null + if (null == event) { + // Throw NPE + throw new NullPointerException("event is null"); //NOI18N + } else if (event.getUpdatedContact() == null) { + // Throw NPE again + throw new NullPointerException("event.updatedContact is null"); //NOI18N + } else if (event.getUpdatedContact().getContactId() == null) { + // userId is null + throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N + } else if (event.getUpdatedContact().getContactId() < 1) { + // Not avalid id + throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N + } + + // Update contact's cellphone, land-line and fax number + this.updateContactPhoneNumbers(event.getUpdatedContact()); + + // Clear all data + this.clear(); + } + + @Override + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List allCellphoneNumbers () { + return this.cellphoneNumbers; + } + + @Override + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List allFaxNumbers () { + return this.faxNumbers; + } + + @Override + @SuppressWarnings ("ReturnOfCollectionOrArrayField") + public List allLandLineNumbers () { + return this.landLineNumbers; + } + + /** + * Post-construction method + */ + @PostConstruct + public void init () { + // All phone numbers + this.cellphoneNumbers.addAll(this.phoneBean.allCellphoneNumbers()); + this.faxNumbers.addAll(this.phoneBean.allFaxNumbers()); + this.landLineNumbers.addAll(this.phoneBean.allLandLineNumbers()); + } + + /** + * Clears this bean + */ + private void clear () { + // Clear all data + } + + /** + * Uniquely add given cellphone number to this bean's list. First remove the + * old instance (by id number), then re-add it again. + *

+ * @param cellphoneNumber Cellphone number to add + */ + private void uniqueAddCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) { + // Make sure the parameter is valid + if (null == cellphoneNumber) { + // Throw NPE + throw new NullPointerException("cellphoneNumber is null"); + } else if (cellphoneNumber.getPhoneId() == null) { + // Throw again ... + throw new NullPointerException("cellphoneNumber.phoneId is null"); + } else if (cellphoneNumber.getPhoneId() < 1) { + // Not valid + throw new IllegalArgumentException(MessageFormat.format("cellphoneNumber.phoneId={0} is not valid.", cellphoneNumber.getPhoneId())); + } + + // First remove it by object + if (!this.cellphoneNumbers.remove(cellphoneNumber)) { + // Did not work, try by id number + for (final DialableCellphoneNumber cell : this.cellphoneNumbers) { + // Is id number the same? + if (Objects.equals(cell.getPhoneId(), cellphoneNumber.getPhoneId())) { + // Found it + this.cellphoneNumbers.remove(cell); + break; + } + } + } + + // ... then add it + this.cellphoneNumbers.add(cellphoneNumber); + } + + /** + * Uniquely add given fax number to this bean's list. First remove the old + * instance (by id number), then re-add it again. + *

+ * @param faxNumber number to add + */ + private void uniqueAddFaxNumber (final DialableFaxNumber faxNumber) { + // Make sure the parameter is valid + if (null == faxNumber) { + // Throw NPE + throw new NullPointerException("faxNumber is null"); + } else if (faxNumber.getPhoneId() == null) { + // Throw again ... + throw new NullPointerException("faxNumber.phoneId is null"); + } else if (faxNumber.getPhoneId() < 1) { + // Not valid + throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneId={0} is not valid.", faxNumber.getPhoneId())); + } + + // First remove it + if (!this.faxNumbers.remove(faxNumber)) { + // Did not work, try by id number + for (final DialableFaxNumber fax : this.faxNumbers) { + // Is id number the same? + if (Objects.equals(fax.getPhoneId(), faxNumber.getPhoneId())) { + // Found it + this.faxNumbers.remove(fax); + break; + } + } + } + + // ... then add it + this.faxNumbers.add(faxNumber); + } + + /** + * Uniquely add given land-line number to this bean's list. First remove the + * old instance (by id number), then re-add it again. + *

+ * @param landLineNumber Land-line number to add + */ + private void uniqueAddLandLineNumber (final DialableLandLineNumber landLineNumber) { + // Make sure the parameter is valid + if (null == landLineNumber) { + // Throw NPE + throw new NullPointerException("landLineNumber is null"); + } else if (landLineNumber.getPhoneId() == null) { + // Throw again ... + throw new NullPointerException("landLineNumber.phoneId is null"); + } else if (landLineNumber.getPhoneId() < 1) { + // Not valid + throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneId={0} is not valid.", landLineNumber.getPhoneId())); + } + + // First remove it + if (!this.landLineNumbers.remove(landLineNumber)) { + // Did not work, try by id number + for (final DialableLandLineNumber landLine : this.landLineNumbers) { + // Is id number the same? + if (Objects.equals(landLine.getPhoneId(), landLineNumber.getPhoneId())) { + // Found it + this.landLineNumbers.remove(landLine); + break; + } + } + } + + // ... then add it + this.landLineNumbers.add(landLineNumber); + } + + /** + * Updates given contact's cellphone, land-line and fax number + *

+ * @param contact Contact instance + */ + private void updateContactPhoneNumbers (final Contact contact) { + // Parameter must be valid + if (null == contact) { + // Throw NPE + throw new NullPointerException("contact is null"); + } else if (contact.getContactId() == null) { + // Throw again + throw new NullPointerException("contact.contactId is null"); + } else if (contact.getContactId() < 1) { + // Id number is not valid + } + + // Is cellphone set? + if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) { + // Unique-add it + this.uniqueAddCellphoneNumber(contact.getContactCellphoneNumber()); + } + + // Is land-line set? + if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) { + // Unique-add it + this.uniqueAddLandLineNumber(contact.getContactLandLineNumber()); + } + + // Is fax set? + if (contact.getContactFaxNumber() instanceof DialableFaxNumber) { + // Unique-add it + this.uniqueAddFaxNumber(contact.getContactFaxNumber()); + } + } + +} diff --git a/src/java/de/chotime/landingpage/beans/phone/JobsPhoneWebApplicationController.java b/src/java/de/chotime/landingpage/beans/phone/JobsPhoneWebApplicationController.java new file mode 100644 index 00000000..c99b9428 --- /dev/null +++ b/src/java/de/chotime/landingpage/beans/phone/JobsPhoneWebApplicationController.java @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package de.chotime.landingpage.beans.phone; + +import java.io.Serializable; +import java.util.List; +import javax.ejb.Local; +import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent; +import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent; +import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; + +/** + * An interface for a request web controller (bean) for administrative phone + * number purposes. + *

+ * @author Roland Haeder + */ +@Local +public interface JobsPhoneWebApplicationController extends Serializable { + + /** + * Event observer for newly added users by administrator + *

+ * @param event Event being fired + */ + void afterAdminAddedUserEvent (final AdminAddedUserEvent event); + + /** + * Observes events being fired when an administrator has added a new + * contact. + *

+ * @param event Event being fired + */ + void afterAdminAddedContact (final AdminAddedContactEvent event); + + /** + * Event observer for updated contact data by administrators + *

+ * @param event Updated contact data event + */ + void afterAdminUpdatedContactDataEvent (final AdminUpdatedContactEvent event); + + /** + * Returns a list of all cellphone numbers. For performance reasons, the + * controller (bean) should be application-scoped as from user to user + * nothing changes. And the controller's post-construct method should load + * all numbers and cache it in the controller. + *

+ * @return List of all cell phone numbers + */ + List allCellphoneNumbers (); + + /** + * Returns a list of all fax numbers. For performance reasons, the + * controller (bean) should be application-scoped as from user to user + * nothing changes. And the controller's post-construct method should load + * all numbers and cache it in the controller. + *

+ * @return List of all fax numbers + */ + List allFaxNumbers (); + + /** + * Returns a list of all land-line numbers. For performance reasons, the + * controller (bean) should be application-scoped as from user to user + * nothing changes. And the controller's post-construct method should load + * all numbers and cache it in the controller. + *

+ * @return List of all land-line numbers + */ + List allLandLineNumbers (); + +} diff --git a/src/java/de/chotime/landingpage/beans/phone/LandingPhoneWebApplicationBean.java b/src/java/de/chotime/landingpage/beans/phone/LandingPhoneWebApplicationBean.java deleted file mode 100644 index d881bdb1..00000000 --- a/src/java/de/chotime/landingpage/beans/phone/LandingPhoneWebApplicationBean.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (C) 2016 Cho-Time GmbH - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -package de.chotime.landingpage.beans.phone; - -import de.chotime.landingpage.beans.BaseLandingController; -import java.text.MessageFormat; -import java.util.LinkedList; -import java.util.List; -import java.util.Objects; -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Observes; -import javax.faces.view.facelets.FaceletException; -import javax.inject.Named; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent; -import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent; -import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote; -import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; - -/** - * Regular controller (bean) for phone numbers - *

- * @author Roland Haeder - */ -@Named ("phoneController") -@ApplicationScoped -public class LandingPhoneWebApplicationBean extends BaseLandingController implements LandingPhoneWebApplicationController { - - /** - * Serial number - */ - private static final long serialVersionUID = 491_058_674_675_690_105L; - - /** - * All cell phone numbers - */ - private final List cellphoneNumbers; - - /** - * All fax numbers - */ - private final List faxNumbers; - - /** - * All land-line numbers - */ - private final List landLineNumbers; - - /** - * General EJB for phone numbers - */ - private PhoneSessionBeanRemote phoneBean; - - /** - * Default constructor - */ - public LandingPhoneWebApplicationBean () { - // Try it - try { - // Get initial context - Context context = new InitialContext(); - - // Try to lookup the beans - this.phoneBean = (PhoneSessionBeanRemote) context.lookup("java:global/jlandingpage-ejb/phone!org.mxchange.jphone.phonenumbers.phone.PhoneSessionBeanRemote"); //NOI18N - } catch (final NamingException e) { - // Throw it again - throw new FaceletException(e); - } - - // Init all lists - this.cellphoneNumbers = new LinkedList<>(); - this.faxNumbers = new LinkedList<>(); - this.landLineNumbers = new LinkedList<>(); - } - - @Override - public void afterAdminAddedContact (@Observes final AdminAddedContactEvent event) { - // The event must be valid - if (null == event) { - // Throw NPE - throw new NullPointerException("event is null"); //NOI18N - } else if (event.getAddedContact() == null) { - // Throw again ... - throw new NullPointerException("event.addedContact is null"); //NOI18N - } else if (event.getAddedContact().getContactId() == null) { - // ... and again - throw new NullPointerException("event.addedContact.contactId is null"); //NOI18N - } else if (event.getAddedContact().getContactId() < 1) { - // Not valid - throw new IllegalArgumentException(MessageFormat.format("event.addedContact.contactId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N //NOI18N - } - - // Update contact's cellphone, land-line and fax number - this.updateContactPhoneNumbers(event.getAddedContact()); - - // Clear this bean - this.clear(); - } - - @Override - public void afterAdminAddedUserEvent (@Observes final AdminAddedUserEvent event) { - // event should not be null - if (null == event) { - // Throw NPE - throw new NullPointerException("event is null"); //NOI18N - } else if (event.getAddedUser() == null) { - // Throw NPE again - throw new NullPointerException("event.addedUser is null"); //NOI18N - } else if (event.getAddedUser().getUserId() == null) { - // userId is null - throw new NullPointerException("event.addedUser.userId is null"); //NOI18N - } else if (event.getAddedUser().getUserId() < 1) { - // Not avalid id - throw new IllegalArgumentException(MessageFormat.format("userId of user={0} is not valid: {1}", event.getAddedUser(), event.getAddedUser().getUserId())); //NOI18N - } - - // Update contact's cellphone, land-line and fax number - this.updateContactPhoneNumbers(event.getAddedUser().getUserContact()); - - // Clear all data - this.clear(); - } - - @Override - public void afterAdminUpdatedContactDataEvent (@Observes final AdminUpdatedContactEvent event) { - // event should not be null - if (null == event) { - // Throw NPE - throw new NullPointerException("event is null"); //NOI18N - } else if (event.getUpdatedContact() == null) { - // Throw NPE again - throw new NullPointerException("event.updatedContact is null"); //NOI18N - } else if (event.getUpdatedContact().getContactId() == null) { - // userId is null - throw new NullPointerException("event.updatedContact.contactId is null"); //NOI18N - } else if (event.getUpdatedContact().getContactId() < 1) { - // Not avalid id - throw new IllegalArgumentException(MessageFormat.format("contactId of contact={0} is not valid: {1}", event.getUpdatedContact(), event.getUpdatedContact().getContactId())); //NOI18N - } - - // Update contact's cellphone, land-line and fax number - this.updateContactPhoneNumbers(event.getUpdatedContact()); - - // Clear all data - this.clear(); - } - - @Override - @SuppressWarnings ("ReturnOfCollectionOrArrayField") - public List allCellphoneNumbers () { - return this.cellphoneNumbers; - } - - @Override - @SuppressWarnings ("ReturnOfCollectionOrArrayField") - public List allFaxNumbers () { - return this.faxNumbers; - } - - @Override - @SuppressWarnings ("ReturnOfCollectionOrArrayField") - public List allLandLineNumbers () { - return this.landLineNumbers; - } - - /** - * Post-construction method - */ - @PostConstruct - public void init () { - // All phone numbers - this.cellphoneNumbers.addAll(this.phoneBean.allCellphoneNumbers()); - this.faxNumbers.addAll(this.phoneBean.allFaxNumbers()); - this.landLineNumbers.addAll(this.phoneBean.allLandLineNumbers()); - } - - /** - * Clears this bean - */ - private void clear () { - // Clear all data - } - - /** - * Uniquely add given cellphone number to this bean's list. First remove the - * old instance (by id number), then re-add it again. - *

- * @param cellphoneNumber Cellphone number to add - */ - private void uniqueAddCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) { - // Make sure the parameter is valid - if (null == cellphoneNumber) { - // Throw NPE - throw new NullPointerException("cellphoneNumber is null"); - } else if (cellphoneNumber.getPhoneId() == null) { - // Throw again ... - throw new NullPointerException("cellphoneNumber.phoneId is null"); - } else if (cellphoneNumber.getPhoneId() < 1) { - // Not valid - throw new IllegalArgumentException(MessageFormat.format("cellphoneNumber.phoneId={0} is not valid.", cellphoneNumber.getPhoneId())); - } - - // First remove it by object - if (!this.cellphoneNumbers.remove(cellphoneNumber)) { - // Did not work, try by id number - for (final DialableCellphoneNumber cell : this.cellphoneNumbers) { - // Is id number the same? - if (Objects.equals(cell.getPhoneId(), cellphoneNumber.getPhoneId())) { - // Found it - this.cellphoneNumbers.remove(cell); - break; - } - } - } - - // ... then add it - this.cellphoneNumbers.add(cellphoneNumber); - } - - /** - * Uniquely add given fax number to this bean's list. First remove the old - * instance (by id number), then re-add it again. - *

- * @param faxNumber number to add - */ - private void uniqueAddFaxNumber (final DialableFaxNumber faxNumber) { - // Make sure the parameter is valid - if (null == faxNumber) { - // Throw NPE - throw new NullPointerException("faxNumber is null"); - } else if (faxNumber.getPhoneId() == null) { - // Throw again ... - throw new NullPointerException("faxNumber.phoneId is null"); - } else if (faxNumber.getPhoneId() < 1) { - // Not valid - throw new IllegalArgumentException(MessageFormat.format("faxNumber.phoneId={0} is not valid.", faxNumber.getPhoneId())); - } - - // First remove it - if (!this.faxNumbers.remove(faxNumber)) { - // Did not work, try by id number - for (final DialableFaxNumber fax : this.faxNumbers) { - // Is id number the same? - if (Objects.equals(fax.getPhoneId(), faxNumber.getPhoneId())) { - // Found it - this.faxNumbers.remove(fax); - break; - } - } - } - - // ... then add it - this.faxNumbers.add(faxNumber); - } - - /** - * Uniquely add given land-line number to this bean's list. First remove the - * old instance (by id number), then re-add it again. - *

- * @param landLineNumber Land-line number to add - */ - private void uniqueAddLandLineNumber (final DialableLandLineNumber landLineNumber) { - // Make sure the parameter is valid - if (null == landLineNumber) { - // Throw NPE - throw new NullPointerException("landLineNumber is null"); - } else if (landLineNumber.getPhoneId() == null) { - // Throw again ... - throw new NullPointerException("landLineNumber.phoneId is null"); - } else if (landLineNumber.getPhoneId() < 1) { - // Not valid - throw new IllegalArgumentException(MessageFormat.format("landLineNumber.phoneId={0} is not valid.", landLineNumber.getPhoneId())); - } - - // First remove it - if (!this.landLineNumbers.remove(landLineNumber)) { - // Did not work, try by id number - for (final DialableLandLineNumber landLine : this.landLineNumbers) { - // Is id number the same? - if (Objects.equals(landLine.getPhoneId(), landLineNumber.getPhoneId())) { - // Found it - this.landLineNumbers.remove(landLine); - break; - } - } - } - - // ... then add it - this.landLineNumbers.add(landLineNumber); - } - - /** - * Updates given contact's cellphone, land-line and fax number - *

- * @param contact Contact instance - */ - private void updateContactPhoneNumbers (final Contact contact) { - // Parameter must be valid - if (null == contact) { - // Throw NPE - throw new NullPointerException("contact is null"); - } else if (contact.getContactId() == null) { - // Throw again - throw new NullPointerException("contact.contactId is null"); - } else if (contact.getContactId() < 1) { - // Id number is not valid - } - - // Is cellphone set? - if (contact.getContactCellphoneNumber() instanceof DialableCellphoneNumber) { - // Unique-add it - this.uniqueAddCellphoneNumber(contact.getContactCellphoneNumber()); - } - - // Is land-line set? - if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) { - // Unique-add it - this.uniqueAddLandLineNumber(contact.getContactLandLineNumber()); - } - - // Is fax set? - if (contact.getContactFaxNumber() instanceof DialableFaxNumber) { - // Unique-add it - this.uniqueAddFaxNumber(contact.getContactFaxNumber()); - } - } - -} diff --git a/src/java/de/chotime/landingpage/beans/phone/LandingPhoneWebApplicationController.java b/src/java/de/chotime/landingpage/beans/phone/LandingPhoneWebApplicationController.java deleted file mode 100644 index d835888c..00000000 --- a/src/java/de/chotime/landingpage/beans/phone/LandingPhoneWebApplicationController.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2016 Cho-Time GmbH - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -package de.chotime.landingpage.beans.phone; - -import java.io.Serializable; -import java.util.List; -import javax.ejb.Local; -import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent; -import org.mxchange.jcontacts.events.contact.update.AdminUpdatedContactEvent; -import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; - -/** - * An interface for a request web controller (bean) for administrative phone - * number purposes. - *

- * @author Roland Haeder - */ -@Local -public interface LandingPhoneWebApplicationController extends Serializable { - - /** - * Event observer for newly added users by adminstrator - *

- * @param event Event being fired - */ - void afterAdminAddedUserEvent (final AdminAddedUserEvent event); - - /** - * Observes events being fired when an administrator has added a new - * contact. - *

- * @param event Event being fired - */ - void afterAdminAddedContact (final AdminAddedContactEvent event); - - /** - * Event observer for updated contact data by administrators - *

- * @param event Updated contact data event - */ - void afterAdminUpdatedContactDataEvent (final AdminUpdatedContactEvent event); - - /** - * Returns a list of all cellphone numbers. For performance reasons, the - * controller (bean) should be application-scoped as from user to user - * nothing changes. And the controller's post-construct method should load - * all numbers and cache it in the controller. - *

- * @return List of all cell phone numbers - */ - List allCellphoneNumbers (); - - /** - * Returns a list of all fax numbers. For performance reasons, the - * controller (bean) should be application-scoped as from user to user - * nothing changes. And the controller's post-construct method should load - * all numbers and cache it in the controller. - *

- * @return List of all fax numbers - */ - List allFaxNumbers (); - - /** - * Returns a list of all land-line numbers. For performance reasons, the - * controller (bean) should be application-scoped as from user to user - * nothing changes. And the controller's post-construct method should load - * all numbers and cache it in the controller. - *

- * @return List of all land-line numbers - */ - List allLandLineNumbers (); - -} diff --git a/src/java/org/mxchange/jjobs/beans/BaseJobsController.java b/src/java/org/mxchange/jjobs/beans/BaseJobsController.java index 2a4a4ebb..adc9ec6b 100644 --- a/src/java/org/mxchange/jjobs/beans/BaseJobsController.java +++ b/src/java/org/mxchange/jjobs/beans/BaseJobsController.java @@ -18,6 +18,9 @@ package org.mxchange.jjobs.beans; import java.io.Serializable; import java.text.MessageFormat; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; @@ -117,14 +120,38 @@ public abstract class BaseJobsController implements Serializable { } /** - * Shows a faces message with given message. + * Shows a faces message with given message (i18n) key. *

* @param clientId Client id to send message to - * @param message Causing exception + * @param i18nKey Message key */ - protected void showFacesMessage (final String clientId, final String message) { + protected void showFacesMessage (final String clientId, final String i18nKey) { + // Get faces context + FacesContext context = FacesContext.getCurrentInstance(); + + // Get bundle name + String messageBundleName = context.getApplication().getMessageBundle(); + + // Get locale + Locale locale = context.getViewRoot().getLocale(); + + // Init bundle variable + ResourceBundle bundle; + + try { + // Get bundle + bundle = ResourceBundle.getBundle(messageBundleName, locale); + } catch (final MissingResourceException ex) { + // Call other method + this.showFacesMessage(clientId, ex); + return; + } + + // Get message + String message = bundle.getString(i18nKey); + // Get context and add message - FacesContext.getCurrentInstance().addMessage(clientId, new FacesMessage(message)); + context.addMessage(clientId, new FacesMessage(message)); } } diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java index b774c37d..c3807eda 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java @@ -56,7 +56,6 @@ import org.mxchange.jusercore.events.login.UserLoggedInEvent; import org.mxchange.jusercore.events.registration.UserRegisteredEvent; import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; import org.mxchange.jusercore.events.user.linked.AdminLinkedUserEvent; -import org.mxchange.jusercore.exceptions.UserPasswordMismatchException; import org.mxchange.jusercore.model.user.User; /** @@ -539,7 +538,7 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job throw new FaceletException("Not all required fields are set."); //NOI18N } else if (!this.userLoginController.ifCurrentPasswordMatches()) { // Password not matching - this.showFacesMessage("form_login_change_personal:currentPassword", new UserPasswordMismatchException(this.userLoginController.getLoggedInUser())); //NOI18N + this.showFacesMessage("form_login_change_personal:currentPassword", "ERROR_USER_CURRENT_PASSWORD_MISMATCHING"); //NOI18N return ""; //NOI18N } diff --git a/src/java/org/mxchange/jjobs/beans/email_address/JobsEmailChangeWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/email_address/JobsEmailChangeWebSessionBean.java index e69d52ae..7fd0d3e8 100644 --- a/src/java/org/mxchange/jjobs/beans/email_address/JobsEmailChangeWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/email_address/JobsEmailChangeWebSessionBean.java @@ -31,7 +31,6 @@ import org.mxchange.jcoreee.utils.FacesUtils; import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController; import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController; -import org.mxchange.jusercore.exceptions.UserPasswordMismatchException; import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress; import org.mxchange.jusercore.model.email_address.EmailAddressChange; import org.mxchange.jusercore.model.email_address.EmailChangeSessionBeanRemote; @@ -117,7 +116,7 @@ public class JobsEmailChangeWebSessionBean extends BaseJobsController implements throw new FaceletException("Email address 1/2 are mismatching."); //NOI18N } else if (!this.userLoginController.ifCurrentPasswordMatches()) { // Password not matching - this.showFacesMessage("form_login_change_email_address:currentPassword", new UserPasswordMismatchException(this.userLoginController.getLoggedInUser())); //NOI18N + this.showFacesMessage("form_login_change_email_address:currentPassword", "ERROR_USER_CURRENT_PASSWORD_MISMATCHING"); //NOI18N return ""; //NOI18N } else if (!this.featureController.isFeatureEnabled("edit_user_data")) { //NOI18N // Editing is not allowed diff --git a/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionBean.java index 9bf9bb7c..0f28b526 100644 --- a/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionBean.java @@ -229,13 +229,19 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J // All fine return "login"; //NOI18N - } catch (final UserNotFoundException | UserStatusLockedException | UserStatusUnconfirmedException ex) { + } catch (final UserNotFoundException ex) { // Show JSF message - this.showFacesMessage("form_user_login:userName", ex); //NOI18N + this.showFacesMessage("form_user_login:userName", "ERROR_USER_NOT_FOUND"); //NOI18N + return ""; //NOI18N + } catch (final UserStatusLockedException ex) { + this.showFacesMessage("form_user_login:userName", "ERROR_USER_STATUS_LOCKED"); //NOI18N + return ""; //NOI18N + } catch (final UserStatusUnconfirmedException ex) { + this.showFacesMessage("form_user_login:userName", "ERROR_USER_STATUS_UNCONFIRMED"); //NOI18N return ""; //NOI18N } catch (final UserPasswordMismatchException ex) { // Show JSF message - this.showFacesMessage("form_user_login:userPassword", ex); //NOI18N + this.showFacesMessage("form_user_login:userPassword", "ERROR_USER_PASSWORD_MISMATCH"); //NOI18N return ""; //NOI18N } } diff --git a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java index 32683596..c89479b8 100644 --- a/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java @@ -114,7 +114,7 @@ public class JobsAdminMobileProviderWebRequestBean extends BaseJobsController im // Is the provider already created? if (this.isMobileProviderCreated(mobileProvider)) { // Then throw exception - this.showFacesMessage("form_add_mobile_provider:providerDialPrefix", new MobileProviderAlreadyAddedException(mobileProvider)); //NOI18N + this.showFacesMessage("form_add_mobile_provider:providerDialPrefix", "ERROR_ADMIN_MOBILE_PROVIDER_ALREADY_ADDED"); //NOI18N return ""; //NOI18N } diff --git a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java index 1b1ae240..1249feab 100644 --- a/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/phone/JobsAdminPhoneWebRequestBean.java @@ -171,7 +171,7 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements throw new NullPointerException(MessageFormat.format("this.beanHelper.cellphoneNumber.phoneNumber={0} is not valid.", this.beanHelper.getCellPhoneNumber().getPhoneNumber())); //NOI18N } else if (this.getCellphoneProvider() == null) { // Not provided - this.showFacesMessage("form_edit_cellphone:cellphoneProvider", "No mobile provider selected"); //NOI18N + this.showFacesMessage("form_edit_cellphone:cellphoneProvider", "ERROR_ADMIN_NO_MOBILE_PROVIDER_SELECTED"); //NOI18N return ""; //NOI18N } else if (this.getCellphoneProvider().getProviderId() == null) { // Throw NPE again ... @@ -181,7 +181,7 @@ public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements throw new IllegalArgumentException(MessageFormat.format("this.cellphoneProvider.providerId={0} is not valid.", this.getCellphoneProvider().getProviderId())); //NOI18N } else if (this.getPhoneNumber() == null) { // Not provided - this.showFacesMessage("form_edit_cellphone:cellphoneNumber", "No cell phone number selected"); //NOI18N + this.showFacesMessage("form_edit_cellphone:cellphoneNumber", "ERROR_ADMIN_EMPTY_MOBILE_NUMBER"); //NOI18N return ""; //NOI18N } diff --git a/src/java/org/mxchange/jjobs/beans/resendlink/JobsResendLinkWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/resendlink/JobsResendLinkWebSessionBean.java index 43073468..90a725d1 100644 --- a/src/java/org/mxchange/jjobs/beans/resendlink/JobsResendLinkWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/resendlink/JobsResendLinkWebSessionBean.java @@ -29,8 +29,6 @@ import org.mxchange.jjobs.beans.BaseJobsController; import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController; import org.mxchange.jjobs.beans.user.JobsUserWebSessionController; import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException; -import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; -import org.mxchange.jusercore.exceptions.UserStatusLockedException; import org.mxchange.jusercore.model.user.User; import org.mxchange.jusercore.model.user.status.UserAccountStatus; @@ -115,14 +113,14 @@ public class JobsResendLinkWebSessionBean extends BaseJobsController implements this.clear(); // Then abort here - this.showFacesMessage("form_resend_link:resendEmailAddress", new UserStatusConfirmedException(user)); //NOI18N + this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_STATUS_ALREADY_CONFIRMED"); //NOI18N return ""; //NOI18N } else if (user.getUserAccountStatus() == UserAccountStatus.LOCKED) { // Always clear bean this.clear(); // User account is locked - this.showFacesMessage("form_resend_link:resendEmailAddress", new UserStatusLockedException(user)); //NOI18N + this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_STATUS_LOCKED"); //NOI18N return ""; //NOI18N } else if (user.getUserConfirmKey() == null) { // Status is UNCONFIRMED but confirmation key is NULL diff --git a/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java index e9dc8646..ae3eafc4 100644 --- a/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java @@ -127,7 +127,7 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement throw new IllegalStateException("User tried to change password."); //NOI18N } else if (!UserUtils.ifPasswordMatches(this.getUserCurrentPassword(), this.userLoginController.getLoggedInUser())) { // Password mismatches - this.showFacesMessage("form_user_change_password:userCurrentPassword", "Entered current password does not matched stored password."); //NOI18N + this.showFacesMessage("form_user_change_password:userCurrentPassword", "ERROR_USER_CURRENT_PASSWORD_MISMATCHING"); //NOI18N // Clear bean this.clear(); @@ -136,7 +136,7 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement return ""; //NOI18N } else if (!Objects.equals(this.getUserPassword(), this.getUserPasswordRepeat())) { // Both entered passwords don't match - this.showFacesMessage("form_user_change_password:userPasswordRepeat", "Entered new passwords mismatch."); //NOI18N + this.showFacesMessage("form_user_change_password:userPasswordRepeat", "ERROR_USER_NEW_PASSWORDS_MISMATCH"); //NOI18N // Clear bean this.clear(); @@ -145,7 +145,7 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement return ""; //NOI18N } else if (Objects.equals(this.getUserCurrentPassword(), this.getUserPassword())) { // New password matches current - this.showFacesMessage("form_user_change_password:userPassword", "Entered new password is same as current password."); //NOI18N + this.showFacesMessage("form_user_change_password:userPassword", "ERROR_USER_NEW_PASSWORD_SAME_AS_CURRENT"); //NOI18N // Clear bean this.clear(); @@ -154,7 +154,7 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement return ""; //NOI18N } else if (this.userLoginController.isPasswordInHistory(this.getUserPassword())) { // Is already in list (to old passwords are ignored) - this.showFacesMessage("form_user_change_password:userPassword", "Entered new password is has already been used some time ago."); //NOI18N + this.showFacesMessage("form_user_change_password:userPassword", "ERROR_USER_NEW_PASSWORD_ALREADY_ENTERED"); //NOI18N // Clear bean this.clear(); diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index 17e8ad9c..2f7f09f9 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -203,7 +203,7 @@ LOGIN_ENTER_CURRENT_PASSWORD_CONFIRMATION_LEGEND_TITLE=Bitte geben Sie ihr derze LOGIN_ENTER_CURRENT_PASSWORD_CONFIRM=Derzeitiges Passwort: BUTTON_CHANGE_PERSONAL_DATA=Pers\u00f6nliche Daten \u00e4ndern LOGIN_CHANGE_PERSONAL_DATA_TITLE=Pers\u00f6nliche Daten \u00e4ndern: -ERROR_CURRENT_PASSWORD_MISMATCHING=Ihr eingegebenes Passwort entspricht nicht dem aktuell gespeicherten Passwort. +ERROR_USER_CURRENT_PASSWORD_MISMATCHING=Fehler: Ihr eingegebenes Passwort entspricht nicht dem aktuell gespeicherten Passwort. MESSAGE_BOX_TITLE=Hinweis: MESSAGE_BOX_PARAMETER_MESSAGE_EMPTY=Fehler: Parameter "message" nicht gesetzt. LOGIN_MESSAGE_DATA_SAVED=Daten wurden gespeichert. @@ -626,3 +626,14 @@ BUTTON_ADMIN_UNLINK_CONTACT_CELLPHONE=Mobilfunknummer vom Kontakt abtrennen ADMIN_LOCK_USER_TITLE=Wollen Sie diesen Benutzer wirklich sperren? ERROR_ADMIN_CANNOT_UNLOCK_USER_ACCOUNT_UNLOCKED=Kann den Benutzer {0} ({1}) nicht entsperren, da er bereits entsperrt ist. ERROR_ADMIN_CANNOT_LOCK_USER_ACCOUNT_LOCKED=Kann den Benutzer {0} ({1}) nicht sperren, da er bereits gesperrt ist. +ERROR_ADMIN_MOBILE_PROVIDER_ALREADY_ADDED=Fehler: Mobilfunkanbieter existiert bereits +ERROR_ADMIN_NO_MOBILE_PROVIDER_SELECTED=Fehler: Kein Mobilfunkanbieter ausgew\u00e4hlt. +ERROR_ADMIN_EMPTY_MOBILE_NUMBER=Fehler: Keine Mobilfunknummer eingegeben. +ERROR_USER_STATUS_ALREADY_CONFIRMED=Sie haben bereits Ihren Benutzeraccount best\u00e4tigt und k\u00f6nnen diesen ab sofort benutzen. +ERROR_USER_STATUS_LOCKED=Ihr Benutzeraccount wurde gesperrt. Bitte melden Sie sich beim Webmaster. +ERROR_USER_NEW_PASSWORDS_MISMATCH=Ihre eingebenen Passw\u00f6rter (Wiederholung) stimmen nicht \u00fcberein. +ERROR_USER_NEW_PASSWORD_SAME_AS_CURRENT=Das eingegebene neue Passwort muss sich von Ihrem aktuellen Passwort unterscheiden. +ERROR_USER_NEW_PASSWORD_ALREADY_ENTERED=Sie hatten vor kurzem das Passwort bereits eingegeben. +ERROR_USER_NOT_FOUND=Benutzeraccount nicht gefunden. +ERROR_USER_STATUS_UNCONFIRMED=Sie haben noch nicht Ihren Benutzeraccount best\u00e4tigt. +ERROR_USER_PASSWORD_MISMATCH=Ihr eingegebenes Passwort ist falsch. diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 8adbf5c6..6723b59b 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -205,7 +205,7 @@ LOGIN_ENTER_CURRENT_PASSWORD_CONFIRMATION_LEGEND_TITLE=Please enter your current LOGIN_ENTER_CURRENT_PASSWORD_CONFIRM=Current password: BUTTON_CHANGE_PERSONAL_DATA=Change personal data LOGIN_CHANGE_PERSONAL_DATA_TITLE=Change personal data: -ERROR_CURRENT_PASSWORD_MISMATCHING=Your entered password doesn't match the currently stored one. +ERROR_USER_CURRENT_PASSWORD_MISMATCHING=Error: Your entered password doesn't match the currently stored one. MESSAGE_BOX_TITLE=Notice: MESSAGE_BOX_PARAMETER_MESSAGE_EMPTY=Error: Parameter "message" not set. LOGIN_MESSAGE_DATA_SAVED=Data has been saved. @@ -626,3 +626,14 @@ BUTTON_ADMIN_UNLINK_CONTACT_CELLPHONE=Unlink cell phone number from contact ADMIN_LOCK_USER_TITLE=Do You really want to lock this user? ERROR_ADMIN_CANNOT_UNLOCK_USER_ACCOUNT_UNLOCKED=Cannot unlock user {0} ({1}) because he is already unlocked. ERROR_ADMIN_CANNOT_LOCK_USER_ACCOUNT_LOCKED=Cannot lock user {0} ({1}) because he is already locked. +ERROR_ADMIN_MOBILE_PROVIDER_ALREADY_ADDED=Error: Mobile provider does already exist. +ERROR_ADMIN_NO_MOBILE_PROVIDER_SELECTED=Error: No mobile provider selected. +ERROR_ADMIN_EMPTY_MOBILE_NUMBER=Error: No mobile phone number provided. +ERROR_USER_STATUS_ALREADY_CONFIRMED=You have already confirmed your user account and use it right away. +ERROR_USER_STATUS_LOCKED=Your user account has been locked. Please contact the webmaster. +ERROR_USER_NEW_PASSWORDS_MISMATCH=Your entered passwords (repeated) does not match. +ERROR_USER_NEW_PASSWORD_SAME_AS_CURRENT=Your entered password must be different to your current password. +ERROR_USER_NEW_PASSWORD_ALREADY_ENTERED=You have already entered this password some time ago. +ERROR_USER_NOT_FOUND=User account not found. +ERROR_USER_STATUS_UNCONFIRMED=You have not yet confirmed your user account. +ERROR_USER_PASSWORD_MISMATCH=You have entered a wrong password. diff --git a/web/WEB-INF/templates/guest/guest_email_address_repeat_fields.tpl b/web/WEB-INF/templates/guest/guest_email_address_repeat_fields.tpl index 357f9157..7a2df755 100644 --- a/web/WEB-INF/templates/guest/guest_email_address_repeat_fields.tpl +++ b/web/WEB-INF/templates/guest/guest_email_address_repeat_fields.tpl @@ -7,12 +7,12 @@ >

-
+
-
- +
+
@@ -21,12 +21,12 @@
-
+
-
- +
+
diff --git a/web/WEB-INF/templates/login/user/user_enter_current_password.tpl b/web/WEB-INF/templates/login/user/user_enter_current_password.tpl index 5fe12055..5d499c2a 100644 --- a/web/WEB-INF/templates/login/user/user_enter_current_password.tpl +++ b/web/WEB-INF/templates/login/user/user_enter_current_password.tpl @@ -17,9 +17,8 @@
- - - + +