Change-Id: I20e6fba357b6bfed868edb8030009683b8df29efmr13.3
parent
4bb352e1f8
commit
0bd2c64b98
@ -0,0 +1,13 @@
|
||||
package NGCP::Panel::Block::Login::OtpRegistrationInfo;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
use parent ("NGCP::Panel::Block::Block");
|
||||
|
||||
sub template {
|
||||
my $self = shift;
|
||||
return 'login/otp_registration_info.tt';
|
||||
}
|
||||
|
||||
1;
|
||||
@ -0,0 +1,35 @@
|
||||
package NGCP::Panel::Field::Password;
|
||||
use HTML::FormHandler::Moose;
|
||||
extends 'HTML::FormHandler::Field::Password';
|
||||
|
||||
sub fif {
|
||||
my ( $self, $result ) = @_;
|
||||
return if ( $self->inactive && !$self->_active );
|
||||
#return '' if $self->password;
|
||||
return unless $result || $self->has_result;
|
||||
my $lresult = $result || $self->result;
|
||||
if ( ( $self->has_result && $self->has_input && !$self->fif_from_value ) ||
|
||||
( $self->fif_from_value && !defined $lresult->value ) )
|
||||
{
|
||||
return defined $lresult->input ? $lresult->input : '';
|
||||
}
|
||||
if ( $lresult->has_value ) {
|
||||
my $value;
|
||||
if( $self->_can_deflate ) {
|
||||
$value = $self->_apply_deflation($lresult->value);
|
||||
}
|
||||
else {
|
||||
$value = $lresult->value;
|
||||
}
|
||||
return ( defined $value ? $value : '' );
|
||||
}
|
||||
elsif ( defined $self->value ) {
|
||||
# this is because checkboxes and submit buttons have their own 'value'
|
||||
# needs to be fixed in some better way
|
||||
return $self->value;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
no Moose;
|
||||
1;
|
||||
@ -0,0 +1,56 @@
|
||||
package NGCP::Panel::Form::LoginOtp;
|
||||
|
||||
use HTML::FormHandler::Moose;
|
||||
extends 'HTML::FormHandler';
|
||||
|
||||
use HTML::FormHandler::Widget::Block::Bootstrap;
|
||||
use NGCP::Panel::Field::Password qw();
|
||||
|
||||
has '+widget_wrapper' => ( default => 'Bootstrap' );
|
||||
|
||||
sub build_render_list {
|
||||
my $self = shift;
|
||||
my @list = qw(username password);
|
||||
push(@list,'otp_registration_info') if $self->{ctx}->stash->{'show_otp_registration_info'};
|
||||
push(@list,"otp","submit");
|
||||
return \@list;
|
||||
}
|
||||
sub build_form_tags {{ error_class => 'label label-secondary'}}
|
||||
|
||||
has_field 'username' => (
|
||||
type => 'Text',
|
||||
required => 1,
|
||||
element_attr => { readonly => 1, placeholder => 'Username' },
|
||||
element_class => [qw/login username-field/],
|
||||
wrapper_class => [qw/login-fields field control-group/],
|
||||
);
|
||||
|
||||
has_field 'password' => (
|
||||
type => '+NGCP::Panel::Field::Password',
|
||||
required => 1,
|
||||
element_attr => { readonly => 1, placeholder => 'Password' },
|
||||
element_class => [qw/login password-field/],
|
||||
wrapper_class => [qw/login-fields field control-group/],
|
||||
);
|
||||
|
||||
has_block 'otp_registration_info' => (
|
||||
type => '+NGCP::Panel::Block::Login::OtpRegistrationInfo',
|
||||
);
|
||||
|
||||
has_field 'otp' => (
|
||||
type => 'Text',
|
||||
required => 1,
|
||||
element_attr => { placeholder => 'One-Time Code' },
|
||||
element_class => [qw/login otp-field/],
|
||||
wrapper_class => [qw/login-fields field control-group/],
|
||||
);
|
||||
|
||||
has_field 'submit' => (
|
||||
type => 'Submit',
|
||||
value => 'Sign In',
|
||||
label => '',
|
||||
element_class => [qw/button btn btn-primary btn-large/],
|
||||
);
|
||||
|
||||
1;
|
||||
|
||||
@ -0,0 +1,71 @@
|
||||
package NGCP::Panel::Form::PasswordChangeOtp;
|
||||
|
||||
use HTML::FormHandler::Moose;
|
||||
extends 'HTML::FormHandler';
|
||||
|
||||
use HTML::FormHandler::Widget::Block::Bootstrap;
|
||||
|
||||
has '+widget_wrapper' => ( default => 'Bootstrap' );
|
||||
|
||||
sub build_render_list {
|
||||
my $self = shift;
|
||||
my @list = qw(username password);
|
||||
push(@list,'otp_registration_info') if $self->{ctx}->stash->{'show_otp_registration_info'};
|
||||
push(@list,"otp","new_password","new_password2", "submit");
|
||||
return \@list;
|
||||
}
|
||||
sub build_form_tags {{ error_class => 'label label-secondary'}}
|
||||
|
||||
has_field 'username' => (
|
||||
type => 'Text',
|
||||
required => 1,
|
||||
element_attr => { readonly => 1, placeholder => 'Username' },
|
||||
element_class => [qw/login username-field/],
|
||||
wrapper_class => [qw/login-fields field control-group/],
|
||||
);
|
||||
|
||||
has_field 'password' => (
|
||||
type => '+NGCP::Panel::Field::Password',
|
||||
required => 1,
|
||||
element_attr => { readonly => 1, placeholder => 'Password' },
|
||||
element_class => [qw/login password-field/],
|
||||
wrapper_class => [qw/login-fields field control-group/],
|
||||
);
|
||||
|
||||
has_block 'otp_registration_info' => (
|
||||
type => '+NGCP::Panel::Block::Login::OtpRegistrationInfo',
|
||||
);
|
||||
|
||||
has_field 'otp' => (
|
||||
type => 'Text',
|
||||
required => 1,
|
||||
element_attr => { placeholder => 'One-Time Code' },
|
||||
element_class => [qw/login otp-field/],
|
||||
wrapper_class => [qw/login-fields field control-group/],
|
||||
);
|
||||
|
||||
has_field 'new_password' => (
|
||||
type => 'Password',
|
||||
required => 1,
|
||||
element_attr => { placeholder => 'New Password' },
|
||||
element_class => [qw/login password-field/],
|
||||
wrapper_class => [qw/login-fields field control-group/],
|
||||
);
|
||||
|
||||
has_field 'new_password2' => (
|
||||
type => 'Password',
|
||||
required => 1,
|
||||
element_attr => { placeholder => 'New Password Again' },
|
||||
element_class => [qw/login password-field/],
|
||||
wrapper_class => [qw/login-fields field control-group/],
|
||||
);
|
||||
|
||||
has_field 'submit' => (
|
||||
type => 'Submit',
|
||||
value => 'Submit',
|
||||
label => '',
|
||||
element_class => [qw/button btn btn-primary btn-large/],
|
||||
);
|
||||
|
||||
1;
|
||||
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,17 @@
|
||||
<table width="100%" cellspacing="0" cellpadding="0"><tbody><tr><td>
|
||||
1. Install the <b>Google Authenticator</b> app on you mobile device.
|
||||
</td></tr>
|
||||
<tr><td align="left">
|
||||
<a target="_blank" href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1"><img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png" style="border-radius: 10px; width: 140px; height: 50px;"></a>
|
||||
<a target="_blank" href="https://apps.apple.com/us/app/google-authenticator/id388497605?itsct=apps_box_badge&itscg=30200"><img src="https://tools.applemediaservices.com/api/badges/download-on-the-app-store/black/en-us?size=140x34&releaseDate=1284940800&h=7fc6b39acc8ae5a42ad4b87ff8c7f88d" alt="Download on the App Store" style="border-radius: 10px; width: 140px; height: 34px; padding:8px;"></a>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
2. Open the app to register your NGCP account (scan QR code below).
|
||||
</td></tr>
|
||||
<tr><td align="left">
|
||||
<img src='data:image/png;base64,[% otp_secret_qr_base64 %]'/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
3. Use the app to generate the requested verification code.
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
Loading…
Reference in new issue