Bug 14507 [QA Followup] - Restore comment, tidy sub
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 19 Feb 2016 12:51:21 +0000 (12:51 +0000)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Wed, 24 Feb 2016 00:09:13 +0000 (00:09 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
C4/SIP/ILS/Patron.pm

index fe21903..33653b9 100644 (file)
@@ -192,17 +192,17 @@ sub AUTOLOAD {
 }
 
 sub check_password {
-    my ($self, $pwd) = @_;
+    my ( $self, $pwd ) = @_;
 
-    defined $pwd or return 0;                  # you gotta give me something (at least ''), or no deal
+    defined $pwd
+      or return 0;    # you gotta give me something (at least ''), or no deal
 
-    if ($pwd eq q{}) {
-        return 1;
-    }
+    return 1
+      if $pwd eq q{};    # if the record has a NULL password, accept '' as match
 
     my $dbh = C4::Context->dbh;
     my $ret = 0;
-    ($ret) = checkpw($dbh, $self->{userid}, $pwd);
+    ($ret) = checkpw( $dbh, $self->{userid}, $pwd );
     return $ret;
 }