From: Nahuel ANGELINETTI Date: Tue, 29 Sep 2009 09:19:07 +0000 (+0200) Subject: (bug #3674) allow users creation with disabled password X-Git-Tag: v3.00.04_final~63 X-Git-Url: http://git.rot13.org/?p=koha.git;a=commitdiff_plain;h=ce353e7230ba032565ed5d4a92dd3a69d705f910 (bug #3674) allow users creation with disabled password --- diff --git a/C4/Auth.pm b/C4/Auth.pm index ff238fcb56..dc328c482a 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1237,7 +1237,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 4ac99177c7..f5a360e803 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -655,8 +655,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