Typo
This commit is contained in:
parent
e3336d8117
commit
df83595e8e
|
@ -11,7 +11,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
|
||||||
|
|
||||||
extends 'Lemonldap::NG::Portal::Lib::LDAP';
|
extends 'Lemonldap::NG::Portal::Lib::LDAP';
|
||||||
|
|
||||||
our $VERSION = '2.0.0';
|
our $VERSION = '2.1.0';
|
||||||
|
|
||||||
# RUNNING METHODS
|
# RUNNING METHODS
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ use constant {
|
||||||
PE_IMPERSONATION_SERVICE_NOT_ALLOWED => 93,
|
PE_IMPERSONATION_SERVICE_NOT_ALLOWED => 93,
|
||||||
PE_ISSUERMISSINGREQATTR => 94,
|
PE_ISSUERMISSINGREQATTR => 94,
|
||||||
PE_RESETCERTIFICATE_INVALID => 95,
|
PE_RESETCERTIFICATE_INVALID => 95,
|
||||||
PE_RESETCERTIFICATE_FOREMPTY => 96,
|
PE_RESETCERTIFICATE_FORMEMPTY => 96,
|
||||||
PE_RESETCERTIFICATE_FIRSTACCESS => 97,
|
PE_RESETCERTIFICATE_FIRSTACCESS => 97,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ sub portalConsts {
|
||||||
'93' => 'PE_IMPERSONATION_SERVICE_NOT_ALLOWED',
|
'93' => 'PE_IMPERSONATION_SERVICE_NOT_ALLOWED',
|
||||||
'94' => 'PE_ISSUERMISSINGREQATTR',
|
'94' => 'PE_ISSUERMISSINGREQATTR',
|
||||||
'95' => 'PE_RESETCERTIFICATE_INVALID',
|
'95' => 'PE_RESETCERTIFICATE_INVALID',
|
||||||
'96' => 'PE_RESETCERTIFICATE_FOREMPTY',
|
'96' => 'PE_RESETCERTIFICATE_FORMEMPTY',
|
||||||
'97' => 'PE_RESETCERTIFICATE_FIRSTACCESS'
|
'97' => 'PE_RESETCERTIFICATE_FIRSTACCESS'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ our @EXPORT_OK = (
|
||||||
'PE_IMPERSONATION_SERVICE_NOT_ALLOWED',
|
'PE_IMPERSONATION_SERVICE_NOT_ALLOWED',
|
||||||
'PE_ISSUERMISSINGREQATTR',
|
'PE_ISSUERMISSINGREQATTR',
|
||||||
'PE_RESETCERTIFICATE_INVALID',
|
'PE_RESETCERTIFICATE_INVALID',
|
||||||
'PE_RESETCERTIFICATE_FOREMPTY',
|
'PE_RESETCERTIFICATE_FORMEMPTY',
|
||||||
'PE_RESETCERTIFICATE_FIRSTACCESS'
|
'PE_RESETCERTIFICATE_FIRSTACCESS'
|
||||||
);
|
);
|
||||||
our %EXPORT_TAGS = ( 'all' => [ @EXPORT_OK, 'import' ], );
|
our %EXPORT_TAGS = ( 'all' => [ @EXPORT_OK, 'import' ], );
|
||||||
|
|
|
@ -108,7 +108,7 @@ sub error_type {
|
||||||
PE_CONFIRM, PE_MAILFORMEMPTY,
|
PE_CONFIRM, PE_MAILFORMEMPTY,
|
||||||
PE_MAILCONFIRMATION_ALREADY_SENT, PE_PASSWORDFORMEMPTY,
|
PE_MAILCONFIRMATION_ALREADY_SENT, PE_PASSWORDFORMEMPTY,
|
||||||
PE_CAPTCHAEMPTY, PE_REGISTERFORMEMPTY,
|
PE_CAPTCHAEMPTY, PE_REGISTERFORMEMPTY,
|
||||||
PE_PP_CHANGE_AFTER_RESET, PE_RESETCERTIFICATE_FOREMPTY,
|
PE_PP_CHANGE_AFTER_RESET, PE_RESETCERTIFICATE_FORMEMPTY,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -30,7 +30,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
|
||||||
PE_TOKENEXPIRED
|
PE_TOKENEXPIRED
|
||||||
PE_USERNOTFOUND
|
PE_USERNOTFOUND
|
||||||
PE_RESETCERTIFICATE_INVALID
|
PE_RESETCERTIFICATE_INVALID
|
||||||
PE_RESETCERTIFICATE_FOREMPTY
|
PE_RESETCERTIFICATE_FORMEMPTY
|
||||||
PE_RESETCERTIFICATE_FIRSTACCESS
|
PE_RESETCERTIFICATE_FIRSTACCESS
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -61,7 +61,6 @@ has registerModule => ( is => 'rw' );
|
||||||
has captcha => ( is => 'rw' );
|
has captcha => ( is => 'rw' );
|
||||||
|
|
||||||
# certificate reset url
|
# certificate reset url
|
||||||
|
|
||||||
has certificateResetUrl => (
|
has certificateResetUrl => (
|
||||||
is => 'rw',
|
is => 'rw',
|
||||||
lazy => 1,
|
lazy => 1,
|
||||||
|
@ -132,13 +131,9 @@ sub _certificateReset {
|
||||||
my ( $mailToken, %tplPrms );
|
my ( $mailToken, %tplPrms );
|
||||||
|
|
||||||
# CertificatReset FORM => modifyCertificate()
|
# CertificatReset FORM => modifyCertificate()
|
||||||
if (
|
if ( $req->method =~ /^POST$/i
|
||||||
$req->method =~ /^POST$/i
|
and ( $req->uploads->{certif} ) )
|
||||||
|
|
||||||
and ( $req->uploads->{certif} )
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
my $upload = $req->uploads->{certif};
|
my $upload = $req->uploads->{certif};
|
||||||
|
|
||||||
return $self->modifyCertificate($req);
|
return $self->modifyCertificate($req);
|
||||||
|
@ -177,7 +172,7 @@ sub _certificateReset {
|
||||||
$searchByMail = 0 unless ( $req->{user} =~ /\@/ );
|
$searchByMail = 0 unless ( $req->{user} =~ /\@/ );
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check for values posted
|
# Check for posted values
|
||||||
else {
|
else {
|
||||||
|
|
||||||
# Use submitted value
|
# Use submitted value
|
||||||
|
@ -340,12 +335,10 @@ sub _certificateReset {
|
||||||
'Reset mail already sent to ' . $req->{user} );
|
'Reset mail already sent to ' . $req->{user} );
|
||||||
|
|
||||||
# Return mail already sent only if it is allowed at previous step
|
# Return mail already sent only if it is allowed at previous step
|
||||||
|
|
||||||
if ( $self->conf->{portalErrorOnMailNotFound} ) {
|
if ( $self->conf->{portalErrorOnMailNotFound} ) {
|
||||||
$self->setSecurity($req);
|
$self->setSecurity($req);
|
||||||
return PE_MAILCONFIRMATION_ALREADY_SENT;
|
return PE_MAILCONFIRMATION_ALREADY_SENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get mail address
|
# Get mail address
|
||||||
|
@ -420,7 +413,7 @@ sub _certificateReset {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
return PE_RESETCERTIFICATE_FIRSTACCESS if ( $req->method eq 'GET' );
|
return PE_RESETCERTIFICATE_FIRSTACCESS if ( $req->method eq 'GET' );
|
||||||
return PE_RESETCERTIFICATE_FOREMPTY;
|
return PE_RESETCERTIFICATE_FORMEMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub modifyCertificate {
|
sub modifyCertificate {
|
||||||
|
@ -458,8 +451,7 @@ sub modifyCertificate {
|
||||||
|
|
||||||
#Updload certificate
|
#Updload certificate
|
||||||
my $upload = $req->uploads->{certif};
|
my $upload = $req->uploads->{certif};
|
||||||
|
unless ( $upload->size > 0 ) { return PE_RESETCERTIFICATE_FORMEMPTY; }
|
||||||
unless ( $upload->size > 0 ) { return PE_RESETCERTIFICATE_FOREMPTY; }
|
|
||||||
|
|
||||||
# Get Certificate
|
# Get Certificate
|
||||||
|
|
||||||
|
@ -498,7 +490,7 @@ sub modifyCertificate {
|
||||||
"Certificate will expire after $notAfter, Issuer $x509issuer and serialNumber $x509serial"
|
"Certificate will expire after $notAfter, Issuer $x509issuer and serialNumber $x509serial"
|
||||||
);
|
);
|
||||||
|
|
||||||
# Check Certificate Validity befor store
|
# Check Certificate Validity before store
|
||||||
if (
|
if (
|
||||||
$self->checkCertificateValidity( $notAfter,
|
$self->checkCertificateValidity( $notAfter,
|
||||||
$self->conf->{certificateResetByMailValidityDelay} ) == 0
|
$self->conf->{certificateResetByMailValidityDelay} ) == 0
|
||||||
|
@ -512,7 +504,7 @@ sub modifyCertificate {
|
||||||
#return PE_PASSWORD_MISMATCH;
|
#return PE_PASSWORD_MISMATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build serial number hex exemple f3:08:52:63:28:29:fa:e2
|
# Build serial number hex: example f3:08:52:63:28:29:fa:e2
|
||||||
|
|
||||||
my @numberstring = split //, lc($x509serial);
|
my @numberstring = split //, lc($x509serial);
|
||||||
my $serial = "";
|
my $serial = "";
|
||||||
|
@ -534,11 +526,9 @@ sub modifyCertificate {
|
||||||
$self->userLogger->debug( "Description:: " . $certificatExactAssertion );
|
$self->userLogger->debug( "Description:: " . $certificatExactAssertion );
|
||||||
|
|
||||||
# Get attribut userCertificate;binary value
|
# Get attribut userCertificate;binary value
|
||||||
|
|
||||||
my $cert = $self->certificateHash($file);
|
my $cert = $self->certificateHash($file);
|
||||||
|
|
||||||
# modif the ldap certificate attribute
|
# modif the ldap certificate attribute
|
||||||
|
|
||||||
$req->user( $req->{sessionInfo}->{_user} );
|
$req->user( $req->{sessionInfo}->{_user} );
|
||||||
my $result =
|
my $result =
|
||||||
$self->registerModule->modifCertificate( $certificatExactAssertion,
|
$self->registerModule->modifCertificate( $certificatExactAssertion,
|
||||||
|
@ -690,7 +680,7 @@ sub display {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Display Certificate Reset form again if certificate invalid
|
# Display Certificate Reset form again if certificate invalid
|
||||||
elsif ($req->error == PE_RESETCERTIFICATE_FOREMPTY
|
elsif ($req->error == PE_RESETCERTIFICATE_FORMEMPTY
|
||||||
|| $req->error == PE_RESETCERTIFICATE_INVALID )
|
|| $req->error == PE_RESETCERTIFICATE_INVALID )
|
||||||
{
|
{
|
||||||
$self->logger->debug('Display Certificate Reset form');
|
$self->logger->debug('Display Certificate Reset form');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user