3.0.x: ce353e7 bug #3674 allow users creation with disabled password
authorHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 20 Oct 2009 13:09:51 +0000 (15:09 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 20 Oct 2009 13:09:51 +0000 (15:09 +0200)
C4/Members.pm

index 4b525f0..da1bf37 100644 (file)
@@ -680,7 +680,7 @@ Returns the borrowernumber
 sub AddMember {
     my (%data) = @_;
     my $dbh = C4::Context->dbh;
-    $data{'userid'} = '' unless $data{'password'};
+    $data{'password'} = '!' if (not $data{'password'} and $data{'userid'});
     $data{'password'} = md5_base64( $data{'password'} ) if $data{'password'};
        $data{'borrowernumber'}=InsertInTable("borrowers",\%data);      
     # mysql_insertid is probably bad.  not necessarily accurate and mysql-specific at best.