View | Details | Raw Unified | Return to bug 3674
Collapse All | Expand All

(-)a/C4/Members.pm (-3 / +4 lines)
Lines 800-807 Returns the borrowernumber Link Here
800
sub AddMember {
800
sub AddMember {
801
    my (%data) = @_;
801
    my (%data) = @_;
802
    my $dbh = C4::Context->dbh;
802
    my $dbh = C4::Context->dbh;
803
    $data{'userid'} = '' unless $data{'password'};
803
	# generate a proper login if none provided
804
    $data{'password'} = md5_base64( $data{'password'} ) if $data{'password'};
804
	$data{'userid'} = Generate_Userid($data{'borrowernumber'}, $data{'firstname'}, $data{'surname'}) if $data{'userid'} eq '';
805
	# create a disabled account if no password provided
806
	$data{'password'} = ($data{'password'})? md5_base64($data{'password'}) : '!';
805
	$data{'borrowernumber'}=InsertInTable("borrowers",\%data);	
807
	$data{'borrowernumber'}=InsertInTable("borrowers",\%data);	
806
    # mysql_insertid is probably bad.  not necessarily accurate and mysql-specific at best.
808
    # mysql_insertid is probably bad.  not necessarily accurate and mysql-specific at best.
807
    logaction("MEMBERS", "CREATE", $data{'borrowernumber'}, "") if C4::Context->preference("BorrowersLog");
809
    logaction("MEMBERS", "CREATE", $data{'borrowernumber'}, "") if C4::Context->preference("BorrowersLog");
808
- 

Return to bug 3674