openmeetings-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From solo...@apache.org
Subject svn commit: r1672254 - in /openmeetings: branches/3.0.x/src/db/java/org/apache/openmeetings/db/dao/user/UserDao.java trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java
Date Thu, 09 Apr 2015 07:47:18 GMT
Author: solomax
Date: Thu Apr  9 07:47:17 2015
New Revision: 1672254

URL: http://svn.apache.org/r1672254
Log:
[OPENMEETINGS-1196] check login/email are fixed

Modified:
    openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dao/user/UserDao.java
    openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java

Modified: openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dao/user/UserDao.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dao/user/UserDao.java?rev=1672254&r1=1672253&r2=1672254&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dao/user/UserDao.java
(original)
+++ openmeetings/branches/3.0.x/src/db/java/org/apache/openmeetings/db/dao/user/UserDao.java
Thu Apr  9 07:47:17 2015
@@ -332,8 +332,13 @@ public class UserDao implements IDataPro
 	 * @return
 	 */
 	public boolean checkLogin(String login, Type type, Long domainId, Long id) {
-		User u = getByLogin(login, type, domainId);
-		return u == null || u.getUser_id().equals(id);
+		try {
+			User u = getByLogin(login, type, domainId);
+			return u == null || u.getUser_id().equals(id);
+		} catch (Exception e) {
+			//exception is thrown in case of non-unique result
+			return false;
+		}
 	}
 
 	/**
@@ -347,8 +352,13 @@ public class UserDao implements IDataPro
 	 */
 	public boolean checkEmail(String email, Type type, Long domainId, Long id) {
 		log.debug("checkEmail: email = {}, id = {}", email, id);
-		User u = getByEmail(email, type, domainId);
-		return u == null || u.getUser_id().equals(id);
+		try {
+			User u = getByEmail(email, type, domainId);
+			return u == null || u.getUser_id().equals(id);
+		} catch (Exception e) {
+			//exception is thrown in case of non-unique result
+			return false;
+		}
 	}
 	
 	public boolean validLogin(String login) {

Modified: openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java?rev=1672254&r1=1672253&r2=1672254&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java
(original)
+++ openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/user/UserDao.java
Thu Apr  9 07:47:17 2015
@@ -332,8 +332,13 @@ public class UserDao implements IDataPro
 	 * @return
 	 */
 	public boolean checkLogin(String login, Type type, Long domainId, Long id) {
-		User u = getByLogin(login, type, domainId);
-		return u == null || u.getId().equals(id);
+		try {
+			User u = getByLogin(login, type, domainId);
+			return u == null || u.getId().equals(id);
+		} catch (Exception e) {
+			//exception is thrown in case of non-unique result
+			return false;
+		}
 	}
 
 	/**
@@ -347,9 +352,14 @@ public class UserDao implements IDataPro
 	 */
 	public boolean checkEmail(String email, Type type, Long domainId, Long id) {
 		log.debug("checkEmail: email = {}, id = {}", email, id);
-		User u = getByEmail(email, type, domainId);
-		return u == null || u.getId().equals(id);
+		try {
+			User u = getByEmail(email, type, domainId);
+			return u == null || u.getId().equals(id);
+		} catch (Exception e) {
+			//exception is thrown in case of non-unique result
+			return false;
 		}
+	}
 
 	public boolean validLogin(String login) {
 		return !Strings.isEmpty(login) && login.length() >= UserHelper.getMinLoginLength(cfgDao);



Mime
View raw message