Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Maxime Besson
lemonldap-ng
Commits
ef4f1fb0
Commit
ef4f1fb0
authored
Mar 07, 2019
by
Christophe Maudoux
🐛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test submitted user param (#1667)
parent
a9fbec3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm
...ap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm
+6
-3
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/Impersonation.pm
...g-portal/lib/Lemonldap/NG/Portal/Plugins/Impersonation.pm
+8
-7
No files found.
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CheckUser.pm
View file @
ef4f1fb0
...
...
@@ -76,8 +76,10 @@ sub check {
# Use submitted attribute if exists
my
$url
=
$req
->
param
('
url
')
||
'';
unless
(
$req
->
param
('
user
')
=~
/$self->{conf}->{userControl}/o
)
{
return
PE_MALFORMEDUSER
;
if
(
$req
->
param
('
user
')
)
{
unless
(
$req
->
param
('
user
')
=~
/$self->{conf}->{userControl}/o
)
{
return
PE_MALFORMEDUSER
;
}
}
if
(
$req
->
param
('
user
')
eq
$req
->
{
user
}
or
!
$req
->
param
('
user
')
)
{
...
...
@@ -89,7 +91,8 @@ sub check {
else
{
$self
->
logger
->
debug
("
Check requested for
$req
->{user}
");
$req
->
{
user
}
=
$req
->
param
('
user
');
$self
->
userLogger
->
notice
("
Retrieve session from userDB and compute Groups & Macros
");
$self
->
userLogger
->
notice
(
"
Retrieve session from userDB and compute Groups & Macros
");
$attrs
=
$self
->
_userDatas
(
$req
);
}
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/Impersonation.pm
View file @
ef4f1fb0
...
...
@@ -43,9 +43,10 @@ sub init {
sub
run
{
my
(
$self
,
$req
)
=
@_
;
unless
(
$req
->
param
('
spoofId
')
=~
/$self->{conf}->{userControl}/o
)
{
return
PE_MALFORMEDUSER
;
if
(
$req
->
param
('
spoofId
')
)
{
unless
(
$req
->
param
('
spoofId
')
=~
/$self->{conf}->{userControl}/o
)
{
return
PE_MALFORMEDUSER
;
}
}
my
$spoofId
=
$req
->
param
('
spoofId
')
||
'';
...
...
@@ -86,11 +87,11 @@ sub run {
my
$sphg
=
"
$self
->{conf}->{impersonationPrefix}hGroups
";
my
$separator
=
$self
->
{
conf
}
->
{
multiValuesSeparator
};
$realSession
->
{
$spg
}
||=
'';
$self
->
logger
->
debug
("
Processing groups...
");
my
@spoofGrps
=
my
@realGrps
=
();
@spoofGrps
=
split
/\Q$separator/
,
$spoofSession
->
{
groups
};
@realGrps
=
split
/\Q$separator/
,
$realSession
->
{
$spg
};
@realGrps
=
split
/\Q$separator/
,
$realSession
->
{
$spg
};
@spoofGrps
=
(
@spoofGrps
,
@realGrps
);
my
%hash
=
map
{
$_
,
1
}
@spoofGrps
;
$spoofSession
->
{
groups
}
=
join
$separator
,
sort
keys
%hash
;
...
...
@@ -98,8 +99,8 @@ sub run {
$self
->
logger
->
debug
("
Processing hGroups...
");
$spoofSession
->
{
hGroups
}
||=
{};
$realSession
->
{
$sphg
}
||=
{};
$spoofSession
->
{
hGroups
}
=
{
%
{
$spoofSession
->
{
hGroups
}
},
%
{
$realSession
->
{
$sphg
}
}
};
$spoofSession
->
{
hGroups
}
=
{
%
{
$spoofSession
->
{
hGroups
}
},
%
{
$realSession
->
{
$sphg
}
}
};
}
# Create spoofed session
...
...
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