Bugzilla – Attachment 152220 Details for
Bug 33904
2FA registration fails if library name has non-latin characters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33904: (follow-up) Perltidy
Bug-33904-follow-up-Perltidy.patch (text/plain), 3.03 KB, created by
Katrin Fischer
on 2023-06-08 21:21:25 UTC
(
hide
)
Description:
Bug 33904: (follow-up) Perltidy
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-06-08 21:21:25 UTC
Size:
3.03 KB
patch
obsolete
>From 7b03ba3024bae3321a292c4dc591d93b18f5d538 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 8 Jun 2023 14:53:45 +0100 >Subject: [PATCH] Bug 33904: (follow-up) Perltidy > >With the recent introduction of a community perltidyrc, I felt it >sensible to give the module a tidy with this patch. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/Auth/TwoFactorAuth.pm | 41 ++++++++++++++++++++------------------ > 1 file changed, 22 insertions(+), 19 deletions(-) > >diff --git a/Koha/Auth/TwoFactorAuth.pm b/Koha/Auth/TwoFactorAuth.pm >index 6937ab9060..15a16c42bc 100644 >--- a/Koha/Auth/TwoFactorAuth.pm >+++ b/Koha/Auth/TwoFactorAuth.pm >@@ -53,10 +53,10 @@ It's based on Auth::GoogleAuth > =cut > > sub new { >- my ($class, $params) = @_; >+ my ( $class, $params ) = @_; > my $patron = $params->{patron}; > my $secret32 = $params->{secret32}; >- my $secret = $params->{secret}; >+ my $secret = $params->{secret}; > > # FIXME Raise an exception if the syspref is disabled > >@@ -64,26 +64,28 @@ sub new { > unless $patron && ref($patron) eq 'Koha::Patron'; > > my $type = 'secret32'; >- if( $secret32 ) { >+ if ($secret32) { > Koha::Exceptions::BadParameter->throw("Secret32 should be base32") > if $secret32 =~ /[^a-z2-7]/; >- } elsif( $secret ) { >+ } elsif ($secret) { > $type = 'secret'; >- } elsif( $patron->secret ) { >- $secret32 = $patron->decoded_secret; # saved already in base32 >+ } elsif ( $patron->secret ) { >+ $secret32 = $patron->decoded_secret; # saved already in base32 > } else { > Koha::Exceptions::MissingParameter->throw("No secret passed or patron has no secret"); > } > >- my $issuer = Encode::encode_utf8($patron->library->branchname); >+ my $issuer = Encode::encode_utf8( $patron->library->branchname ); > my $key_id = sprintf "%s_%s", >- $issuer, ( $patron->email || $patron->userid ); >- >- return $class->SUPER::new({ >- $type => $secret32 || $secret, >- issuer => $issuer, >- key_id => $key_id, >- }); >+ $issuer, ( $patron->email || $patron->userid ); >+ >+ return $class->SUPER::new( >+ { >+ $type => $secret32 || $secret, >+ issuer => $issuer, >+ key_id => $key_id, >+ } >+ ); > } > > =head3 qr_code >@@ -97,13 +99,14 @@ sub new { > =cut > > sub qr_code { >- my ( $self ) = @_; >+ my ($self) = @_; >+ >+ my $otpauth = $self->SUPER::qr_code( undef, undef, undef, 1 ); > >- my $otpauth = $self->SUPER::qr_code( undef, undef, undef, 1); >- # no need to pass secret, key and issuer again >+ # no need to pass secret, key and issuer again > my $qrcode = GD::Barcode->new( 'QRcode', $otpauth, { Ecc => 'M', Version => 10, ModuleSize => 4 } ); >- my $data = $qrcode->plot->png; >- return "data:image/png;base64,". encode_base64( $data, q{} ); # does not contain newlines >+ my $data = $qrcode->plot->png; >+ return "data:image/png;base64," . encode_base64( $data, q{} ); # does not contain newlines > } > > 1; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33904
:
152038
|
152039
|
152196
|
152197
|
152198
|
152218
|
152219
|
152220