Revision 35:0a3d57a67e7e

View differences:

src/main/java/my/com/upass/ConfigBean.java
15 15

  
16 16
/**
17 17
 * @author penril
18
 *
18
 * 
19 19
 */
20 20
public class ConfigBean {
21
	//password controller
22
	int passwordMaxTryError = 3; //maximum allowable password error encountered per user
23
	int passwordMaxReuse = 6; //number of password non repeatable 
24
	int passwordExpiry = 0; //zero mean never expire, value is in number of day
25
	String passwordValidPattern = "(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+<>?]).{8,}";
26
	String userNameValidPattern = "^[a-zA-Z0-9_-]{6,16}$";
27
	int userDormantPeriod = 0; //zero mean never dormant, value is in number of days
21
	// password controller
22
	int passwordMaxTryError = 3; // maximum allowable password error encountered per user
23
	int passwordMaxReuse = 6; // number of password non repeatable
24
	int passwordExpiry = 0; // zero mean never expire, value is in number of day
25
	// String passwordValidPattern = "(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+<>?]).{8,}";
26
	String passwordValidPattern = "(?=.*[0-9])(?=.*[a-zA-Z]).{8,12}";
27
	// String userNameValidPattern = "^[a-zA-Z0-9_-]{6,16}$";
28
	String userNameValidPattern = "^[a-zA-Z0-9\\._-]{6,16}$";
29
	int userDormantPeriod = 0; // zero mean never dormant, value is in number of days
28 30
	int passwordMinLength = 0;
29 31
	int notifAlert = 0;
30
	int changePasswordInterval = 0;
31
	String passwordAcceptPattern= "^[a-zA-Z0-9!@#$%^&*()_+<>?]{0,}$";
32
	int changePasswordInterval = 14400;
33
	String passwordAcceptPattern = "^[a-zA-Z0-9]{0,}$";
32 34
	int autoLogoff = 0;
33 35
	int userDeactivatePeriod = 0;
34 36
	int singleSingon = 0;
35
	int passwordComplexity= 0;
37
	int passwordComplexity = 0;
36 38
	int passwordComplexityLowerAlpha = 0;
37 39
	int passwordComplexityNumeric = 0;
38
	int passwordComplexitySymbol=0;
39
	int passwordComplexityUpperAlpha=0;
40
	
41
	
40
	int passwordComplexitySymbol = 0;
41
	int passwordComplexityUpperAlpha = 0;
42

  
42 43
	static String PASSWORD_MAX_ERROR = "PASSWORD_MAX_ERROR";
43 44
	static String PASSWORD_GENERATION = "PASSWORD_GENERATION";
44 45
	static String PASSWORD_EXPIRY_DAY = "PASSWORD_EXPIRY_DAY";
45 46
	static String PASSWORD_PATTERN = "PASSWORD_PATTERN";
46 47
	static String USERNAME_PATTERN = "USERNAME_PATTERN";
47 48
	static String USER_DORMANT_PERIOD = "USER_DORMANT_PERIOD";
48
	static String PASSWORD_MIN_LENGTH="PASSWORD_MIN_LENGTH";
49
	static String PASSWORD_MIN_LENGTH = "PASSWORD_MIN_LENGTH";
49 50
	static String NOTIF_ALERT = "NOTIF_ALERT";
50
	static String CHANGE_PASSWORD_INTERVAL="CHANGE_PASSWORD_INTERVAL";
51
	static String CHANGE_PASSWORD_INTERVAL = "CHANGE_PASSWORD_INTERVAL";
51 52
	static String PASSWORD_ACCEPT_PATTERN = "PASSWORD_ACCEPT_PATTERN";
52 53
	static String PASSWORD_COMPLEXITY = "PASSWORD_COMPLEXITY";
53 54
	static String PASSWORD_COMPLEXITY_LOWER_ALPHA = "PASSWORD_COMPLEXITY_LOWER_ALPHA";
54
	static String PASSWORD_COMPLEXITY_NUMERIC="PASSWORD_COMPLEXITY_NUMERIC";
55
	static String PASSWORD_COMPLEXITY_SYMBOL="PASSWORD_COMPLEXITY_SYMBOL";
56
	static String PASSWORD_COMPLEXITY_UPPER_ALPHA="PASSWORD_COMPLEXITY_UPPER_ALPHA";
55
	static String PASSWORD_COMPLEXITY_NUMERIC = "PASSWORD_COMPLEXITY_NUMERIC";
56
	static String PASSWORD_COMPLEXITY_SYMBOL = "PASSWORD_COMPLEXITY_SYMBOL";
57
	static String PASSWORD_COMPLEXITY_UPPER_ALPHA = "PASSWORD_COMPLEXITY_UPPER_ALPHA";
57 58
	static String AUTO_LOGOFF = "AUTO_LOGOFF";
58 59
	static String USER_DEACTIVATE_PERIOD = "USER_DEACTIVATE_PERIOD";
59 60
	static String SINGLE_SIGNON = "SINGLE_SIGNON";
60
	
61 61

  
62
	//TAC Controller
62
	// TAC Controller
63 63
	int TACMaxTryError = 3;
64 64
	int TACMaxUse = 3;
65
	int TACTTimeOut = 60000; //in minutes
66
	int TACRepeatTimeOut = 180; //in minutes
67
	int TACLifeSpanTimeOut = 3600; //in minutes
68
	
65
	int TACTTimeOut = 60000; // in minutes
66
	int TACRepeatTimeOut = 180; // in minutes
67
	int TACLifeSpanTimeOut = 3600; // in minutes
68

  
69 69
	static String TAC_TIME_OUT = "TAC_DEFAULT_TIMEOUT";
70 70
	static String TAC_MAX_ERROR = "TAC_MAX_ERROR";
71 71
	static String TAC_MAX_USE = "TAC_MAX_USE";
72 72
	static String TAC_LIFTSPAN_TIMEOUT = "TAC_LIFTSPAN_TIMEOUT";
73 73
	static String TAC_REPEAT_TIMEOUT = "TAC_REPEAT_TIMEOUT";
74
	
74

  
75 75
	private int SCTimeOut;
76 76
	private int SCMaxError;
77 77
	private int SCMaxUse;
78 78
	private int SCLifeSpanTimeOut;
79 79
	private int SCRepeatTimeOut;
80
	
80

  
81 81
	static String SC_TIME_OUT = "SC_TIME_OUT";
82 82
	static String SC_MAX_ERROR = "SC_MAX_ERROR";
83 83
	static String SC_MAX_USE = "SC_MAX_USE";
84 84
	static String SC_LIFTSPAN_TIMEOUT = "SC_LIFTSPAN_TIMEOUT";
85 85
	static String SC_REPEAT_TIMEOUT = "SC_REPEAT_TIMEOUT";
86
	
86

  
87 87
	public void setConfigBean(String paramName, String paramValue)
88 88
	{
89 89
		if (PASSWORD_MAX_ERROR.equalsIgnoreCase(paramName)) {
90 90
			this.setPasswordMaxTryError(Integer.parseInt(paramValue));
91
		} 
91
		}
92 92
		else if (PASSWORD_GENERATION.equalsIgnoreCase(paramName)) {
93 93
			this.setPasswordMaxReuse(Integer.parseInt(paramValue));
94
		} 
94
		}
95 95
		else if (PASSWORD_EXPIRY_DAY.equalsIgnoreCase(paramName)) {
96 96
			this.setPasswordExpiry(Integer.parseInt(paramValue));
97
		} 
97
		}
98 98
		else if (PASSWORD_PATTERN.equalsIgnoreCase(paramName)) {
99 99
			this.setPasswordValidPattern(paramValue);
100
		} 
100
		}
101 101
		else if (USERNAME_PATTERN.equalsIgnoreCase(paramName)) {
102 102
			this.setUserNameValidPattern(paramValue);
103
		}  
103
		}
104 104
		else if (USER_DORMANT_PERIOD.equalsIgnoreCase(paramName)) {
105 105
			this.setUserDormantPeriod(Integer.parseInt(paramValue));
106
		} 
106
		}
107 107
		else if (PASSWORD_MIN_LENGTH.equalsIgnoreCase(paramName)) {
108 108
			this.setPasswordMinLength(Integer.parseInt(paramValue));
109
		} 
110
		else if (NOTIF_ALERT.equalsIgnoreCase(paramName)){
109
		}
110
		else if (NOTIF_ALERT.equalsIgnoreCase(paramName)) {
111 111
			this.setNotifAlert(Integer.parseInt(paramValue));
112
		} 
113
		else if (CHANGE_PASSWORD_INTERVAL.equalsIgnoreCase(paramName)){
112
		}
113
		else if (CHANGE_PASSWORD_INTERVAL.equalsIgnoreCase(paramName)) {
114 114
			this.setChangePasswordInterval(Integer.parseInt(paramValue));
115
		} 
116
		else if (PASSWORD_ACCEPT_PATTERN.equalsIgnoreCase(paramName)){
115
		}
116
		else if (PASSWORD_ACCEPT_PATTERN.equalsIgnoreCase(paramName)) {
117 117
			this.setPasswordAcceptPattern(paramValue);
118
		} 
119
		else if (PASSWORD_COMPLEXITY.equalsIgnoreCase(paramName)){
118
		}
119
		else if (PASSWORD_COMPLEXITY.equalsIgnoreCase(paramName)) {
120 120
			this.setPasswordComplexity(Integer.parseInt(paramValue));
121 121
		}
122
		else if (PASSWORD_COMPLEXITY_LOWER_ALPHA.equalsIgnoreCase(paramName)){
122
		else if (PASSWORD_COMPLEXITY_LOWER_ALPHA.equalsIgnoreCase(paramName)) {
123 123
			this.setPasswordComplexityLowerAlpha(Integer.parseInt(paramValue));
124 124
		}
125
		else if (PASSWORD_COMPLEXITY_NUMERIC.equalsIgnoreCase(paramName)){
125
		else if (PASSWORD_COMPLEXITY_NUMERIC.equalsIgnoreCase(paramName)) {
126 126
			this.setPasswordComplexityNumeric(Integer.parseInt(paramValue));
127 127
		}
128
		else if (PASSWORD_COMPLEXITY_SYMBOL.equalsIgnoreCase(paramName)){
128
		else if (PASSWORD_COMPLEXITY_SYMBOL.equalsIgnoreCase(paramName)) {
129 129
			this.setPasswordComplexitySymbol(Integer.parseInt(paramValue));
130 130
		}
131
		else if (PASSWORD_COMPLEXITY_UPPER_ALPHA.equalsIgnoreCase(paramName)){
131
		else if (PASSWORD_COMPLEXITY_UPPER_ALPHA.equalsIgnoreCase(paramName)) {
132 132
			this.setPasswordComplexityUpperAlpha(Integer.parseInt(paramValue));
133 133
		}
134
		else if (AUTO_LOGOFF.equalsIgnoreCase(paramName)){
134
		else if (AUTO_LOGOFF.equalsIgnoreCase(paramName)) {
135 135
			this.setAutoLogoff(Integer.parseInt(paramValue));
136
		} 
137
		else if (USER_DEACTIVATE_PERIOD.equalsIgnoreCase(paramName)){
136
		}
137
		else if (USER_DEACTIVATE_PERIOD.equalsIgnoreCase(paramName)) {
138 138
			this.setUserDeactivatePeriod(Integer.parseInt(paramValue));
139 139
		}
140
		else if (SINGLE_SIGNON.equalsIgnoreCase(paramName)){
140
		else if (SINGLE_SIGNON.equalsIgnoreCase(paramName)) {
141 141
			this.setSingleSingon(Integer.parseInt(paramValue));
142 142
		}
143
		
143

  
144 144
		else if (TAC_TIME_OUT.equalsIgnoreCase(paramName)) {
145
			this.setTACTTimeOut (Integer.parseInt(paramValue));
146
		}  
145
			this.setTACTTimeOut(Integer.parseInt(paramValue));
146
		}
147 147
		else if (TAC_MAX_ERROR.equalsIgnoreCase(paramName)) {
148
			this.setTACMaxTryError (Integer.parseInt(paramValue));
149
		}  
148
			this.setTACMaxTryError(Integer.parseInt(paramValue));
149
		}
150 150
		else if (TAC_MAX_USE.equalsIgnoreCase(paramName)) {
151
			this.setTACMaxUse (Integer.parseInt(paramValue));
152
		}  
151
			this.setTACMaxUse(Integer.parseInt(paramValue));
152
		}
153 153
		else if (TAC_LIFTSPAN_TIMEOUT.equalsIgnoreCase(paramName)) {
154
			this.setTACLifeSpanTimeOut (Integer.parseInt(paramValue));
154
			this.setTACLifeSpanTimeOut(Integer.parseInt(paramValue));
155 155
		}
156 156
		else if (TAC_REPEAT_TIMEOUT.equalsIgnoreCase(paramName)) {
157
			this.setTACRepeatTimeOut (Integer.parseInt(paramValue));
157
			this.setTACRepeatTimeOut(Integer.parseInt(paramValue));
158 158
		}
159
		
159

  
160 160
		else if (SC_TIME_OUT.equalsIgnoreCase(paramName)) {
161
			this.setSCTimeOut (Integer.parseInt(paramValue));
162
		} 
161
			this.setSCTimeOut(Integer.parseInt(paramValue));
162
		}
163 163
		else if (SC_MAX_ERROR.equalsIgnoreCase(paramName)) {
164
			this.setSCMaxError (Integer.parseInt(paramValue));
165
		}  
164
			this.setSCMaxError(Integer.parseInt(paramValue));
165
		}
166 166
		else if (SC_MAX_USE.equalsIgnoreCase(paramName)) {
167
			this.setSCMaxUse (Integer.parseInt(paramValue));
168
		}  
167
			this.setSCMaxUse(Integer.parseInt(paramValue));
168
		}
169 169
		else if (SC_LIFTSPAN_TIMEOUT.equalsIgnoreCase(paramName)) {
170
			this.setSCLifeSpanTimeOut (Integer.parseInt(paramValue));
170
			this.setSCLifeSpanTimeOut(Integer.parseInt(paramValue));
171 171
		}
172 172
		else if (SC_REPEAT_TIMEOUT.equalsIgnoreCase(paramName)) {
173
			this.setSCRepeatTimeOut (Integer.parseInt(paramValue));
173
			this.setSCRepeatTimeOut(Integer.parseInt(paramValue));
174 174
		}
175 175
	}
176
	
177 176

  
178

  
179
	/*======================getter setter for TAC Controller=======================*/
177
	/* ======================getter setter for TAC Controller======================= */
180 178
	public int getTACMaxTryError() {
181 179
		return TACMaxTryError;
182 180
	}
183 181

  
184 182
	/**
185
	 * @param tACMaxTryError the tACMaxTryError to set
183
	 * @param tACMaxTryError
184
	 *            the tACMaxTryError to set
186 185
	 */
187 186
	public void setTACMaxTryError(int tACMaxTryError) {
188 187
		TACMaxTryError = tACMaxTryError;
......
193 192
	}
194 193

  
195 194
	/**
196
	 * @param setTACMaxUse the setTACMaxUse to set
195
	 * @param setTACMaxUse
196
	 *            the setTACMaxUse to set
197 197
	 */
198 198
	public void setTACMaxUse(int tACMaxUse) {
199 199
		TACMaxUse = tACMaxUse;
......
209 209

  
210 210
	/**
211 211
	 * 
212
	 * @param tacTTimeOut In minutes
212
	 * @param tacTTimeOut
213
	 *            In minutes
213 214
	 */
214 215
	public void setTACTTimeOut(int tacTTimeOut) {
215 216
		TACTTimeOut = tacTTimeOut;
......
225 226

  
226 227
	/**
227 228
	 * 
228
	 * @param tacRepeatTimeOut In minutes
229
	 * @param tacRepeatTimeOut
230
	 *            In minutes
229 231
	 */
230 232
	public void setTACRepeatTimeOut(int tacRepeatTimeOut) {
231 233
		TACRepeatTimeOut = tacRepeatTimeOut;
......
241 243

  
242 244
	/**
243 245
	 * 
244
	 * @param tacLifeSpanTimeOut In minutes
246
	 * @param tacLifeSpanTimeOut
247
	 *            In minutes
245 248
	 */
246 249
	public void setTACLifeSpanTimeOut(int tacLifeSpanTimeOut) {
247 250
		TACLifeSpanTimeOut = tacLifeSpanTimeOut;
248 251
	}
249
	
250
	
251
	/*======================getter setter for password Controller=======================*/
252

  
253
	/* ======================getter setter for password Controller======================= */
252 254
	public int getPasswordMaxTryError() {
253 255
		return passwordMaxTryError;
254 256
	}
255
	
257

  
256 258
	public void setPasswordMaxTryError(int maxError) {
257 259
		this.passwordMaxTryError = maxError;
258 260
	}
259
	
261

  
260 262
	public int getPasswordMaxReuse() {
261 263
		return passwordMaxReuse;
262 264
	}
263
	
265

  
264 266
	public void setPasswordMaxReuse(int mxPasswordReuse) {
265 267
		this.passwordMaxReuse = mxPasswordReuse;
266 268
	}
269

  
267 270
	/**
268 271
	 * 
269 272
	 * @return In number of day
......
271 274
	public int getPasswordExpiry() {
272 275
		return passwordExpiry;
273 276
	}
277

  
274 278
	/**
275 279
	 * 
276
	 * @param passwordExpiryInDay In number of day
280
	 * @param passwordExpiryInDay
281
	 *            In number of day
277 282
	 */
278 283
	public void setPasswordExpiry(int passwordExpiryInDay) {
279 284
		this.passwordExpiry = passwordExpiryInDay;
280 285
	}
286

  
281 287
	public String getPasswordValidPattern() {
282 288
		return passwordValidPattern;
283 289
	}
290

  
284 291
	public void setPasswordValidPattern(String passwordValidPattern) {
285
		//this will ensure that if the pattern is empty string, it is always set to null to represent no value is set
292
		// this will ensure that if the pattern is empty string, it is always set to null to represent no value is set
286 293
		if (StringUtils.isEmpty(passwordValidPattern)) {
287 294
			passwordValidPattern = null;
288 295
		}
289 296
		this.passwordValidPattern = passwordValidPattern;
290 297
	}
298

  
291 299
	public String getUserNameValidPattern() {
292 300
		return userNameValidPattern;
293 301
	}
302

  
294 303
	public void setUserNameValidPattern(String userNameValidPattern) {
295 304
		this.userNameValidPattern = userNameValidPattern;
296 305
	}
306

  
297 307
	/**
298 308
	 * 
299 309
	 * @return In number of days
......
301 311
	public int getUserDormantPeriod() {
302 312
		return userDormantPeriod;
303 313
	}
314

  
304 315
	/**
305 316
	 * 
306
	 * @param dormantPeriodInDay In number of day
317
	 * @param dormantPeriodInDay
318
	 *            In number of day
307 319
	 */
308 320
	public void setUserDormantPeriod(int dormantPeriodInDay) {
309 321
		this.userDormantPeriod = dormantPeriodInDay;
310 322
	}
311
	
312 323

  
313 324
	public int getPasswordMinLength() {
314 325
		return passwordMinLength;
......
322 333
		return notifAlert;
323 334
	}
324 335

  
325

  
326 336
	public void setNotifAlert(int notifAlert) {
327 337
		this.notifAlert = notifAlert;
328 338
	}
329 339

  
330
	
331 340
	public int getChangePasswordInterval() {
332 341
		return changePasswordInterval;
333 342
	}
334 343

  
335

  
336 344
	public void setChangePasswordInterval(int changePasswordInterval) {
337 345
		this.changePasswordInterval = changePasswordInterval;
338 346
	}
......
342 350
	}
343 351

  
344 352
	public void setPasswordAcceptPattern(String passwordAcceptPattern) {
345
		
346
		//this will ensure that if the pattern is empty string, it is always set to null to represent no value is set
353

  
354
		// this will ensure that if the pattern is empty string, it is always set to null to represent no value is set
347 355
		if (StringUtils.isEmpty(passwordAcceptPattern)) {
348 356
			passwordAcceptPattern = null;
349 357
		}
350
		
358

  
351 359
		this.passwordAcceptPattern = passwordAcceptPattern;
352 360
	}
353 361

  
......
390 398
	public void setPasswordComplexityUpperAlpha(int passwordComplexityUpperAlpha) {
391 399
		this.passwordComplexityUpperAlpha = passwordComplexityUpperAlpha;
392 400
	}
393
	
394 401

  
395
	/*======================getter setter for password Controller=======================*/
402
	/* ======================getter setter for password Controller======================= */
396 403

  
397 404
	public int getAutoLogoff() {
398 405
		return autoLogoff;
......
416 423

  
417 424
	public void setSingleSingon(int singleSingon) {
418 425
		this.singleSingon = singleSingon;
419
	}	
426
	}
420 427

  
421
	/*======================getter setter for SC Controller=======================*/
428
	/* ======================getter setter for SC Controller======================= */
422 429
	/**
423 430
	 * @return the sCTimeOut
424 431
	 */
425
	public int getSCTimeOut ()
432
	public int getSCTimeOut()
426 433
	{
427 434
		return SCTimeOut;
428 435
	}
429 436

  
430 437
	/**
431
	 * @param sCTimeOut the sCTimeOut to set
438
	 * @param sCTimeOut
439
	 *            the sCTimeOut to set
432 440
	 */
433
	public void setSCTimeOut (int sCTimeOut)
441
	public void setSCTimeOut(int sCTimeOut)
434 442
	{
435 443
		SCTimeOut = sCTimeOut;
436 444
	}
......
438 446
	/**
439 447
	 * @return the sCMaxError
440 448
	 */
441
	public int getSCMaxError ()
449
	public int getSCMaxError()
442 450
	{
443 451
		return SCMaxError;
444 452
	}
445 453

  
446 454
	/**
447
	 * @param sCMaxError the sCMaxError to set
455
	 * @param sCMaxError
456
	 *            the sCMaxError to set
448 457
	 */
449
	public void setSCMaxError (int sCMaxError)
458
	public void setSCMaxError(int sCMaxError)
450 459
	{
451 460
		SCMaxError = sCMaxError;
452 461
	}
......
454 463
	/**
455 464
	 * @return the sCMaxUser
456 465
	 */
457
	public int getSCMaxUse ()
466
	public int getSCMaxUse()
458 467
	{
459 468
		return SCMaxUse;
460 469
	}
461 470

  
462 471
	/**
463
	 * @param sCMaxUse the sCMaxUse to set
472
	 * @param sCMaxUse
473
	 *            the sCMaxUse to set
464 474
	 */
465
	public void setSCMaxUse (int sCMaxUse)
475
	public void setSCMaxUse(int sCMaxUse)
466 476
	{
467 477
		SCMaxUse = sCMaxUse;
468 478
	}
......
470 480
	/**
471 481
	 * @return the sCLifeSpanTimeOut
472 482
	 */
473
	public int getSCLifeSpanTimeOut ()
483
	public int getSCLifeSpanTimeOut()
474 484
	{
475 485
		return SCLifeSpanTimeOut;
476 486
	}
477 487

  
478 488
	/**
479
	 * @param sCLifeSpanTimeOut the sCLifeSpanTimeOut to set
489
	 * @param sCLifeSpanTimeOut
490
	 *            the sCLifeSpanTimeOut to set
480 491
	 */
481
	public void setSCLifeSpanTimeOut (int sCLifeSpanTimeOut)
492
	public void setSCLifeSpanTimeOut(int sCLifeSpanTimeOut)
482 493
	{
483 494
		SCLifeSpanTimeOut = sCLifeSpanTimeOut;
484 495
	}
......
486 497
	/**
487 498
	 * @return the sCRepeatTimeOut
488 499
	 */
489
	public int getSCRepeatTimeOut ()
500
	public int getSCRepeatTimeOut()
490 501
	{
491 502
		return SCRepeatTimeOut;
492 503
	}
493 504

  
494 505
	/**
495
	 * @param sCRepeatTimeOut the sCRepeatTimeOut to set
506
	 * @param sCRepeatTimeOut
507
	 *            the sCRepeatTimeOut to set
496 508
	 */
497
	public void setSCRepeatTimeOut (int sCRepeatTimeOut)
509
	public void setSCRepeatTimeOut(int sCRepeatTimeOut)
498 510
	{
499 511
		SCRepeatTimeOut = sCRepeatTimeOut;
500 512
	}
src/main/java/my/com/upass/MinimalConstants.java
3 3
import java.text.SimpleDateFormat;
4 4
import java.util.HashMap;
5 5

  
6
import my.com.upass.pojo.UserAppAccess;
7

  
6 8
public class MinimalConstants {
7 9

  
8 10
	public static final int ERR_SUCCESS = 0;
......
19 21
	public static final int ERR_PASSWD_WEAK = 96;
20 22
	public static final int ERR_REUSED_PASSWD = 3;
21 23
	public static final int PASSWD_NEVER_EXPIRE = 1;
24

  
22 25
	public static final int UTYPE_STATE_ROOT = 0;
23 26
	public static final int UTYPE_STATE_ADMIN = 1;
27
	/**
28
	 * user type 0 = root <br>
29
	 * user type 1 = upass admin (appId=0) <br>
30
	 * user type 2 = app admin / app user,
31
	 * depending on the {@link UserAppAccess#getAccessType()} in {@link UserAppAccess}
32
	 */
33
	public static final int UTYPE_STATE_USER = 2;
34

  
24 35
	public static final int ERR_INVALID_INPUT = 97;
25 36
	public static final int ERR_USERALIAS_NOT_FOUND = 6;
26 37
	public static final int ERR_TOKEN_NOT_ASSIGNED = 7;
27 38
	public static final int UID_STATE_ACTIVE = 0;
28 39
	public static final int UID_STATE_TMP_LOCKED = 1;
29 40
	public static final int ERR_APP_SERV_NOT_PERMITTED = 10;
30
	public static final int UTYPE_STATE_USER = 2;
31 41
	public static final int ERR_SYSTEM_NOT_READY = 98;
32 42
	public static final int ERR_ALREADY_EXIST = 11;
33 43
	/**
src/main/java/my/com/upass/spassword/PasswordController.java
50 50
	}
51 51

  
52 52
	public ConfigBean getConfigBean() {
53
		return (ConfigBean) configurationsMap.get(this.userBean.getApplicationId());
53
		return userBean.getUserType() != MinimalConstants.UTYPE_STATE_ADMIN ?
54
				new ConfigBean()
55
				: (ConfigBean) configurationsMap.get(new Integer(0));
54 56
	}
55 57

  
56 58
	public ConfigBean getConfigBean(Integer appId) {

Also available in: Unified diff