Skip to content

Commit d5ed9a8

Browse files
committed
Extend validation result on disabeled
1 parent bd80a41 commit d5ed9a8

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

QueueIT.Security/src/queueit/security/CookieValidateResultRepository.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public class CookieValidateResultRepository extends ValidateResultRepositoryBase
1919
static String defaultCookieDomain;
2020
static int defaultCookieExpiration = 1200;
2121
static int defaultIdleExpiration = 180;
22-
static int defaultDisabledExpiration = 180;
2322

2423
static {
2524
loadConfiguration();
@@ -33,22 +32,19 @@ private static void loadConfiguration()
3332
defaultCookieDomain = props.getProperty("cookieDomain", null);
3433
defaultCookieExpiration = Integer.parseInt(props.getProperty("cookieExpiration", "1200"));
3534
defaultIdleExpiration = Integer.parseInt(props.getProperty("idleExpiration", "180"));
36-
defaultDisabledExpiration = Integer.parseInt(props.getProperty("disabledExpiration", "180"));
3735
} catch (Exception e) {
3836
// no need to handle exception
3937
}
4038
}
4139

42-
public static void configure(String cookieDomain, Integer cookieExpiration, Integer idleExpiration, Integer disabledExpiration)
40+
public static void configure(String cookieDomain, Integer cookieExpiration, Integer idleExpiration)
4341
{
4442
if (cookieDomain != null)
4543
defaultCookieDomain = cookieDomain;
4644
if (cookieExpiration != null)
4745
defaultCookieExpiration = cookieExpiration;
4846
if (idleExpiration != null)
4947
defaultIdleExpiration = idleExpiration;
50-
if (disabledExpiration != null)
51-
defaultDisabledExpiration = disabledExpiration;
5248
}
5349

5450
@Override
@@ -97,7 +93,7 @@ public IValidateResult getValidationResult(IQueue queue) {
9793
if (!expectedHash.equals(actualHash))
9894
return null;
9995

100-
if (redirectType != RedirectType.Disabled && redirectType != RedirectType.Idle)
96+
if (redirectType != RedirectType.Idle)
10197
setCookie(queue, queueId, originalUrl, placeInQueue, redirectType, timeStamp, actualHash, null);
10298

10399
return new AcceptedConfirmedResult(
@@ -155,8 +151,6 @@ private void setCookie(
155151

156152
if (expirationTime != null)
157153
expiration = (int)(expirationTime.getTime() - now.getTime());
158-
else if (redirectType == RedirectType.Disabled)
159-
expiration = defaultDisabledExpiration;
160154
else if (redirectType == RedirectType.Idle)
161155
expiration = defaultIdleExpiration;
162156
else

QueueIT.Security/src/queueit/security/SessionValidateResultRepository.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
public class SessionValidateResultRepository extends ValidateResultRepositoryBase {
99

1010
static int defaultIdleExpiration = 180;
11-
static int defaultDisabledExpiration = 180;
1211

1312
static {
1413
loadConfiguration();
@@ -20,18 +19,15 @@ private static void loadConfiguration()
2019
// Load the properties
2120
Properties props = QueueitProperties.getProperties("queueit.properties");
2221
defaultIdleExpiration = Integer.parseInt(props.getProperty("idleExpiration", "180"));
23-
defaultDisabledExpiration = Integer.parseInt(props.getProperty("disabledExpiration", "180"));
2422
} catch (Exception e) {
2523
// no need to handle exception
2624
}
2725
}
2826

29-
public static void configure(Integer idleExpiration, Integer disabledExpiration)
27+
public static void configure(Integer idleExpiration)
3028
{
3129
if (idleExpiration != null)
3230
defaultIdleExpiration = idleExpiration;
33-
if (disabledExpiration != null)
34-
defaultDisabledExpiration = disabledExpiration;
3531
}
3632
@Override
3733
public IValidateResult getValidationResult(IQueue queue) {
@@ -87,8 +83,6 @@ public void setValidationResult(IQueue queue, IValidateResult validationResult,
8783

8884
if (expirationTime != null)
8985
model.Expiration = expirationTime;
90-
else if (confirmedResult.getKnownUser().getRedirectType() == RedirectType.Disabled)
91-
model.Expiration = new Date(System.currentTimeMillis()+(defaultDisabledExpiration*1000));
9286
else if (confirmedResult.getKnownUser().getRedirectType() == RedirectType.Idle)
9387
model.Expiration = new Date(System.currentTimeMillis()+(defaultIdleExpiration*1000));
9488

0 commit comments

Comments
 (0)