Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Xavier Bachelot
lemonldap-ng
Commits
6cc554ac
Commit
6cc554ac
authored
Apr 10, 2017
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimization (#595)
parent
3db9bec5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
36 deletions
+10
-36
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm
+1
-34
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm
+8
-1
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/MailReset.pm
...ap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/MailReset.pm
+1
-1
No files found.
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm
View file @
6cc554ac
...
...
@@ -341,25 +341,12 @@ sub display {
}
## Common template params
my
$skin
=
$self
->
getSkin
(
$req
);
my
$portalPath
=
$self
->
conf
->
{
portal
};
$portalPath
=~
s#^https?://[^/]+/?#/#
;
$portalPath
=~
s#[^/]+\.fcgi$##
;
# Additional $req param
%templateParams
=
(
%templateParams
,
SKIN_PATH
=>
$portalPath
.
"
skins
",
ANTIFRAME
=>
$self
->
conf
->
{
portalAntiFrame
},
SKIN_BG
=>
$self
->
conf
->
{
portalSkinBackground
},
%
{
$self
->
customParameters
},
%
{
$req
->
{
customParameters
}
//
{}
},
);
## Custom template params
if
(
my
$customParams
=
$self
->
getCustomTemplateParameters
()
)
{
%templateParams
=
(
%templateParams
,
%$customParams
);
}
$self
->
logger
->
debug
("
Skin returned:
$skinfile
");
return
(
$skinfile
,
\
%templateParams
);
}
...
...
@@ -438,26 +425,6 @@ sub getSkin {
return
$skin
;
}
# Find custom templates parameters
# @return Custom parameters
sub
getCustomTemplateParameters
{
my
(
$self
)
=
@_
;
my
$conf
=
$self
->
conf
;
my
$customTplParams
=
{};
foreach
(
keys
%$conf
)
{
next
unless
(
$_
=~
/^tpl_(.+)$/
);
my
$tplParam
=
$
1
;
my
$tplValue
=
$conf
->
{
$_
};
$self
->
logger
->
debug
(
"
Set custom template parameter
$tplParam
with
$tplValue
");
$customTplParams
->
{
$tplParam
}
=
$tplValue
;
}
return
$customTplParams
;
}
# Build an HTML array to display sessions
# @param $sessions Array ref of hash ref containing sessions datas
# @param $title Title of the array
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm
View file @
6cc554ac
...
...
@@ -571,7 +571,7 @@ sub setHiddenFormValue {
$base64
=
1
unless
defined
$base64
;
# Store value
if
(
$val
or
!
(
$val
&
~
$val
)
)
{
if
(
$val
or
!
(
$val
&
~
$val
)
)
{
$key
=
$prefix
.
$key
;
$val
=~
s/\+/%2B/g
;
$req
->
{
portalHiddenFormValues
}
->
{
$key
}
=
$val
;
...
...
@@ -764,9 +764,16 @@ sub rebuildCookies {
}
sub
tplParams
{
my
$portalPath
=
$_
[
0
]
->
conf
->
{
portal
};
$portalPath
=~
s#^https?://[^/]+/?#/#
;
$portalPath
=~
s#[^/]+\.fcgi$##
;
return
(
SKIN
=>
$_
[
0
]
->
getSkin
(
$_
[
1
]
),
PORTAL_URL
=>
$_
[
0
]
->
conf
->
{
portal
},
SKIN_PATH
=>
$portalPath
.
"
skins
",
ANTIFRAME
=>
$_
[
0
]
->
conf
->
{
portalAntiFrame
},
SKIN_BG
=>
$_
[
0
]
->
conf
->
{
portalSkinBackground
},
(
$_
[
0
]
->
customParameters
?
(
%
{
$_
[
0
]
->
customParameters
}
)
:
()
),
);
}
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/MailReset.pm
View file @
6cc554ac
...
...
@@ -554,7 +554,7 @@ sub display {
}
# Custom template parameters
if
(
my
$customParams
=
$self
->
p
->
getC
ustom
Template
Parameters
()
)
{
if
(
my
$customParams
=
$self
->
p
->
c
ustomParameters
)
{
foreach
(
keys
%$customParams
)
{
$tplPrm
{
$_
}
=
$customParams
->
{
$_
};
}
...
...
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