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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maxime Besson
lemonldap-ng
Commits
c535422a
Commit
c535422a
authored
May 23, 2016
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
customParameters for templates (#595)
parent
4cde65c8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm
+3
-1
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Init.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Init.pm
+11
-2
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Request.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Request.pm
+3
-0
No files found.
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm
View file @
c535422a
...
...
@@ -13,7 +13,9 @@ sub display {
my
(
$self
,
$req
)
=
@_
;
my
$skin_dir
=
$self
->
conf
->
{
templatesDir
};
my
(
$skinfile
,
%templateParams
);
my
$skinfile
;
my
%templateParams
=
(
%
{
$self
->
customParameters
},
%
{
$req
->
customParameters
}
);
# 0. Display error page
if
(
my
$http_error
=
$req
->
param
('
lmError
')
)
{
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Init.pm
View file @
c535422a
...
...
@@ -59,6 +59,9 @@ has beforeLogout => (
default
=>
sub
{
[]
}
);
# Custom template parameters
has
customParameters
=>
(
is
=>
'
rw
',
default
=>
sub
{
{}
}
);
sub
init
{
my
(
$self
,
$args
)
=
@_
;
$args
||=
{};
...
...
@@ -70,6 +73,11 @@ sub init {
%$args
}
);
foreach
my
$k
(
keys
$self
->
localConfig
)
{
if
(
$k
=~
/tpl_(.*)/
)
{
$self
->
customParameters
->
{
$
1
}
=
$self
->
localConfig
->
{
$k
};
}
}
Lemonldap::NG::Handler::Main::
Reload
->
onReload
(
$self
,
'
reloadConf
'
);
return
0
unless
(
$self
->
SUPER::
init
(
$args
)
);
return
0
if
(
$self
->
error
);
...
...
@@ -173,7 +181,7 @@ sub reloadConf {
if
(
my
$td
=
$self
->
conf
->
{
trustedDomains
}
)
{
$td
=~
s/^\s*(.*?)\s*/$1/
;
foreach
(
split
(
/\s+/
,
$td
)
)
{
next
unless
(
$td
);
next
unless
(
$td
);
s#^\.#([^/]+\.)?#
;
$self
->
lmLog
(
"
Domain
$_
added in trusted domains
",
'
debug
'
);
s/\./\\./g
;
...
...
@@ -183,7 +191,8 @@ sub reloadConf {
# - $domainlabel.$td
# $domainlabel is build looking RFC2396
# (see Regexp::Common::URI::RFC2396)
$_
=~
s/\*\\\./(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9]\\.)*/g
;
$_
=~
s/\*\\\./(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9]\\.)*/g
;
$re
->
add
("
$_
");
}
}
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Request.pm
View file @
c535422a
...
...
@@ -44,6 +44,9 @@ has respCookies => ( is => 'rw' );
# Template to display (if not defined, login or menu)
has
template
=>
(
is
=>
'
rw
'
);
# Custom template parameters
has
customParameters
=>
(
is
=>
'
rw
',
default
=>
sub
{
{}
}
);
# Boolean to indicate that response must be a redirection
has
mustRedirect
=>
(
is
=>
'
rw
'
);
...
...
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