Merge branch 'v2.0'
This commit is contained in:
commit
3cea903c79
2
Makefile
2
Makefile
|
@ -294,6 +294,8 @@ $(SRCPORTALDIR)/site/htdocs/static/common/js/%.js: $(SRCPORTALDIR)/site/coffee/%
|
|||
@if which coffee >/dev/null; then \
|
||||
echo "Compiling $(SRCPORTALDIR)/site/coffee/$*.coffee"; \
|
||||
coffee -c -o $(SRCPORTALDIR)/site/htdocs/static/common/js/ $(SRCPORTALDIR)/site/coffee/$*.coffee; \
|
||||
else \
|
||||
echo "Can't find coffee"; \
|
||||
fi
|
||||
|
||||
$(SRCMANAGERDIR)/site/htdocs/static/js/%.js: $(SRCMANAGERDIR)/site/coffee/%.coffee
|
||||
|
|
|
@ -119,13 +119,8 @@
|
|||
"namespace" : "lemonldap-ng-sessions"
|
||||
},
|
||||
"locationRules" : {
|
||||
"auth.example.com" : {
|
||||
"(?#checkUser)^/checkuser": "$uid eq \"dwho\"",
|
||||
"(?#errors)^/lmerror/": "accept",
|
||||
"default" : "accept"
|
||||
},
|
||||
"manager.__DNSDOMAIN__" : {
|
||||
"(?#Configuration)^/(manager\\.html|$)" : "$uid eq \"dwho\"",
|
||||
"(?#Configuration)^/(manager\\.html|conf/)" : "$uid eq \"dwho\"",
|
||||
"(?#Notifications)/notifications" : "$uid eq \"dwho\" or $uid eq \"rtyler\"",
|
||||
"(?#Sessions)/sessions" : "$uid eq \"dwho\" or $uid eq \"rtyler\"",
|
||||
"default" : "$uid eq \"dwho\" or $uid eq \"rtyler\""
|
||||
|
|
|
@ -28,7 +28,6 @@ totp2fActivation = 1
|
|||
totp2fSelfRegistration = 1
|
||||
captcha_mail_enabled = 0
|
||||
portalDisplayResetPassword = 1
|
||||
translations = __pwd__/lemonldap-ng-portal/site/templates/localeTranslations.txt
|
||||
|
||||
[handler]
|
||||
|
||||
|
@ -40,6 +39,10 @@ useRedirectOnError = 0
|
|||
|
||||
enabledModules = conf, sessions, notifications, 2ndFA, viewer
|
||||
protection = manager
|
||||
|
||||
viewerHiddenPK = samlIDPMetaDataNodes samlSPMetaDataNodes portalDisplayLogout
|
||||
viewerAllowBrowser = 1
|
||||
|
||||
staticPrefix = /static
|
||||
languages = fr, en, vi, ar, de, it, zh
|
||||
templateDir = __pwd__/lemonldap-ng-manager/site/templates
|
||||
|
|
|
@ -204,7 +204,6 @@ languages = en, fr, vi, it, ar
|
|||
;useOldMenuItems=1
|
||||
; Override error codes
|
||||
;error_0 = You are well authenticated!
|
||||
;translations = __PORTALTEMPLATESDIR__/localeTranslations.txt
|
||||
; Custom template parameters
|
||||
; For example to use <TMPL_VAR NAME="myparam">
|
||||
;tpl_myparam = test
|
||||
|
|
|
@ -24,6 +24,7 @@ sub compactConf {
|
|||
s/^(\w+).*$/lc($1)/e;
|
||||
s/OpenIDConnect/oidc/i;
|
||||
$keep{$_} = 1;
|
||||
if ( $_ eq "ad" ) { $keep{'ldap'} = 1; }
|
||||
}
|
||||
}
|
||||
if ( $keep{choice} ) {
|
||||
|
@ -33,6 +34,7 @@ sub compactConf {
|
|||
s/^(\w+).*$/lc($1)/e;
|
||||
s/OpenIDConnect/oidc/i;
|
||||
$keep{$_} = 1;
|
||||
if ( $_ eq "ad" ) { $keep{'ldap'} = 1; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -780,7 +780,11 @@ sub postInputFilter {
|
|||
my %data =
|
||||
$class->tsv->{inputPostData}->{$vhost}->{$uri}->( $req, $session );
|
||||
foreach ( keys %data ) {
|
||||
$data{$_} = uri_escape( $data{$_} );
|
||||
my $post_key = uri_escape($_);
|
||||
my $post_value = uri_escape( $data{$_} );
|
||||
delete $data{$_};
|
||||
$data{$post_key} = $post_value;
|
||||
$class->logger->debug("Send key $post_key with value $post_value");
|
||||
}
|
||||
$class->setPostParams( $req, \%data );
|
||||
}
|
||||
|
@ -809,7 +813,8 @@ sub postJavascript {
|
|||
: "form.submit();\n";
|
||||
|
||||
my $jqueryUrl = $formParams->{jqueryUrl} || "";
|
||||
$jqueryUrl = &{ $class->tsv->{portal} } . "skins/common/js/jquery-1.10.2.js"
|
||||
$jqueryUrl =
|
||||
&{ $class->tsv->{portal} } . "static/bwr/jquery/dist/jquery.min.js"
|
||||
if ( $jqueryUrl eq "default" );
|
||||
$jqueryUrl = "<script type='text/javascript' src='$jqueryUrl'></script>\n"
|
||||
if ($jqueryUrl);
|
||||
|
|
|
@ -21,6 +21,7 @@ lib/Lemonldap/NG/Manager/Conf/Tests.pm
|
|||
lib/Lemonldap/NG/Manager/Conf/Zero.pm
|
||||
lib/Lemonldap/NG/Manager/Notifications.pm
|
||||
lib/Lemonldap/NG/Manager/Sessions.pm
|
||||
lib/Lemonldap/NG/Manager/Viewer.pm
|
||||
Makefile.PL
|
||||
MANIFEST This list of files
|
||||
META.json
|
||||
|
@ -36,6 +37,7 @@ site/coffee/llApp.coffee
|
|||
site/coffee/manager.coffee
|
||||
site/coffee/notifications.coffee
|
||||
site/coffee/sessions.coffee
|
||||
site/coffee/viewer.coffee
|
||||
site/htdocs/manager.fcgi
|
||||
site/htdocs/manager.psgi
|
||||
site/htdocs/static/bwr/angular-animate/angular-animate.js
|
||||
|
@ -156,6 +158,8 @@ site/htdocs/static/js/notifications.js
|
|||
site/htdocs/static/js/notifications.min.js
|
||||
site/htdocs/static/js/sessions.js
|
||||
site/htdocs/static/js/sessions.min.js
|
||||
site/htdocs/static/js/viewer.js
|
||||
site/htdocs/static/js/viewer.min.js
|
||||
site/htdocs/static/languages/ar.json
|
||||
site/htdocs/static/languages/de.json
|
||||
site/htdocs/static/languages/en.json
|
||||
|
@ -187,6 +191,7 @@ site/templates/notifications.tpl
|
|||
site/templates/scripts.tpl
|
||||
site/templates/sessions.tpl
|
||||
site/templates/tree.tpl
|
||||
site/templates/viewer.tpl
|
||||
t/02-HTML-template.t
|
||||
t/03-HTML-forms.t
|
||||
t/05-rest-api.t
|
||||
|
|
|
@ -87,7 +87,7 @@ sub init {
|
|||
$self->csp(
|
||||
"default-src 'self' $portal;frame-ancestors 'none';form-action 'self';"
|
||||
);
|
||||
$self->brw( $conf->{viewerAllowBrowser} );
|
||||
$self->brw( $self->{viewerAllowBrowser} || $conf->{viewerAllowBrowser} );
|
||||
$self->defaultRoute( $working[0]->defaultRoute );
|
||||
|
||||
# Find out more glyphicones at https://www.w3schools.com/icons/bootstrap_icons_glyphicons.asp
|
||||
|
|
|
@ -31,6 +31,8 @@ sub addRoutes {
|
|||
my ( $self, $conf ) = @_;
|
||||
$self->ua( Lemonldap::NG::Common::UserAgent->new($conf) );
|
||||
|
||||
my $hiddenPK = '';
|
||||
$hiddenPK = $self->{viewerHiddenPK} || $conf->{viewerHiddenPK};
|
||||
my @enabledPK = ();
|
||||
my @keys = qw(virtualHosts samlIDPMetaDataNodes samlSPMetaDataNodes
|
||||
applicationList oidcOPMetaDataNodes oidcRPMetaDataNodes
|
||||
|
@ -42,7 +44,7 @@ sub addRoutes {
|
|||
|
||||
# Ignore hidden ConfTree Primary Keys
|
||||
push @enabledPK, $_
|
||||
unless ( $conf->{viewerHiddenPK} =~ /\b$_\b/ );
|
||||
unless ( $hiddenPK =~ /\b$_\b/ );
|
||||
}
|
||||
|
||||
# HTML template
|
||||
|
@ -55,10 +57,17 @@ sub addRoutes {
|
|||
':cfgNum' => \@enabledPK
|
||||
},
|
||||
['GET']
|
||||
)
|
||||
);
|
||||
|
||||
# Other keys
|
||||
->addRoute( view => { ':cfgNum' => { '*' => 'getKey' } }, ['GET'] )
|
||||
foreach ( split /\s+/, $hiddenPK ) {
|
||||
$self->addRoute(
|
||||
view => { ':cfgNum' => { $_ => 'rejectKey' } },
|
||||
['GET']
|
||||
);
|
||||
}
|
||||
|
||||
# Other keys
|
||||
$self->addRoute( view => { ':cfgNum' => { '*' => 'getKey' } }, ['GET'] )
|
||||
|
||||
# Difference between confs
|
||||
->addRoute( diff => { ':conf1' => { ':conf2' => 'diff' } } )
|
||||
|
@ -75,4 +84,9 @@ sub diff {
|
|||
$self->SUPER::diff( $req, @path );
|
||||
}
|
||||
|
||||
sub rejectKey {
|
||||
my ( $self, $req ) = @_;
|
||||
return $self->sendJSONresponse( $req, { 'value' => '_Hidden_' } );
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
@ -179,8 +179,6 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location',
|
|||
|
||||
# Session preparation
|
||||
transformSession = (session) ->
|
||||
_stToStr = (s) ->
|
||||
s
|
||||
_insert = (re, title) ->
|
||||
tmp = []
|
||||
reg = new RegExp(re)
|
||||
|
@ -210,10 +208,7 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location',
|
|||
else if key.match /^(_utime|_lastAuthnUTime|_lastSeen|notification)$/
|
||||
session[key] = $scope.localeDate value
|
||||
else if key.match /^(_startTime|_updateTime)$/
|
||||
value = _stToStr value
|
||||
pattern = /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/
|
||||
arrayDate = value.match(pattern)
|
||||
session[key] = "#{arrayDate[3]}/#{arrayDate[2]}/#{arrayDate[1]} à #{arrayDate[4]}:#{arrayDate[5]}:#{arrayDate[6]}"
|
||||
session[key] = $scope.strToLocaleDate value
|
||||
|
||||
res = []
|
||||
|
||||
|
@ -345,6 +340,12 @@ llapp.controller 'SessionsExplorerCtrl', ['$scope', '$translator', '$location',
|
|||
d = new Date(s * 1000)
|
||||
return d.toLocaleString()
|
||||
|
||||
$scope.strToLocaleDate = (s) ->
|
||||
arrayDate = s.match /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/
|
||||
return s unless arrayDate.length
|
||||
d = new Date "#{arrayDate[1]}-#{arrayDate[2]}-#{arrayDate[3]}T#{arrayDate[4]}:#{arrayDate[5]}:#{arrayDate[6]}"
|
||||
return d.toLocaleString()
|
||||
|
||||
# Function to change interface language
|
||||
$scope.getLanguage = (lang) ->
|
||||
$scope.lang = lang
|
||||
|
|
|
@ -136,35 +136,6 @@ llapp.controller 'TreeCtrl', [
|
|||
$scope.form = 'home'
|
||||
$scope.showM = false
|
||||
|
||||
# SAVE FUNCTIONS
|
||||
|
||||
# # Private method called by $scope.save()
|
||||
# _checkSaveResponse = (data) ->
|
||||
# $scope.message =
|
||||
# title: ''
|
||||
# message: ''
|
||||
# items: []
|
||||
# $scope.confirmNeeded = true if data.needConfirm
|
||||
# $scope.message.message = data.message if data.message
|
||||
# if data.details
|
||||
# for m of data.details when m != '__changes__'
|
||||
# if m == '__needConfirmation__'
|
||||
# $scope.message.items.unshift
|
||||
# message: m
|
||||
# items: data.details[m]
|
||||
# else
|
||||
# $scope.message.items.push
|
||||
# message: m
|
||||
# items: data.details[m]
|
||||
# $scope.waiting = false
|
||||
# if data.result == 1
|
||||
# # Force reloading page
|
||||
# $location.path '/confs/'
|
||||
# $scope.message.title = 'successfullySaved'
|
||||
# else
|
||||
# $scope.message.title = 'saveReport'
|
||||
# $scope.showModal 'message.html'
|
||||
|
||||
# Download raw conf
|
||||
$scope.downloadConf = () ->
|
||||
window.open $scope.viewPrefix + $scope.currentCfg.cfgNum + '?full=1'
|
||||
|
@ -379,6 +350,9 @@ llapp.controller 'TreeCtrl', [
|
|||
node.data = node['default']
|
||||
else
|
||||
node.data = data.value
|
||||
if node.data.toString().match /_Hidden_$/
|
||||
node.type = 'text'
|
||||
node.data = '######'
|
||||
# Cast int as int (remember that booleans are int for Perl)
|
||||
if node.type and node.type.match /^int$/
|
||||
node.data = parseInt(node.data, 10)
|
||||
|
@ -391,6 +365,9 @@ llapp.controller 'TreeCtrl', [
|
|||
readError response
|
||||
d.reject response.status
|
||||
else
|
||||
if node.data.toString().match /_Hidden_$/
|
||||
node.type = 'text'
|
||||
node.data = '######'
|
||||
d.resolve node.data
|
||||
return d.promise
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
|
||||
/*
|
||||
* 2ndFA Session explorer
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
|
||||
/*
|
||||
diff.html script
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
var filterFunctions;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
|
||||
/*
|
||||
* LemonLDAP::NG Notifications Explorer client
|
||||
|
|
|
@ -199,10 +199,7 @@
|
|||
$scope.displaySession = function(scope) {
|
||||
var sessionId, transformSession;
|
||||
transformSession = function(session) {
|
||||
var _insert, _stToStr, array, arrayDate, attr, attrs, category, cv, epoch, i, id, j, k, key, l, len, len1, len2, len3, len4, m, name, o, oidcConsent, pattern, ref, ref1, res, sfDevice, subres, time, title, tmp, value;
|
||||
_stToStr = function(s) {
|
||||
return s;
|
||||
};
|
||||
var _insert, array, attr, attrs, category, cv, epoch, i, id, j, k, key, l, len, len1, len2, len3, len4, m, name, o, oidcConsent, ref, ref1, res, sfDevice, subres, time, title, tmp, value;
|
||||
_insert = function(re, title) {
|
||||
var key, reg, tmp, value;
|
||||
tmp = [];
|
||||
|
@ -240,10 +237,7 @@
|
|||
} else if (key.match(/^(_utime|_lastAuthnUTime|_lastSeen|notification)$/)) {
|
||||
session[key] = $scope.localeDate(value);
|
||||
} else if (key.match(/^(_startTime|_updateTime)$/)) {
|
||||
value = _stToStr(value);
|
||||
pattern = /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/;
|
||||
arrayDate = value.match(pattern);
|
||||
session[key] = arrayDate[3] + "/" + arrayDate[2] + "/" + arrayDate[1] + " à " + arrayDate[4] + ":" + arrayDate[5] + ":" + arrayDate[6];
|
||||
session[key] = $scope.strToLocaleDate(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -424,6 +418,15 @@
|
|||
d = new Date(s * 1000);
|
||||
return d.toLocaleString();
|
||||
};
|
||||
$scope.strToLocaleDate = function(s) {
|
||||
var arrayDate, d;
|
||||
arrayDate = s.match(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/);
|
||||
if (!arrayDate.length) {
|
||||
return s;
|
||||
}
|
||||
d = new Date(arrayDate[1] + "-" + arrayDate[2] + "-" + arrayDate[3] + "T" + arrayDate[4] + ":" + arrayDate[5] + ":" + arrayDate[6]);
|
||||
return d.toLocaleString();
|
||||
};
|
||||
$scope.getLanguage = function(lang) {
|
||||
$scope.lang = lang;
|
||||
$scope.form = 'white';
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -441,6 +441,10 @@ This file contains:
|
|||
} else {
|
||||
node.data = data.value;
|
||||
}
|
||||
if (node.data.toString().match(/_Hidden_$/)) {
|
||||
node.type = 'text';
|
||||
node.data = '######';
|
||||
}
|
||||
if (node.type && node.type.match(/^int$/)) {
|
||||
node.data = parseInt(node.data, 10);
|
||||
} else if (node.type && node.type.match(/^(saml(Service|Assertion)|blackWhiteList)$/) && !(typeof node.data === 'object')) {
|
||||
|
@ -454,6 +458,10 @@ This file contains:
|
|||
});
|
||||
}
|
||||
} else {
|
||||
if (node.data.toString().match(/_Hidden_$/)) {
|
||||
node.type = 'text';
|
||||
node.data = '######';
|
||||
}
|
||||
d.resolve(node.data);
|
||||
}
|
||||
return d.promise;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -332,7 +332,6 @@ site/templates/bootstrap/customhead.tpl
|
|||
site/templates/bootstrap/customheader.tpl
|
||||
site/templates/bootstrap/customLoginFooter.tpl
|
||||
site/templates/bootstrap/customLoginHeader.tpl
|
||||
site/templates/bootstrap/error.json.example
|
||||
site/templates/bootstrap/error.tpl
|
||||
site/templates/bootstrap/ext2fcheck.tpl
|
||||
site/templates/bootstrap/footer.tpl
|
||||
|
@ -342,7 +341,6 @@ site/templates/bootstrap/idpchoice.tpl
|
|||
site/templates/bootstrap/impersonation.tpl
|
||||
site/templates/bootstrap/info.tpl
|
||||
site/templates/bootstrap/ldapPpGrace.tpl
|
||||
site/templates/bootstrap/login.json
|
||||
site/templates/bootstrap/login.tpl
|
||||
site/templates/bootstrap/mail.tpl
|
||||
site/templates/bootstrap/menu.tpl
|
||||
|
@ -400,8 +398,6 @@ site/templates/common/oidc_checksession.tpl
|
|||
site/templates/common/redirect.tpl
|
||||
site/templates/common/registerBrowser.tpl
|
||||
site/templates/common/script.tpl
|
||||
site/templates/common/trover.tpl
|
||||
site/templates/localeTranslations.txt
|
||||
t/01-AuthDemo.t
|
||||
t/01-pdata.t
|
||||
t/02-Password-Demo.t
|
||||
|
@ -428,6 +424,7 @@ t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t
|
|||
t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO.t
|
||||
t/30-Auth-and-issuer-SAML-Metadata.t
|
||||
t/30-Auth-and-issuer-SAML-POST-IdP-initiated.t
|
||||
t/30-Auth-and-issuer-SAML-POST-Missing-SLO.t
|
||||
t/30-Auth-and-issuer-SAML-POST.t
|
||||
t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t
|
||||
t/30-Auth-and-issuer-SAML-Redirect.t
|
||||
|
@ -461,8 +458,10 @@ t/36-Combination-Kerberos-or-Demo.t
|
|||
t/36-Combination-with-over.t
|
||||
t/36-Combination-with-token.t
|
||||
t/36-Combination.t
|
||||
t/37-CAS-App-to-SAML-IdP-POST-with-WAYF.t
|
||||
t/37-CAS-App-to-SAML-IdP-POST.t
|
||||
t/37-Logout-from-OIDC-RP-to-SAML-SP.t
|
||||
t/37-OIDC-RP-to-SAML-IdP-GET-with-WAYF.t
|
||||
t/37-OIDC-RP-to-SAML-IdP-GET.t
|
||||
t/37-OIDC-RP-to-SAML-IdP-POST.t
|
||||
t/37-SAML-SP-GET-to-OIDC-OP.t
|
||||
|
|
|
@ -96,19 +96,7 @@ sub init {
|
|||
}
|
||||
);
|
||||
|
||||
# Load override messages from file and lemonldap-ng.ini
|
||||
if ( $self->{localConfig}->{translations}
|
||||
and -r $self->{localConfig}->{translations} )
|
||||
{
|
||||
open my $tr_file, '<', $self->{localConfig}->{translations}
|
||||
or die "Can't open" . $self->{localConfig}->{translations} . " : $!";
|
||||
while (<$tr_file>) {
|
||||
chomp;
|
||||
$_ =~ /^([\w_]+)\s+=\s+(.+)$/;
|
||||
$self->{localConfig}->{$1} = $2;
|
||||
}
|
||||
close $tr_file or die "Can't close $tr_file : $!";
|
||||
}
|
||||
# Load override messages from lemonldap-ng.ini
|
||||
foreach my $k ( keys %{ $self->localConfig } ) {
|
||||
if ( $k =~ /tpl_(.*)/ ) {
|
||||
$self->customParameters->{$1} = $self->localConfig->{$k};
|
||||
|
|
|
@ -359,11 +359,11 @@ sub _filterHash {
|
|||
|
||||
# If a specific rule exists, get it from cache or compile it
|
||||
if ( $appdisplay !~ /^auto$/i ) {
|
||||
if ( $self->specific->{$appuri} ) {
|
||||
$cond = $self->specific->{$appuri};
|
||||
if ( $self->specific->{$key} ) {
|
||||
$cond = $self->specific->{$key};
|
||||
}
|
||||
else {
|
||||
$cond = $self->specific->{$appuri} =
|
||||
$cond = $self->specific->{$key} =
|
||||
$self->p->HANDLER->buildSub(
|
||||
$self->p->HANDLER->substitute($appdisplay) );
|
||||
}
|
||||
|
|
|
@ -734,38 +734,39 @@ sub _dump {
|
|||
sub sendHtml {
|
||||
my ( $self, $req, $template, %args ) = @_;
|
||||
|
||||
$args{params}->{TROVER} = $self->trOver;
|
||||
$args{templateDir} =
|
||||
$self->conf->{templateDir} . '/' . $self->getSkin($req);
|
||||
my $tmpl = $args{templateDir} . "/$template.tpl";
|
||||
my $troverJson = $args{templateDir} . "/$template.json";
|
||||
my $templateDir = $self->conf->{templateDir} . '/' . $self->getSkin($req);
|
||||
|
||||
# Check template
|
||||
$args{templateDir} = $templateDir;
|
||||
my $tmpl = $args{templateDir} . "/$template.tpl";
|
||||
unless ( -f $tmpl ) {
|
||||
$self->logger->debug("Template : $tmpl NOT found!!!");
|
||||
$self->logger->debug("Template $tmpl not found");
|
||||
$args{templateDir} = $self->conf->{templateDir} . '/bootstrap';
|
||||
$tmpl = $args{templateDir} . "/$template.tpl";
|
||||
$troverJson = $args{templateDir} . "/$template.json";
|
||||
$tmpl = $args{templateDir} . "/$template.tpl";
|
||||
$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 : $!";
|
||||
eval { decode_json( $args{params}->{TROVERbyJSON} ) };
|
||||
if ($@) {
|
||||
$self->logger->debug("$troverJson is NOT a regular JSON file!!!");
|
||||
$args{params}->{TROVERbyJSON} = '';
|
||||
# Override messages
|
||||
my $trOverMessages = JSON::from_json( $self->trOver );
|
||||
|
||||
opendir( DIR, $templateDir );
|
||||
my @langfiles = grep( /\.json$/, readdir(DIR) );
|
||||
close(DIR);
|
||||
|
||||
foreach my $file (@langfiles) {
|
||||
my ($lang) = ( $file =~ /^(\w+)\.json/ );
|
||||
$self->logger->debug("Use $file to override messages");
|
||||
if ( open my $json, "<", $templateDir . "/" . $file ) {
|
||||
local $/ = undef;
|
||||
$trOverMessages->{$lang} = JSON::from_json(<$json>);
|
||||
}
|
||||
else {
|
||||
$self->logger->debug(" -> Overriding messages with $troverJson");
|
||||
$self->logger->debug(
|
||||
" -> File content : $args{params}->{TROVERbyJSON}");
|
||||
$self->logger->error("Unable to read $file");
|
||||
}
|
||||
}
|
||||
|
||||
$args{params}->{TROVER} = JSON::to_json($trOverMessages);
|
||||
|
||||
my $res = $self->SUPER::sendHtml( $req, $template, %args );
|
||||
push @{ $res->[1] },
|
||||
'X-XSS-Protection' => '1; mode=block',
|
||||
|
|
|
@ -47,6 +47,10 @@ sub changeUrldc {
|
|||
|
||||
$self->p->updateSession( $req, $cdaInfos, $cdaSession->id );
|
||||
|
||||
# We are about to redirect the user to the CDA application,
|
||||
# dismiss any previously stored redirections (#1650)
|
||||
delete $req->{pdata}->{_url};
|
||||
|
||||
$req->{urldc} .=
|
||||
( $urldc =~ /\?/ ? '&' : '?' )
|
||||
. $self->{conf}->{cookieName} . "cda="
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
|
||||
/*
|
||||
LemonLDAP::NG 2F registration script
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
$(document).ready(function() {
|
||||
return $('#upgrd').submit();
|
||||
|
|
|
@ -1 +1 @@
|
|||
(function(){$(document).ready(function(){return $("#upgrd").submit()})}).call(this);
|
||||
(function(){$(document).ready(function(){return $("#upgrd").submit()})}).call(this);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.10.0
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
var go, i, timer, timerIsEnabled;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.10.0
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
$(document).ready(function() {
|
||||
return $(".idploop").on('click', function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.9.3
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
var _go, go, i, stop, timer;
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
(function(){var _go,go,i,stop,timer;i=30;_go=1;stop=function(){_go=0;return $("#divToHide").hide()};go=function(){if(_go){return $("#form").submit()}};timer=function(){var h;h=$("#timer").html();if(i>0){i--}h=h.replace(/\d+/,i);$("#timer").html(h);return window.setTimeout(timer,1e3)};$(document).ready(function(){if(window.datas["activeTimer"]){window.setTimeout(go,3e4);window.setTimeout(timer,1e3)}else{stop}return $("#wait").on("click",function(){return stop()})})}).call(this);
|
||||
(function(){var _go,go,i,stop,timer;i=30;_go=1;stop=function(){_go=0;return $("#divToHide").hide()};go=function(){if(_go){return $("#form").submit()}};timer=function(){var h;h=$("#timer").html();if(i>0){i--}h=h.replace(/\d+/,i);$("#timer").html(h);return window.setTimeout(timer,1e3)};$(document).ready(function(){if(window.datas["activeTimer"]){window.setTimeout(go,3e4);window.setTimeout(timer,1e3)}else{stop}return $("#wait").on("click",function(){return stop()})})}).call(this);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.10.0
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
$(document).ready(function() {
|
||||
return $.ajax(portal + '?kerberos=1', {
|
||||
|
|
|
@ -1 +1 @@
|
|||
(function(){$(document).ready(function(){return $.ajax(portal+"?kerberos=1",{dataType:"json",statusCode:{401:function(){return $("#lform").submit()}},success:function(a){return $("#lform").submit()},error:function(){return $("#lform").submit()}})})}).call(this);
|
||||
(function(){$(document).ready(function(){return $.ajax(portal+"?kerberos=1",{dataType:"json",statusCode:{401:function(){return $("#lform").submit()}},success:function(data){return $("#lform").submit()},error:function(){return $("#lform").submit()}})})}).call(this);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
$(document).ready(function() {
|
||||
return $.ajax(portal + '?kerberos=1', {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
var values;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
|
||||
/*
|
||||
LemonLDAP::NG Portal jQuery scripts
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.10.0
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
document.onreadystatechange = function() {
|
||||
var redirect;
|
||||
|
|
|
@ -1 +1 @@
|
|||
(function(){document.onreadystatechange=function(){var a;if(document.readyState==="complete"){a=document.getElementById("redirect").textContent.replace(/\s/g,"");if(a){if(a==="form"){return document.getElementById("form").submit()}else{return document.location.href=a}}else{return console.log("No redirection !")}}}}).call(this);
|
||||
(function(){document.onreadystatechange=function(){var redirect;if(document.readyState==="complete"){redirect=document.getElementById("redirect").textContent.replace(/\s/g,"");if(redirect){if(redirect==="form"){return document.getElementById("form").submit()}else{return document.location.href=redirect}}else{return console.log("No redirection !")}}}}).call(this);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.10.0
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
$(document).ready(function() {
|
||||
return new Fingerprint2().get(function(result, components) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
(function(){$(document).ready(function(){return new Fingerprint2().get(function(a,b){$("#fg").attr("value",a);return $("#form").submit()})})}).call(this);
|
||||
(function(){$(document).ready(function(){return(new Fingerprint2).get(function(result,components){$("#fg").attr("value",result);return $("#form").submit()})})}).call(this);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
var tryssl;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
(function() {
|
||||
var tryssl;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
|
||||
/*
|
||||
LemonLDAP::NG TOTP registration script
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.9.3
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
|
||||
/*
|
||||
LemonLDAP::NG U2F verify script
|
||||
|
|
|
@ -1 +1 @@
|
|||
(function(){var a;a=function(){return u2f.sign(window.datas.appId,window.datas.challenge,window.datas.registeredKeys,function(b){$("#verify-data").val(JSON.stringify(b));$("#verify-challenge").val(window.datas.challenge);return $("#verify-form").submit()})};$(document).ready(function(){return setTimeout(a,1000)})}).call(this);
|
||||
(function(){var check;check=function(){return u2f.sign(window.datas.appId,window.datas.challenge,window.datas.registeredKeys,function(data){$("#verify-data").val(JSON.stringify(data));$("#verify-challenge").val(window.datas.challenge);return $("#verify-form").submit()})};$(document).ready(function(){return setTimeout(check,1e3)})}).call(this);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
|
||||
/*
|
||||
LemonLDAP::NG U2F registration script
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"trOver":{"all":{},"fr":{"PE5":"Pas de chance, râté ! Merci de réessayer ..."},"en":{}}
|
||||
}
|
|
@ -39,7 +39,6 @@
|
|||
<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>
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"trOver":{"all":{},"en":{"PE9":"You are welcome! Please login..."},"fr":{}}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
<TMPL_IF NAME="TROVERbyJSON">
|
||||
<script type="application/init">
|
||||
<TMPL_VAR NAME="TROVERbyJSON">
|
||||
</script>
|
||||
</TMPL_IF>
|
|
@ -1,4 +0,0 @@
|
|||
error_en_5 = Big brother is watching you, authenticated user
|
||||
error_en_9 = Do you really want to login ?
|
||||
error_fr_0 = Souriez, vous êtes surveillés !
|
||||
msg_fr_selectIdP = Portail de Fédération des Identités
|
|
@ -15,7 +15,6 @@ my $client = LLNG::Manager::Test->new( {
|
|||
passwordDB => 'Demo',
|
||||
portalRequireOldPassword => 1,
|
||||
showLanguages => 0,
|
||||
translations => 'site/templates/localeTranslations.txt',
|
||||
error_de_85 => 'From lemonlap-ng.ini',
|
||||
}
|
||||
}
|
||||
|
@ -29,22 +28,11 @@ ok( $res->[2]->[0] =~ m%"trOver"%, ' trOver found' )
|
|||
or print STDERR Dumper( $res->[2]->[0] );
|
||||
ok( $res->[2]->[0] =~ m%"all":\{\}%, ' all found' )
|
||||
or print STDERR Dumper( $res->[2]->[0] );
|
||||
ok( $res->[2]->[0] =~ m%"en":\{"PE9":"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] );
|
||||
ok( $res->[2]->[0] =~ m%"selectIdP":"Portail de Fédération des Identités"%,
|
||||
' selectIdP found' )
|
||||
or print STDERR Dumper( $res->[2]->[0] );
|
||||
ok( $res->[2]->[0] =~ m%"fr":\{%, ' fr found' )
|
||||
or print STDERR Dumper( $res->[2]->[0] );
|
||||
ok( $res->[2]->[0] =~ m%"PE85":"From lemonlap-ng.ini"%, ' PE85 found' )
|
||||
or print STDERR Dumper( $res->[2]->[0] );
|
||||
count(9);
|
||||
count(5);
|
||||
|
||||
# Try yo authenticate
|
||||
# Try to authenticate
|
||||
# -------------------
|
||||
ok(
|
||||
$res = $client->_post(
|
||||
|
@ -59,7 +47,7 @@ ok( $res->[2]->[0] =~ m%<span trmsg="40"></span>%, ' PE40 found' )
|
|||
or print STDERR Dumper( $res->[2]->[0] );
|
||||
count(2);
|
||||
|
||||
# Try yo authenticate
|
||||
# Try to authenticate
|
||||
# -------------------
|
||||
ok(
|
||||
$res = $client->_post(
|
||||
|
|
|
@ -51,6 +51,12 @@ count(1);
|
|||
my ($query) =
|
||||
expectRedirection( $res, qr#^http://test.example.org/\?(lemonldapcda=.*)$# );
|
||||
|
||||
# Bug #1650 made the portal store an _url in pdata at this step
|
||||
my $cookies = getCookies($res);
|
||||
|
||||
ok( !defined( $cookies->{lemonldappdata} ), " Make sure no pdata is returned" );
|
||||
count(1);
|
||||
|
||||
# Handler part
|
||||
use_ok('Lemonldap::NG::Handler::Server');
|
||||
use_ok('Lemonldap::NG::Common::PSGI::Cli::Lib');
|
||||
|
|
Loading…
Reference in New Issue