[Koha-patches] [PATCH] (bug #3674) allow users creation with disabled password

Nahuel ANGELINETTI nahuel.angelinetti at biblibre.com
Tue Sep 29 11:19:51 CEST 2009


---
 C4/Auth.pm    |    2 +-
 C4/Members.pm |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/C4/Auth.pm b/C4/Auth.pm
index eb7a464..9429ea9 100644
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -1222,7 +1222,7 @@ sub checkpw {
         my ( $md5password, $cardnumber, $borrowernumber, $userid, $firstname,
             $surname, $branchcode, $flags )
           = $sth->fetchrow;
-        if ( md5_base64($password) eq $md5password ) {
+        if ( ( md5_base64($password) eq $md5password ) and ($md5password ne "!") ) {
 
             C4::Context->set_userenv( "$borrowernumber", $userid, $cardnumber,
                 $firstname, $surname, $branchcode, $flags );
diff --git a/C4/Members.pm b/C4/Members.pm
index d44d55f..fcc689e 100644
--- a/C4/Members.pm
+++ b/C4/Members.pm
@@ -696,8 +696,9 @@ Returns the borrowernumber
 sub AddMember {
     my (%data) = @_;
     my $dbh = C4::Context->dbh;
-    $data{'userid'} = '' unless $data{'password'};
+
     $data{'password'} = md5_base64( $data{'password'} ) if $data{'password'};
+    $data{'password'} = '!' if (not $data{'password'} and $data{'userid'});
     
     # WE SHOULD NEVER PASS THIS SUBROUTINE ANYTHING OTHER THAN ISO DATES
     # IF YOU UNCOMMENT THESE LINES YOU BETTER HAVE A DARN COMPELLING REASON
-- 
1.6.0.4




More information about the Koha-patches mailing list