Revision 8:1982e43e6686

View differences:

src/my/com/upass/services/DisableTacService.java
47 47

  
48 48
		int rc = Constants.ERR_SYSTEM_NOT_READY;
49 49

  
50
		if (rc != Constants.ERR_SUCCESS) {
51
			return rc;
52
		}
53 50
		try {
54 51
			UserTacDAO tacDao = DAOFactoryProvider.getDAOFactory().getUserTacDAO();
55 52
			final Map<Integer, ConfigBean> configsMap = upc.getConfigurationsMap();
......
57 54

  
58 55
				TacBean tb = tacDao.getTacFromStore(userAlias, appId);
59 56
				if (tb == null) {
60
					return Constants.ERR_USERALIAS_NOT_FOUND;
57
					continue;
61 58
				}
62 59
				// reset TAC
63 60
				final ConfigBean config = configsMap.get(appId);
......
66 63
				tc.getUpdatedObject();
67 64

  
68 65
				if (tacDao.updateTacToStore(tb)) {
69
					rc = Constants.ERR_SUCCESS;
66
					return Constants.ERR_SUCCESS;
70 67

  
71 68
				} else {
72
					rc = Constants.ERR_UNKNOWN;
69
					return Constants.ERR_UNKNOWN;
73 70
				}
74 71
			}
72
			
73
			rc = Constants.ERR_USERALIAS_NOT_FOUND;
74
			
75 75
		} catch (Exception e) {
76 76
			e.printStackTrace();
77 77
		}
src/my/com/upass/services/ResetTacService.java
50 50
			UserTacDAO tacDao = DAOFactoryProvider.getDAOFactory().getUserTacDAO();
51 51

  
52 52
			final Map<Integer, ConfigBean> configsMap = upc.getConfigurationsMap();
53
			TacBean tb = null;
54 53
			for (Integer appId : configsMap.keySet()) {
55
				tb = tacDao.getTacFromStore(userAlias, appId);
56

  
54
				TacBean tb = tacDao.getTacFromStore(userAlias, appId);
57 55
				if (tb == null) {
58 56
					continue;
59 57
				}
......
62 60
				TacController tc = UPassFactory.getTacController(tb, configsMap.get(appId));
63 61
				tc.ResetTAC();
64 62
				tc.getUpdatedObject();
65

  
63
				
66 64
				if (tacDao.updateTacToStore(tb)) {
67
					rc = Constants.ERR_SUCCESS;
65
					return Constants.ERR_SUCCESS;
68 66

  
69 67
				} else {
70
					rc = Constants.ERR_UNKNOWN;
68
					return Constants.ERR_UNKNOWN;
71 69
				}
72 70
			}
73 71
			
74
			if(tb == null){
75
				rc = Constants.ERR_USERALIAS_NOT_FOUND;
76
			}
72
			rc = Constants.ERR_USERALIAS_NOT_FOUND;
77 73
			
78 74
		} catch (Exception e) {
79 75
			e.printStackTrace();

Also available in: Unified diff