Author: truong.le
Date: 2010-01-13 23:13:18 -0500 (Wed, 13 Jan 2010)
New Revision: 1274
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
Log:
GTNPORTAL-246: Error occur when changing an existing e-mail
Be sure it keeps old value
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2010-01-14
03:57:13 UTC (rev 1273)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2010-01-14
04:13:18 UTC (rev 1274)
@@ -105,6 +105,7 @@
UIApplication uiApp = context.getUIApplication();
String username = getUIStringInput(USERNAME).getValue();
User user = service.getUserHandler().findUserByName(username);
+ String oldEmail = user.getEmail();
if (user == null)
{
uiApp.addMessage(new
ApplicationMessage("UIAccountInputSet.msg.user-is-deleted", null));
@@ -138,9 +139,13 @@
//Check if mail address is already used
Query query = new Query();
- query.setEmail(getUIStringInput("email").getValue());
- if (service.getUserHandler().findUsers(query).getAll().size() > 0)
+ String email = getUIStringInput("email").getValue();
+ query.setEmail(email);
+ if (service.getUserHandler().findUsers(query).getAll().size() > 0 &&
!oldEmail.equals(email))
{
+ //Be sure it keep old value
+ user.setEmail(oldEmail);
+ query.setEmail(oldEmail);
Object[] args = {username};
uiApp.addMessage(new
ApplicationMessage("UIAccountInputSet.msg.email-exist", args));
return false;
@@ -169,5 +174,6 @@
((UIFormStringInput)password1.setValue(null)).setRendered(isChange);
((UIFormStringInput)password2.setValue(null)).setRendered(isChange);
}
+
}
Show replies by date