Merge branch 'v2.0'
This commit is contained in:
commit
4cb497e5a2
|
@ -835,6 +835,10 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
|
||||||
'k' => 'LDAP',
|
'k' => 'LDAP',
|
||||||
'v' => 'LDAP'
|
'v' => 'LDAP'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'k' => 'LinkedIn',
|
||||||
|
'v' => 'LinkedIn'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'k' => 'PAM',
|
'k' => 'PAM',
|
||||||
'v' => 'PAM'
|
'v' => 'PAM'
|
||||||
|
|
|
@ -923,9 +923,9 @@ sub attributes {
|
||||||
flags => 'm',
|
flags => 'm',
|
||||||
},
|
},
|
||||||
viewerAllowBrowser => {
|
viewerAllowBrowser => {
|
||||||
type => 'bool',
|
type => 'bool',
|
||||||
default => 0,
|
default => 0,
|
||||||
documentation => 'Allow configuration browser',
|
documentation => 'Allow configuration browser',
|
||||||
},
|
},
|
||||||
|
|
||||||
# Notification
|
# Notification
|
||||||
|
@ -3108,6 +3108,7 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
|
||||||
{ k => 'GPG', v => 'GPG' },
|
{ k => 'GPG', v => 'GPG' },
|
||||||
{ k => 'Kerberos', v => 'Kerberos' },
|
{ k => 'Kerberos', v => 'Kerberos' },
|
||||||
{ k => 'LDAP', v => 'LDAP' },
|
{ k => 'LDAP', v => 'LDAP' },
|
||||||
|
{ k => 'LinkedIn', v => 'LinkedIn' },
|
||||||
{ k => 'PAM', v => 'PAM' },
|
{ k => 'PAM', v => 'PAM' },
|
||||||
{ k => 'Radius', v => 'Radius' },
|
{ k => 'Radius', v => 'Radius' },
|
||||||
{ k => 'REST', v => 'REST' },
|
{ k => 'REST', v => 'REST' },
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -159,8 +159,7 @@ sub authLogout {
|
||||||
|
|
||||||
sub deleteSession {
|
sub deleteSession {
|
||||||
my ( $self, $req ) = @_;
|
my ( $self, $req ) = @_;
|
||||||
$req->userData( {} );
|
if ( my $id = $req->id || $req->userData->{_session_id} ) {
|
||||||
if ( my $id = $req->id ) {
|
|
||||||
my $apacheSession = $self->getApacheSession( $req->id );
|
my $apacheSession = $self->getApacheSession( $req->id );
|
||||||
unless ($apacheSession) {
|
unless ($apacheSession) {
|
||||||
$self->logger->debug("Session $id already deleted");
|
$self->logger->debug("Session $id already deleted");
|
||||||
|
@ -211,6 +210,7 @@ sub deleteSession {
|
||||||
$req->urldc( $req->script_name . "?logout=1" );
|
$req->urldc( $req->script_name . "?logout=1" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$req->userData( {} );
|
||||||
|
|
||||||
# Redirect or Post if asked by authLogout
|
# Redirect or Post if asked by authLogout
|
||||||
if ( $req->urldc and $req->urldc ne $self->conf->{portal} ) {
|
if ( $req->urldc and $req->urldc ne $self->conf->{portal} ) {
|
||||||
|
|
|
@ -17,6 +17,8 @@ use strict;
|
||||||
use URI::Escape;
|
use URI::Escape;
|
||||||
use JSON;
|
use JSON;
|
||||||
|
|
||||||
|
has trOverCache => ( is => 'rw', default => sub { {} } );
|
||||||
|
|
||||||
# List constants
|
# List constants
|
||||||
sub authProcess { qw(extractFormInfo getUser authenticate) }
|
sub authProcess { qw(extractFormInfo getUser authenticate) }
|
||||||
|
|
||||||
|
@ -184,8 +186,9 @@ sub logout {
|
||||||
return $self->do(
|
return $self->do(
|
||||||
$req,
|
$req,
|
||||||
[
|
[
|
||||||
'controlUrl', @{ $self->beforeLogout },
|
'importHandlerData', 'controlUrl',
|
||||||
'authLogout', 'deleteSession'
|
@{ $self->beforeLogout }, 'authLogout',
|
||||||
|
'deleteSession'
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -749,23 +752,26 @@ sub sendHtml {
|
||||||
# Override messages
|
# Override messages
|
||||||
my $trOverMessages = JSON::from_json( $self->trOver );
|
my $trOverMessages = JSON::from_json( $self->trOver );
|
||||||
|
|
||||||
opendir( DIR, $templateDir );
|
unless ( $self->trOverCache->{$templateDir} ) {
|
||||||
my @langfiles = grep( /\.json$/, readdir(DIR) );
|
opendir( DIR, $templateDir );
|
||||||
close(DIR);
|
my @langfiles = grep( /\.json$/, readdir(DIR) );
|
||||||
|
close(DIR);
|
||||||
|
|
||||||
foreach my $file (@langfiles) {
|
foreach my $file (@langfiles) {
|
||||||
my ($lang) = ( $file =~ /^(\w+)\.json/ );
|
my ($lang) = ( $file =~ /^(\w+)\.json/ );
|
||||||
$self->logger->debug("Use $file to override messages");
|
$self->logger->debug("Use $file to override messages");
|
||||||
if ( open my $json, "<", $templateDir . "/" . $file ) {
|
if ( open my $json, "<", $templateDir . "/" . $file ) {
|
||||||
local $/ = undef;
|
local $/ = undef;
|
||||||
$trOverMessages->{$lang} = JSON::from_json(<$json>);
|
$trOverMessages->{$lang} = JSON::from_json(<$json>);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$self->logger->error("Unable to read $file");
|
$self->logger->error("Unable to read $file");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->trOverCache->{$templateDir} = JSON::to_json($trOverMessages);
|
||||||
}
|
}
|
||||||
|
$args{params}->{TROVER} = $self->trOverCache->{$templateDir};
|
||||||
$args{params}->{TROVER} = JSON::to_json($trOverMessages);
|
|
||||||
|
|
||||||
my $res = $self->SUPER::sendHtml( $req, $template, %args );
|
my $res = $self->SUPER::sendHtml( $req, $template, %args );
|
||||||
push @{ $res->[1] },
|
push @{ $res->[1] },
|
||||||
|
|
Loading…
Reference in New Issue
Block a user