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
05b7eac4
Commit
05b7eac4
authored
Oct 09, 2014
by
Dave Cridland
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #79 from Redor/openfire
OF-754: Lock out user option works incorrectly in some cases
parents
5855e420
88caa4d1
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 @
05b7eac4
...
@@ -145,22 +145,8 @@ public class LockOutManager {
...
@@ -145,22 +145,8 @@ public class LockOutManager {
if
(
username
==
null
)
{
if
(
username
==
null
)
{
throw
new
UnsupportedOperationException
(
"Null username not allowed!"
);
throw
new
UnsupportedOperationException
(
"Null username not allowed!"
);
}
}
if
(
provider
.
shouldNotBeCached
())
{
LockOutFlag
lockOutFlag
=
getUserLockOut
(
username
);
return
provider
.
getDisabledStatus
(
username
);
return
getUnExpiredLockout
(
lockOutFlag
);
}
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
;
}
}
/**
/**
...
@@ -239,5 +225,50 @@ public class LockOutManager {
...
@@ -239,5 +225,50 @@ public class LockOutManager {
// Fire event.
// Fire event.
LockOutEventDispatcher
.
lockedAccountDenied
(
username
);
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