Improve code & typo
This commit is contained in:
parent
6c317b9106
commit
385a1c1f38
|
@ -807,6 +807,25 @@ sub tree {
|
|||
'u2fLogo',
|
||||
]
|
||||
},
|
||||
{
|
||||
title => 'yubikey2f',
|
||||
help => 'yubikey2f.html',
|
||||
form => 'simpleInputContainer',
|
||||
nodes => [
|
||||
'yubikey2fActivation',
|
||||
'yubikey2fSelfRegistration',
|
||||
'yubikey2fClientID',
|
||||
'yubikey2fSecretKey',
|
||||
'yubikey2fNonce',
|
||||
'yubikey2fUrl',
|
||||
'yubikey2fPublicIDSize',
|
||||
'yubikey2fUserCanRemoveKey',
|
||||
'yubikey2fTTL',
|
||||
'yubikey2fAuthnLevel',
|
||||
'yubikey2fLabel',
|
||||
'yubikey2fLogo',
|
||||
],
|
||||
},
|
||||
{
|
||||
title => 'mail2f',
|
||||
help => 'mail2f.html',
|
||||
|
@ -854,25 +873,6 @@ sub tree {
|
|||
'rest2fLabel', 'rest2fLogo',
|
||||
]
|
||||
},
|
||||
{
|
||||
title => 'yubikey2f',
|
||||
help => 'yubikey2f.html',
|
||||
form => 'simpleInputContainer',
|
||||
nodes => [
|
||||
'yubikey2fActivation',
|
||||
'yubikey2fSelfRegistration',
|
||||
'yubikey2fClientID',
|
||||
'yubikey2fSecretKey',
|
||||
'yubikey2fNonce',
|
||||
'yubikey2fUrl',
|
||||
'yubikey2fPublicIDSize',
|
||||
'yubikey2fUserCanRemoveKey',
|
||||
'yubikey2fTTL',
|
||||
'yubikey2fAuthnLevel',
|
||||
'yubikey2fLabel',
|
||||
'yubikey2fLogo',
|
||||
],
|
||||
},
|
||||
'sfExtra',
|
||||
{
|
||||
title => 'sfRemovedNotification',
|
||||
|
|
|
@ -817,7 +817,7 @@
|
|||
"sessionStorage":"Stockage des sessions",
|
||||
"sessionTitle":"Contenu de la session",
|
||||
"sfaTitle":"Seconds Facteurs d'Authentification",
|
||||
"sfExtra":"Seconds Facteurs additionnels",
|
||||
"sfExtra":"Seconds facteurs additionnels",
|
||||
"sfRequired":"Exiger 2FA",
|
||||
"sfRemovedNotification":"Afficher un message si un SF expiré a été supprimé",
|
||||
"sfRemovedMsgRule":"Activation",
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,7 +5,7 @@ use strict;
|
|||
use Mouse;
|
||||
use JSON qw(from_json to_json);
|
||||
|
||||
our $VERSION = '2.0.6';
|
||||
our $VERSION = '2.0.8';
|
||||
|
||||
extends 'Lemonldap::NG::Portal::Main::Plugin', 'Lemonldap::NG::Common::TOTP';
|
||||
|
||||
|
@ -133,10 +133,8 @@ sub run {
|
|||
}
|
||||
|
||||
# Loading TOTP secret
|
||||
foreach (@totp2f) {
|
||||
$self->logger->debug("Reading TOTP secret if exists ...");
|
||||
$secret = $_->{_secret};
|
||||
}
|
||||
$self->logger->debug("Reading TOTP secret if exists ...");
|
||||
$secret = $_->{_secret} foreach (@totp2f);
|
||||
|
||||
if ( $token->{_totp2fSecret} eq $secret ) {
|
||||
return $self->p->sendError( $req, 'totpExistingKey', 200 );
|
||||
|
@ -217,10 +215,8 @@ sub run {
|
|||
}
|
||||
|
||||
# Loading TOTP secret
|
||||
foreach (@totp2f) {
|
||||
$self->logger->debug("Reading TOTP secret if exists ...");
|
||||
$secret = $_->{_secret};
|
||||
}
|
||||
$self->logger->debug("Reading TOTP secret if exists ...");
|
||||
$secret = $_->{_secret} foreach (@totp2f);
|
||||
|
||||
if ( ( $req->param('newkey') and $self->conf->{totp2fUserCanChangeKey} )
|
||||
or not $secret )
|
||||
|
@ -274,9 +270,8 @@ sub run {
|
|||
elsif ( $action eq 'delete' ) {
|
||||
|
||||
# Check if unregistration is allowed
|
||||
unless ( $self->conf->{totp2fUserCanRemoveKey} ) {
|
||||
return $self->p->sendError( $req, 'notAuthorized', 400 );
|
||||
}
|
||||
return $self->p->sendError( $req, 'notAuthorized', 400 )
|
||||
unless $self->conf->{totp2fUserCanRemoveKey};
|
||||
|
||||
my $epoch = $req->param('epoch')
|
||||
or return $self->p->sendError( $req, '"epoch" parameter is missing',
|
||||
|
|
|
@ -5,7 +5,7 @@ use strict;
|
|||
use Mouse;
|
||||
use JSON qw(from_json to_json);
|
||||
|
||||
our $VERSION = '2.0.6';
|
||||
our $VERSION = '2.0.8';
|
||||
|
||||
extends 'Lemonldap::NG::Portal::Main::Plugin',
|
||||
'Lemonldap::NG::Portal::Lib::U2F';
|
||||
|
@ -261,9 +261,8 @@ sub run {
|
|||
elsif ( $action eq 'delete' ) {
|
||||
|
||||
# Check if unregistration is allowed
|
||||
unless ( $self->conf->{u2fUserCanRemoveKey} ) {
|
||||
return $self->p->sendError( $req, 'notAuthorized', 200 );
|
||||
}
|
||||
return $self->p->sendError( $req, 'notAuthorized', 200 )
|
||||
unless $self->conf->{u2fUserCanRemoveKey};
|
||||
|
||||
my $epoch = $req->param('epoch')
|
||||
or return $self->p->sendError( $req, '"epoch" parameter is missing',
|
||||
|
@ -371,9 +370,8 @@ sub loadUser {
|
|||
'U2F error: ' . Crypt::U2F::Server::u2fclib_getError() );
|
||||
}
|
||||
}
|
||||
unless (@crypters) {
|
||||
return -1;
|
||||
}
|
||||
return -1 unless @crypters;
|
||||
|
||||
$req->data->{crypter} = \@crypters;
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
|
|||
PE_ERROR
|
||||
);
|
||||
|
||||
our $VERSION = '2.0.6';
|
||||
our $VERSION = '2.0.8';
|
||||
|
||||
extends 'Lemonldap::NG::Portal::Main::Plugin';
|
||||
|
||||
|
@ -32,10 +32,9 @@ sub init {
|
|||
sub run {
|
||||
my ( $self, $req, $action ) = @_;
|
||||
my $user = $req->userData->{ $self->conf->{whatToTrace} };
|
||||
unless ($user) {
|
||||
return $self->p->sendError( $req,
|
||||
'No ' . $self->conf->{whatToTrace} . ' found in user data', 500 );
|
||||
}
|
||||
return $self->p->sendError( $req,
|
||||
'No ' . $self->conf->{whatToTrace} . ' found in user data', 500 )
|
||||
unless $user;
|
||||
|
||||
if ( $action eq 'register' ) {
|
||||
my $otp = $req->param('otp');
|
||||
|
@ -154,9 +153,8 @@ sub run {
|
|||
elsif ( $action eq 'delete' ) {
|
||||
|
||||
# Check if unregistration is allowed
|
||||
unless ( $self->conf->{yubikey2fUserCanRemoveKey} ) {
|
||||
return $self->p->sendError( $req, 'notAuthorized', 400 );
|
||||
}
|
||||
return $self->p->sendError( $req, 'notAuthorized', 400 )
|
||||
unless $self->conf->{yubikey2fUserCanRemoveKey};
|
||||
|
||||
my $epoch = $req->param('epoch')
|
||||
or return $self->p->sendError( $req, '"epoch" parameter is missing',
|
||||
|
|
|
@ -16,7 +16,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
|
|||
PE_U2FFAILED
|
||||
);
|
||||
|
||||
our $VERSION = '2.0.0';
|
||||
our $VERSION = '2.0.8';
|
||||
|
||||
extends 'Lemonldap::NG::Portal::Main::SecondFactor',
|
||||
'Lemonldap::NG::Portal::Lib::U2F';
|
||||
|
@ -43,6 +43,7 @@ sub init {
|
|||
return 0
|
||||
unless ( $self->Lemonldap::NG::Portal::Main::SecondFactor::init()
|
||||
and $self->Lemonldap::NG::Portal::Lib::U2F::init() );
|
||||
|
||||
1;
|
||||
}
|
||||
|
||||
|
@ -71,12 +72,9 @@ sub run {
|
|||
}
|
||||
|
||||
# Get registered keys
|
||||
my @rk;
|
||||
foreach ( @{ $req->data->{crypter} } ) {
|
||||
push @rk,
|
||||
{ keyHandle => $_->{keyHandle}, version => $data->{version} };
|
||||
|
||||
}
|
||||
my @rk =
|
||||
map { { keyHandle => $_->{keyHandle}, version => $data->{version} } }
|
||||
@{ $req->data->{crypter} };
|
||||
|
||||
$self->ott->updateToken( $token, __ch => $data->{challenge} );
|
||||
|
||||
|
@ -247,9 +245,8 @@ sub loadUser {
|
|||
'U2F error: ' . Crypt::U2F::Server::u2fclib_getError() );
|
||||
}
|
||||
}
|
||||
unless (@crypters) {
|
||||
return -1;
|
||||
}
|
||||
return -1 unless (@crypters);
|
||||
|
||||
$req->data->{crypter} = \@crypters;
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ use JSON qw(from_json to_json);
|
|||
use Lemonldap::NG::Portal::Main::Constants qw(
|
||||
);
|
||||
|
||||
our $VERSION = '2.0.0';
|
||||
our $VERSION = '2.0.8';
|
||||
|
||||
extends 'Lemonldap::NG::Portal::Main::SecondFactor';
|
||||
|
||||
|
@ -86,12 +86,10 @@ sub run {
|
|||
}
|
||||
|
||||
# Get registered keys
|
||||
my @rk;
|
||||
foreach ( @{ $req->data->{crypter} } ) {
|
||||
push @rk,
|
||||
{ keyHandle => $_->{keyHandle}, version => $data->{version} };
|
||||
|
||||
}
|
||||
my @rk =
|
||||
map {
|
||||
{ keyHandle => $_->{keyHandle}, version => $data->{version} }
|
||||
} @{ $req->data->{crypter} };
|
||||
|
||||
$self->ott->updateToken( $token, __ch => $data->{challenge} );
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ displayError = (j, status, err) ->
|
|||
console.log 'Error', err
|
||||
res = JSON.parse j.responseText
|
||||
if res and res.error
|
||||
res = res.error.replace /.* /, ''
|
||||
res = res.error.replace(/.* /, '')
|
||||
console.log 'Returned error', res
|
||||
setMsg res, 'warning'
|
||||
|
||||
|
@ -83,7 +83,5 @@ verify = ->
|
|||
|
||||
$(document).ready ->
|
||||
getKey(0)
|
||||
$('#changekey').on 'click', () ->
|
||||
getKey(1)
|
||||
$('#verify').on 'click', () ->
|
||||
verify()
|
||||
$('#changekey').on 'click', () -> getKey(1)
|
||||
$('#verify').on 'click', () -> verify()
|
||||
|
|
|
@ -13,7 +13,7 @@ displayError = (j, status, err) ->
|
|||
console.log 'Error', err
|
||||
res = JSON.parse j.responseText
|
||||
if res and res.error
|
||||
res = res.error.replace /.* /, ''
|
||||
res = res.error.replace(/.* /, '')
|
||||
console.log 'Returned error', res
|
||||
setMsg res, 'warning'
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
"PE41":"Ouverture de session interdite",
|
||||
"PE42":"Confirmation demandée",
|
||||
"PE43":"L'adresse mail est obligatoire",
|
||||
"PE44":"La clé de confirmation est invalide ou trop ancienne",
|
||||
"PE44":"La clef de confirmation est invalide ou trop ancienne",
|
||||
"PE45":"L'envoi du mail a échoué",
|
||||
"PE46":"Un mail vous a été envoyé",
|
||||
"PE47":"Vous avez été déconnecté",
|
||||
|
@ -271,7 +271,7 @@
|
|||
"touchU2fDeviceOrEnterTotp": "Posez votre doigt sur le périphérique U2F ou entrez le code TOTP",
|
||||
"type":"Type",
|
||||
"UA":"Agent utlisateur",
|
||||
"u2f":"Clé U2F",
|
||||
"u2f":"Clef U2F",
|
||||
"u2fFailed": "La vérification U2F a échoué. Réessayez ou contactez votre administrateur",
|
||||
"u2fPermission": "Il est possible qu'on vous demande d'autoriser le site à accéder à votre clef. Après votre accord, la clef clignotera.",
|
||||
"u2fWelcome": "Gestion du périphérique U2F",
|
||||
|
|
Loading…
Reference in New Issue
Block a user