Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
lemonldap-ng
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
243
Issues
243
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LemonLDAP NG
lemonldap-ng
Commits
7a7751e5
Commit
7a7751e5
authored
Nov 25, 2020
by
Christophe Maudoux
🐛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code refactoring & typos (
#2334
)
parent
47151b60
Pipeline
#10080
passed with stage
in 19 minutes and 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
19 deletions
+22
-19
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/GlobalLogout.pm
...ng-portal/lib/Lemonldap/NG/Portal/Plugins/GlobalLogout.pm
+22
-19
No files found.
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/GlobalLogout.pm
View file @
7a7751e5
...
...
@@ -54,9 +54,9 @@ sub run {
my
(
$self
,
$req
)
=
@_
;
my
$user
=
$req
->
{
userData
}
->
{
$self
->
conf
->
{
whatToTrace
}
};
# Check activation rule
s
# Check activation rule
unless
(
$self
->
rule
->
(
$req
,
$req
->
userData
)
)
{
$self
->
userLogger
->
info
("
Globa
l logout not requir
ed for
$user
");
$self
->
userLogger
->
info
("
Globa
Logout not allow
ed for
$user
");
return
PE_OK
;
}
...
...
@@ -116,20 +116,22 @@ sub globalLogout {
# Read active sessions from token
my
$sessions
=
eval
{
from_json
(
$token
->
{
sessions
}
)
};
if
(
$@
)
{
$self
->
logger
->
error
("
Bad encoding in OTT: $@
");
$self
->
logger
->
error
(
"
GlobalLogout: bad encoding in OTT ($@)
");
$res
=
PE_ERROR
;
}
my
$as
;
foreach
(
@$sessions
)
{
unless
(
$as
=
$self
->
p
->
getApacheSession
(
$_
->
{
id
}
)
)
{
$self
->
userLogger
->
info
(
"
GlobalLogout: session
$_
->{id} expired
");
next
;
}
my
$user
=
$token
->
{
user
};
if
(
$req
->
{
userData
}
->
{
$self
->
{
conf
}
->
{
whatToTrace
}
}
eq
$user
)
{
my
$user
=
$token
->
{
user
};
my
$req_user
=
$req
->
{
userData
}
->
{
$self
->
{
conf
}
->
{
whatToTrace
}
};
if
(
$req_user
eq
$user
)
{
foreach
(
@$sessions
)
{
unless
(
$as
=
$self
->
p
->
getApacheSession
(
$_
->
{
id
}
)
)
{
$self
->
userLogger
->
info
(
"
GlobalLogout: session
$_
->{id} expired
");
next
;
}
unless
(
$req
->
{
userData
}
->
{
_session_id
}
eq
$_
->
{
id
}
)
{
$self
->
userLogger
->
info
(
"
Remove
\"
$user
\"
session:
$_
->{id}
");
...
...
@@ -137,11 +139,12 @@ sub globalLogout {
$count
++
;
}
}
else
{
$self
->
userLogger
->
warn
(
"
GlobalLogout called with an invalid token
");
$res
=
PE_TOKENEXPIRED
;
}
}
else
{
$self
->
userLogger
->
warn
(
"
GlobalLogout called with an invalid token:
$req_user
is NOT
$user
"
);
$res
=
PE_TOKENEXPIRED
;
}
}
else
{
...
...
@@ -157,7 +160,7 @@ sub globalLogout {
}
return
$self
->
p
->
do
(
$req
,
[
sub
{
$res
}
]
)
if
$res
;
$self
->
userLogger
->
info
("
$count
remaining session(s)
have been
removed
");
$self
->
userLogger
->
info
("
$count
remaining session(s) removed
");
return
$self
->
p
->
do
(
$req
,
[
'
authLogout
',
'
deleteSession
'
]
);
}
...
...
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