From ce353e7230ba032565ed5d4a92dd3a69d705f910 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Tue, 29 Sep 2009 11:19:07 +0200 Subject: [PATCH] (bug #3674) allow users creation with disabled password --- 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 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 -- 2.39.5