Revision 28:32549c466237

View differences:

src/main/java/my/com/upass/dao/hibernate/UserDAOHibernate.java
349 349
			Query query = session.createQuery(
350 350
					"FROM UserAppAccess aa "
351 351
							+ "WHERE aa.user.userAlias = :userAlias "
352
							+ "AND aa.accessType = :type");
352
							+ "AND aa.accessType = :accessType");
353 353

  
354 354
			accesses = query
355 355
					.setString("userAlias", appAccessId)
src/main/java/my/com/upass/maybank/MinimalMaybankFacadeImpl.java
3 3
import my.com.upass.MinimalConstants;
4 4
import my.com.upass.MinimalUPassControllerV2;
5 5
import my.com.upass.maybank.entities.M2uUser;
6
import my.com.upass.pojo.MinimalUserBean;
6 7
import net.penril.generic.hibernate.GenericDAOHibernate;
7 8
import net.penril.generic.hibernate.HibernateUtils;
8 9

  
9 10
import org.apache.commons.lang.NotImplementedException;
11
import org.apache.log4j.Logger;
10 12
import org.hibernate.Session;
11 13

  
12 14
public class MinimalMaybankFacadeImpl implements MinimalMaybankFacade {
13 15

  
16
	private static final Logger LOGGER = Logger.getLogger(MinimalMaybankFacadeImpl.class);
17

  
14 18
	private final MinimalUPassControllerV2 minUpcV2;
15 19

  
20
	//
21

  
16 22
	public MinimalMaybankFacadeImpl() {
17 23
		minUpcV2 = new MinimalUPassControllerV2();
18 24
	}
......
36 42
			session = HibernateUtils.currentSession();
37 43
			session.beginTransaction();
38 44

  
45
			MinimalUserBean minUser = new MinimalUserBean();
46
			minUser.setUsername(username);
47
			minUser.setHashedPassword(hashedPassword);
48

  
39 49
			M2uUser m2uUser = new M2uUser();
40
			m2uUser.getMinUser().setUsername(username);
41
			m2uUser.getMinUser().setHashedPassword(hashedPassword);
50
			m2uUser.setMinUser(minUser);
42 51
			m2uUser.setPan1(pan1);
43 52
			m2uUser.setPan2(pan2);
44
			
45
			rc = minUpcV2.addUser(appAccessId, hashedSecretKey, m2uUser.getMinUser(), session);
46
			
53

  
54
			rc = minUpcV2.addUser(appAccessId, hashedSecretKey, minUser, session);
55

  
47 56
			if (rc == MinimalConstants.ERR_SUCCESS) {
48 57
				rc = minUpcV2.updateProfileShallowly(appAccessId, hashedSecretKey, m2uUser, session);
49 58
				session.getTransaction().commit();
......
53 62

  
54 63
		} catch (Exception e) {
55 64
			GenericDAOHibernate.rollbackTransactionIfAny(session);
65
			LOGGER.error(e, e);
56 66

  
57 67
		} finally {
58 68
			GenericDAOHibernate.closeSessionIfAny(session);
src/main/java/my/com/upass/spassword/PasswordController.java
294 294
	public boolean ValidatePasswordPattern(String password)
295 295
	{
296 296
		// if acceptable characters are defined, then check does password contain unacceptable characters
297
		if (StringUtils.isEmpty(getConfigBean().getPasswordAcceptPattern())) {
297
		if (StringUtils.isNotEmpty(getConfigBean().getPasswordAcceptPattern())) {
298 298
			if (!patternValidator(password, getConfigBean().getPasswordAcceptPattern())) {
299 299
				return false;
300 300
			}
301
			return true;
301
//			return true;
302 302
		}
303

  
304 303
		return patternValidator(password, getConfigBean().getPasswordValidPattern());
305 304
	}
306 305

  
......
607 606
		// System.out.println(cipherText1);
608 607
		// System.out.println("------------");
609 608
		System.out.println(cipherText256);
609
		System.out.println("-----");
610
		System.out.println(pass.SHA256("ibuser1", "Passw0rd"));
611
		System.out.println(pass.SHA256("ibuser2", "Passw0rd"));
612
		System.out.println(pass.SHA256("ibuser3", "Passw0rd"));
613
		System.out.println(pass.SHA256("ibuser4", "Passw0rd"));
614
		System.out.println(pass.SHA256("ibuser5", "Passw0rd"));
610 615
	}
611 616

  
612 617
}

Also available in: Unified diff