Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
88caa4d1
Commit
88caa4d1
authored
Oct 09, 2014
by
Roman S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-754: Lock out user option works incorrectly in some cases
parent
1575642d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
16 deletions
+47
-16
LockOutManager.java
...ava/org/jivesoftware/openfire/lockout/LockOutManager.java
+47
-16
No files found.
src/java/org/jivesoftware/openfire/lockout/LockOutManager.java
View file @
88caa4d1
...
...
@@ -145,22 +145,8 @@ public class LockOutManager {
if
(
username
==
null
)
{
throw
new
UnsupportedOperationException
(
"Null username not allowed!"
);
}
if
(
provider
.
shouldNotBeCached
())
{
return
provider
.
getDisabledStatus
(
username
);
}
LockOutFlag
flag
=
lockOutCache
.
get
(
username
);
// If ID wan't found in cache, load it up and put it there.
if
(
flag
==
null
)
{
synchronized
(
username
.
intern
())
{
flag
=
lockOutCache
.
get
(
username
);
// If group wan't found in cache, load it up and put it there.
if
(
flag
==
null
)
{
flag
=
provider
.
getDisabledStatus
(
username
);
lockOutCache
.
put
(
username
,
flag
);
}
}
}
return
flag
;
LockOutFlag
lockOutFlag
=
getUserLockOut
(
username
);
return
getUnExpiredLockout
(
lockOutFlag
);
}
/**
...
...
@@ -239,5 +225,50 @@ public class LockOutManager {
// Fire event.
LockOutEventDispatcher
.
lockedAccountDenied
(
username
);
}
/**
* Gets the user lock out.
*
* @param username
* the username
* @return the user lock out
*/
private
LockOutFlag
getUserLockOut
(
String
username
)
{
if
(
provider
.
shouldNotBeCached
())
{
return
provider
.
getDisabledStatus
(
username
);
}
LockOutFlag
flag
=
lockOutCache
.
get
(
username
);
// If ID wan't found in cache, load it up and put it there.
if
(
flag
==
null
)
{
synchronized
(
username
.
intern
())
{
flag
=
lockOutCache
.
get
(
username
);
// If group wan't found in cache, load it up and put it there.
if
(
flag
==
null
)
{
flag
=
provider
.
getDisabledStatus
(
username
);
lockOutCache
.
put
(
username
,
flag
);
}
}
}
return
flag
;
}
/**
* Check if lockout flag is expired.
*
* @param flag
* the flag
*/
private
LockOutFlag
getUnExpiredLockout
(
LockOutFlag
flag
)
{
if
(
flag
!=
null
)
{
Date
curDate
=
new
Date
();
if
(
flag
.
getEndTime
()
!=
null
&&
curDate
.
after
(
flag
.
getEndTime
()))
{
// Remove expired lockout entry
lockOutCache
.
remove
(
flag
.
getUsername
());
provider
.
unsetDisabledStatus
(
flag
.
getUsername
());
return
null
;
}
}
return
flag
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment