rememberAuthChoice: fix default values + prepare reconciliation with v2.0 (#2737)
This commit is contained in:
parent
a9092eaa3f
commit
fe6a762f1f
|
@ -10,12 +10,13 @@ use Mouse;
|
|||
use JSON;
|
||||
use URI;
|
||||
|
||||
has isPP => ( is => 'rw' );
|
||||
has speChars => ( is => 'rw' );
|
||||
has skinRules => ( is => 'rw' );
|
||||
has stayConnected => ( is => 'rw', default => sub { 0 } );
|
||||
has requireOldPwd => ( is => 'rw', default => sub { 1 } );
|
||||
has rememberAuthChoice => ( is => 'rw', default => sub { 0 } );
|
||||
has isPP => ( is => 'rw' );
|
||||
has speChars => ( is => 'rw' );
|
||||
has skinRules => ( is => 'rw' );
|
||||
has stayConnected => ( is => 'rw', default => sub { 0 } );
|
||||
has requireOldPwd => ( is => 'rw', default => sub { 1 } );
|
||||
has rememberAuthChoice => ( is => 'rw', default => sub { 0 } );
|
||||
has passwordPolicyActivation => ( is => 'rw', default => sub { 0 } );
|
||||
|
||||
sub displayInit {
|
||||
my ($self) = @_;
|
||||
|
@ -49,6 +50,14 @@ sub displayInit {
|
|||
$self->logger->error("Bad stayConnected rule: $error");
|
||||
}
|
||||
$self->stayConnected($rule);
|
||||
$rule =
|
||||
HANDLER->buildSub(
|
||||
HANDLER->substitute( $self->conf->{passwordPolicyActivation} ) );
|
||||
unless ($rule) {
|
||||
my $error = HANDLER->tsv->{jail}->error || 'Unable to compile rule';
|
||||
$self->logger->error("Bad passwordPolicyActivation rule: $error");
|
||||
}
|
||||
$self->passwordPolicyActivation($rule);
|
||||
|
||||
$rule =
|
||||
HANDLER->buildSub( HANDLER->substitute( $self->conf->{rememberAuthChoiceRule} ) );
|
||||
|
@ -426,9 +435,9 @@ sub display {
|
|||
? ( REMEMBERAUTHCHOICE => 1 )
|
||||
: ()
|
||||
),
|
||||
REMEMBERAUTHCHOICEDEFAULTCHECKED => $self->conf->{rememberDefaultChecked} || 0,
|
||||
REMEMBERAUTHCHOICECOOKIENAME => $self->conf->{rememberCookieName} || 'llngrememberauthchoice',
|
||||
REMEMBERAUTHCHOICETIMER => $self->conf->{rememberTimer} || 5,
|
||||
REMEMBERAUTHCHOICEDEFAULTCHECKED => $self->conf->{rememberDefaultChecked} // 0,
|
||||
REMEMBERAUTHCHOICECOOKIENAME => $self->conf->{rememberCookieName} // 'llngrememberauthchoice',
|
||||
REMEMBERAUTHCHOICETIMER => $self->conf->{rememberTimer} // 5,
|
||||
(
|
||||
$req->data->{customScript}
|
||||
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
|
||||
|
@ -491,7 +500,7 @@ sub display {
|
|||
CHOICE_PARAM => $self->conf->{authChoiceParam},
|
||||
CHOICE_VALUE => $req->data->{_authChoice},
|
||||
OLDPASSWORD => $self->checkXSSAttack( 'oldpassword',
|
||||
$req->data->{oldpassword} ) ? ""
|
||||
$req->data->{oldpassword} ) ? ''
|
||||
: $req->data->{oldpassword},
|
||||
HIDE_OLDPASSWORD => $self->conf->{hideOldPassword},
|
||||
DONT_STORE_PASSWORD => $self->conf->{browsersDontStorePassword},
|
||||
|
|
|
@ -21,27 +21,11 @@ use constant beforeAuth => 'checkRememberedAuthChoice';
|
|||
|
||||
has rule => ( is => 'rw', default => sub { 0 } );
|
||||
|
||||
has rememberDefaultChecked => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->conf->{rememberDefaultChecked} || 0;
|
||||
}
|
||||
);
|
||||
|
||||
has rememberTimer => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->conf->{rememberTimer} || 5;
|
||||
}
|
||||
);
|
||||
|
||||
has rememberCookieName => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->conf->{rememberCookieName} || 'llngrememberauthchoice';
|
||||
$_[0]->conf->{rememberCookieName} // 'llngrememberauthchoice';
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -50,7 +34,7 @@ has rememberCookieTimeout => (
|
|||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->conf->{rememberCookieTimeout} || 31536000;
|
||||
$_[0]->conf->{rememberCookieTimeout} // 31536000;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue