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
LemonLDAP NG
lemonldap-ng
Commits
c912ab2d
Commit
c912ab2d
authored
Oct 09, 2010
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#5
is fixed: Now we have to set vhostHttps in manager
parent
de64f48d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
8 deletions
+56
-8
build/lemonldap-ng/Makefile
build/lemonldap-ng/Makefile
+2
-2
modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm
...s/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm
+6
-2
modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm
...es/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm
+48
-4
No files found.
build/lemonldap-ng/Makefile
View file @
c912ab2d
...
...
@@ -577,7 +577,7 @@ debian-diff:
@
$(DIFF)
lemonldap-ng-portal/example/cdc.pl
$(DIFFPREFIX)
/var/lib/lemonldap-ng/portal/cdc.pl
||
true
@
# Handler
@
$(DIFF)
lemonldap-ng-handler/lib/Lemonldap/NG/Handler
$(DIFFPREFIX)
/usr/share/perl5/Lemonldap/NG/Handler
||
true
@
$(DIFF)
lemonldap-ng-
portal
/example/scripts/purgeLocalCache
$(DIFFPREFIX)
/usr/share/lemonldap-ng/bin/purgeLocalCache
||
true
@
$(DIFF)
lemonldap-ng-
handler
/example/scripts/purgeLocalCache
$(DIFFPREFIX)
/usr/share/lemonldap-ng/bin/purgeLocalCache
||
true
@
# Common
@
$(DIFF)
lemonldap-ng-common/lib/Lemonldap/NG/Common
$(DIFFPREFIX)
/usr/share/perl5/Lemonldap/NG/Common
||
true
@
$(DIFF)
lemonldap-ng-common/lib/Lemonldap/NG/Common.pm
$(DIFFPREFIX)
/usr/share/perl5/Lemonldap/NG/Common.pm
||
true
...
...
@@ -607,7 +607,7 @@ default-diff:
@
$(DIFF)
lemonldap-ng-handler/example/MyHandler.pm
$(LMPREFIX)
/handler/MyHandler.pm
||
true
@
$(DIFF)
lemonldap-ng-handler/example/MyHandlerZimbra.pm
$(LMPREFIX)
/handler/MyHandlerZimbra.pm
||
true
@
$(DIFF)
lemonldap-ng-handler/example/MyHandlerSympa.pm
$(LMPREFIX)
/handler/MyHandlerSympa.pm
||
true
@
$(DIFF)
lemonldap-ng-
portal
/example/scripts/purgeLocalCache
$(LMPREFIX)
/bin/purgeLocalCache
||
true
@
$(DIFF)
lemonldap-ng-
handler
/example/scripts/purgeLocalCache
$(LMPREFIX)
/bin/purgeLocalCache
||
true
@
# Common
@
$(DIFF)
lemonldap-ng-common/lib/Lemonldap/NG/Common /usr/local/share/perl/5.10.0/Lemonldap/NG/Common
||
true
@
$(DIFF)
lemonldap-ng-common/lib/Lemonldap/NG/Common.pm /usr/local/share/perl/5.10.0/Lemonldap/NG/Common.pm
||
true
...
...
modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm
View file @
c912ab2d
...
...
@@ -956,11 +956,15 @@ sub hideCookie {
# Encode URl in the format used by Lemonldap::NG::Portal for redirections.
sub
encodeUrl
{
my
(
$class
,
$url
)
=
splice
@_
;
my
$u
=
$url
;
$url
=
$class
->
_buildUrl
(
$url
)
if
(
$url
!~
m#^https?://#
);
return
encode_base64
(
$u
,
''
);
$class
->
lmLog
(
$url
,
'
error
'
);
return
encode_base64
(
$url
,
''
);
}
## @method private string _buildUrl(string s)
# Transform /<s> into http(s?)://<host>:<port>/s
# @param $s path
# @return URL
sub
_buildUrl
{
my
(
$class
,
$s
)
=
splice
@_
;
my
$portString
=
$port
||
$apacheRequest
->
get_server_port
();
...
...
modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm
View file @
c912ab2d
...
...
@@ -13,7 +13,21 @@ use constant SAFEWRAP => ( Safe->can("wrap_code_ref") ? 1 : 0 );
our
$VERSION
=
'
0.55
';
## @cmethod void locationRulesInit(hashRef args)
## @imethod protected void defaultValuesInit(hashRef args)
# Set default values for non-customized variables
# @param $args reference to the configuration hash
sub
defaultValuesInit
{
my
(
$class
,
$args
)
=
splice
@_
;
$args
->
{
https
}
=
{
_
=>
$args
->
{
https
}
}
unless
(
ref
(
$args
->
{
https
}
)
);
if
(
$args
->
{
vhostHttps
}
)
{
while
(
my
(
$k
,
$v
)
=
each
(
%
{
$args
->
{
vhostHttps
}
}
)
)
{
$args
->
{
https
}
->
{
$k
}
=
$v
;
}
}
$class
->
Lemonldap::NG::Handler::Simple::
defaultValuesInit
(
$args
);
}
## @imethod void locationRulesInit(hashRef args)
# Compile rules.
# Rules are stored in $args->{locationRules}->{<virtualhost>} that contains
# regexp=>test expressions where :
...
...
@@ -56,7 +70,7 @@ sub locationRulesInit {
1
;
}
## @
c
method void forgeHeadersInit(hashRef args)
## @
i
method void forgeHeadersInit(hashRef args)
# Create the &$forgeHeaders->{<virtualhost>} subroutines used to insert
# headers into the HTTP request.
# @param $args reference to the configuration hash
...
...
@@ -90,7 +104,7 @@ sub forgeHeadersInit {
1
;
}
## @
c
method void sendHeaders()
## @
r
method void sendHeaders()
# Launch function compiled by forgeHeadersInit() for the current virtual host
sub
sendHeaders
{
my
$class
=
shift
;
...
...
@@ -117,7 +131,7 @@ sub isProtected {
return
$defaultProtection
->
{
$vhost
};
}
## @
c
method boolean grant()
## @
r
method boolean grant()
# Grant or refuse client using compiled regexp and functions
# @return True if the user is granted to access to the current URL
sub
grant
{
...
...
@@ -242,6 +256,36 @@ sub transformUri {
OK
;
}
## @cmethod private string _buildUrl(string s)
# Transform /<s> into http(s?)://<host>:<port>/s
# @param $s path
# @return URL
sub
_buildUrl
{
my
(
$class
,
$s
)
=
splice
@_
;
my
$portString
=
$port
||
$apacheRequest
->
get_server_port
();
my
$vhost
=
$apacheRequest
->
hostname
;
my
$_https
=
(
defined
(
$https
->
{
$vhost
}
)
?
$https
->
{
$vhost
}
:
$https
->
{
_
}
);
$portString
=
(
$_https
&&
$portString
==
443
)
?
''
:
(
!
$_https
&&
$portString
==
80
)
?
''
:
'
:
'
.
$portString
;
$class
->
lmLog
(
"
http
"
.
(
$_https
?
"
s
"
:
""
)
.
"
://
"
.
$apacheRequest
->
get_server_name
()
.
$portString
.
$s
,
'
error
'
);
return
"
http
"
.
(
$_https
?
"
s
"
:
""
)
.
"
://
"
.
$apacheRequest
->
get_server_name
()
.
$portString
.
$s
;
}
1
;
__END__
...
...
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