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
9fafa1d8
Commit
9fafa1d8
authored
Feb 20, 2019
by
Christophe Maudoux
🐛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Override msg with local json files (
#1595
)
parent
53eb78c5
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
33 additions
and
19 deletions
+33
-19
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm
+16
-2
lemonldap-ng-portal/site/templates/bootstrap/error.json
lemonldap-ng-portal/site/templates/bootstrap/error.json
+0
-5
lemonldap-ng-portal/site/templates/bootstrap/error.json.example
...dap-ng-portal/site/templates/bootstrap/error.json.example
+3
-0
lemonldap-ng-portal/site/templates/bootstrap/error.tpl
lemonldap-ng-portal/site/templates/bootstrap/error.tpl
+0
-1
lemonldap-ng-portal/site/templates/bootstrap/header.tpl
lemonldap-ng-portal/site/templates/bootstrap/header.tpl
+1
-0
lemonldap-ng-portal/site/templates/bootstrap/login.json
lemonldap-ng-portal/site/templates/bootstrap/login.json
+3
-5
lemonldap-ng-portal/site/templates/bootstrap/login.tpl
lemonldap-ng-portal/site/templates/bootstrap/login.tpl
+0
-1
lemonldap-ng-portal/site/templates/common/trover.tpl
lemonldap-ng-portal/site/templates/common/trover.tpl
+5
-0
lemonldap-ng-portal/t/02-Password-Demo.t
lemonldap-ng-portal/t/02-Password-Demo.t
+5
-5
No files found.
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm
View file @
9fafa1d8
...
...
@@ -720,13 +720,27 @@ sub sendHtml {
$args
{
params
}
->
{
TROVER
}
=
$self
->
trOver
;
$args
{
templateDir
}
=
$self
->
conf
->
{
templateDir
}
.
'
/
'
.
$self
->
getSkin
(
$req
);
my
$tmpl
=
$args
{
templateDir
}
.
"
/
$template
.tpl
";
my
$tmpl
=
$args
{
templateDir
}
.
"
/
$template
.tpl
";
my
$troverJson
=
$args
{
templateDir
}
.
"
/
$template
.json
";
unless
(
-
f
$tmpl
)
{
$self
->
logger
->
debug
("
Template :
$tmpl
NOT found!!!
");
$args
{
templateDir
}
=
$self
->
conf
->
{
templateDir
}
.
'
/bootstrap
';
$tmpl
=
$args
{
templateDir
}
.
"
/
$template
.tpl
";
$tmpl
=
$args
{
templateDir
}
.
"
/
$template
.tpl
";
$troverJson
=
$args
{
templateDir
}
.
"
/
$template
.json
";
$self
->
logger
->
debug
("
-> Trying to load
$tmpl
");
}
if
(
-
r
$troverJson
)
{
open
my
$tr_file
,
'
<
',
$troverJson
or
die
"
Can't open
"
.
$troverJson
.
"
: $!
";
while
(
<
$tr_file
>
)
{
chomp
;
$args
{
params
}
->
{
TROVERbyJSON
}
.=
$_
;
}
close
$tr_file
or
die
"
Can't close
$tr_file
: $!
";
$self
->
logger
->
debug
("
-> Overriding messages with
$troverJson
");
$self
->
logger
->
debug
("
-> File content :
$args
{params}->{TROVERbyJSON}
");
}
my
$res
=
$self
->
SUPER::
sendHtml
(
$req
,
$template
,
%args
);
push
@
{
$res
->
[
1
]
},
'
X-XSS-Protection
'
=>
'
1; mode=block
',
...
...
lemonldap-ng-portal/site/templates/bootstrap/error.json
deleted
100644 → 0
View file @
53eb78c5
<script
type=
"application/init"
>
{
"trOver"
:{
"all"
:{},
"fr"
:{
"PE5"
:
"Pas de chance, râté ! Merci de réessayer ..."
},
"en"
:{}}
}
</script>
\ No newline at end of file
lemonldap-ng-portal/site/templates/bootstrap/error.json.example
0 → 100644
View file @
9fafa1d8
{
"trOver":{"all":{},"fr":{"PE5":"Pas de chance, râté ! Merci de réessayer ..."},"en":{}}
}
\ No newline at end of file
lemonldap-ng-portal/site/templates/bootstrap/error.tpl
View file @
9fafa1d8
<TMPL_INCLUDE
NAME=
"header.tpl"
>
<TMPL_INCLUDE
NAME=
"error.json"
>
<div
id=
"errorcontent"
class=
"container"
>
<TMPL_IF
AUTH_ERROR
>
...
...
lemonldap-ng-portal/site/templates/bootstrap/header.tpl
View file @
9fafa1d8
...
...
@@ -39,6 +39,7 @@
<link
rel=
"openid2.provider"
href=
"<TMPL_VAR NAME="
PROVIDERURI
"
>
" />
</TMPL_IF>
<TMPL_INCLUDE
NAME=
"../common/script.tpl"
>
<TMPL_INCLUDE
NAME=
"../common/trover.tpl"
>
<!-- //if:usedebianlibs
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX"><TMPL_VAR NAME="SKIN">/js/skin.min.js"></script>
<script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">common/js/portal.min.js"></script>
...
...
lemonldap-ng-portal/site/templates/bootstrap/login.json
View file @
9fafa1d8
<script
type=
"application/init"
>
{
"trOver"
:{
"all"
:{},
"en"
:{
"PE9"
:
"You are welcome! Please login..."
},
"fr"
:{}}
}
</script>
\ No newline at end of file
{
"trOver"
:{
"all"
:{},
"en"
:{
"PE9"
:
"You are welcome! Please login..."
},
"fr"
:{}}
}
lemonldap-ng-portal/site/templates/bootstrap/login.tpl
View file @
9fafa1d8
<TMPL_INCLUDE
NAME=
"header.tpl"
>
<TMPL_INCLUDE
NAME=
"login.json"
>
<main
id=
"logincontent"
class=
"container"
>
...
...
lemonldap-ng-portal/site/templates/common/trover.tpl
0 → 100644
View file @
9fafa1d8
<TMPL_IF
NAME=
"TROVERbyJSON"
>
<script
type=
"application/init"
>
<
TMPL_VAR
NAME
=
"
TROVERbyJSON
"
>
</script>
</TMPL_IF>
\ No newline at end of file
lemonldap-ng-portal/t/02-Password-Demo.t
View file @
9fafa1d8
...
...
@@ -31,9 +31,9 @@ ok( $res->[2]->[0] =~ m%"trOver"%,
ok
(
$res
->
[
2
]
->
[
0
]
=~
m%"all":\{\}%
,
'
all found
'
)
or
print
STDERR
Dumper
(
$res
->
[
2
]
->
[
0
]
);
#
ok( $res->[2]->[0] =~ m%"en":\{"PE
5
":"
Big brother is watching you, authenticated user
"\}%,
#
' en found' )
#
or print STDERR Dumper( $res->[2]->[0] );
ok
(
$res
->
[
2
]
->
[
0
]
=~
m%"en":\{"PE
9
":"
You are welcome! Please login...
"\}%
,
'
en found
'
)
or
print
STDERR
Dumper
(
$res
->
[
2
]
->
[
0
]
);
ok
(
$res
->
[
2
]
->
[
0
]
=~
m%"PE0":"Souriez, vous êtes surveillés !"%
,
'
PE0 found
'
)
or
print
STDERR
Dumper
(
$res
->
[
2
]
->
[
0
]
);
...
...
@@ -46,8 +46,8 @@ ok( $res->[2]->[0] =~ m%"fr":\{%,
ok
(
$res
->
[
2
]
->
[
0
]
=~
m%"PE85":"From lemonlap-ng.ini"%
,
'
PE85 found
'
)
or
print
STDERR
Dumper
(
$res
->
[
2
]
->
[
0
]
);
#
count(9);
count
(
8
);
count
(
9
);
# Try yo authenticate
# -------------------
...
...
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