[Koha-cvs] koha/C4 Auth.pm [rel_2_2]

Henri-Damien LAURENT laurenthdl at alinto.com
Wed Apr 5 17:43:27 CEST 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch: 	rel_2_2
Changes by:	Henri-Damien LAURENT <hdl at savannah.gnu.org>	06/04/05 15:43:27

Modified files:
	C4             : Auth.pm 

Log message:
	Bugfixing declaring $branchname.
	Changing Union for left join.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Auth.pm.diff?only_with_tag=rel_2_2&tr1=1.36.2.13&tr2=1.36.2.14&r1=text&r2=text

Patches:
Index: koha/C4/Auth.pm
diff -u koha/C4/Auth.pm:1.36.2.13 koha/C4/Auth.pm:1.36.2.14
--- koha/C4/Auth.pm:1.36.2.13	Wed Apr  5 15:06:58 2006
+++ koha/C4/Auth.pm	Wed Apr  5 15:43:27 2006
@@ -403,13 +403,13 @@
 					C4::Context->_unset_userenv($sessionID);
 			}
 			if ($return == 1){
-				my ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress);
-				my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,borrowers.branchcode,branchname,emailaddress from borrowers,branches where borrowers.branchcode=branches.branchcode and userid=?");
+				my ($bornum,$firstname,$surname,$userflags,$branchcode,$branchname,$emailaddress);
+				my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,borrowers.branchcode,branchname,emailaddress from borrowers left join branches on borrowers.branchcode=branches.branchcode where userid=?");
 				$sth->execute($userid);
 				($bornum,$firstname,$surname,$userflags,$branchcode,$branchname, $emailaddress) = $sth->fetchrow if ($sth->rows);
 # 				warn "$cardnumber,$bornum,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress";
 				unless ($sth->rows){
-					my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,borrowers.branchcode,branchname,emailaddress from borrowers,branches where borrowers.branchcode=branches.branchcode and cardnumber=?");
+					my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,borrowers.branchcode,branchname,emailaddress from borrowers left join branches on borrowers.branchcode=branches.branchcode where cardnumber=?");
 					$sth->execute($cardnumber);
 					($bornum,$firstname,$surname,$userflags,$branchcode, $branchname,$emailaddress) = $sth->fetchrow if ($sth->rows);
 # 					warn "$cardnumber,$bornum,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress";





More information about the Koha-cvs mailing list