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

Henri-Damien LAURENT laurenthdl at alinto.com
Wed Apr 5 17:06:59 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:06:59

Modified files:
	C4             : Auth.pm Context.pm 

Log message:
	Adding branchname to userenv.

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

Patches:
Index: koha/C4/Auth.pm
diff -u koha/C4/Auth.pm:1.36.2.12 koha/C4/Auth.pm:1.36.2.13
--- koha/C4/Auth.pm:1.36.2.12	Wed Apr  5 14:54:33 2006
+++ koha/C4/Auth.pm	Wed Apr  5 15:06:58 2006
@@ -317,6 +317,7 @@
 					$hash{firstname},
 					$hash{surname},
 					$hash{branch},
+					$hash{branchname},
 					$hash{flags},
 					$hash{emailaddress},
 				);
@@ -403,18 +404,18 @@
 			}
 			if ($return == 1){
 				my ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress);
-				my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,branchcode,emailaddress from borrowers where userid=?");
+				my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,borrowers.branchcode,branchname,emailaddress from borrowers,branches where borrowers.branchcode=branches.branchcode and userid=?");
 				$sth->execute($userid);
-				($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows);
+				($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,branchcode,emailaddress from borrowers where cardnumber=?");
+					my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,borrowers.branchcode,branchname,emailaddress from borrowers,branches where borrowers.branchcode=branches.branchcode and cardnumber=?");
 					$sth->execute($cardnumber);
-					($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows);
+					($bornum,$firstname,$surname,$userflags,$branchcode, $branchname,$emailaddress) = $sth->fetchrow if ($sth->rows);
 # 					warn "$cardnumber,$bornum,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress";
 					unless ($sth->rows){
 						$sth->execute($userid);
-						($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows);
+						($bornum,$firstname,$surname,$userflags,$branchcode, $branchname, $emailaddress) = $sth->fetchrow if ($sth->rows);
 					}
 # 					warn "$cardnumber,$bornum,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress";
 				}
@@ -425,6 +426,7 @@
 					$firstname,
 					$surname,
 					$branchcode,
+					$branchname, 
 					$userflags,
 					$emailaddress,
 				);
@@ -439,7 +441,7 @@
 					C4::Context->config('user'),
 					C4::Context->config('user'),
 					C4::Context->config('user'),
-					"",1,C4::Context->preference('KohaAdminEmailAddress')
+					"","",1,C4::Context->preference('KohaAdminEmailAddress')
 				);
 				$envcookie=$query->cookie(-name => 'userenv',
 						-value => $hash,
Index: koha/C4/Context.pm
diff -u koha/C4/Context.pm:1.18.2.4 koha/C4/Context.pm:1.18.2.5
--- koha/C4/Context.pm:1.18.2.4	Thu Sep  1 12:26:19 2005
+++ koha/C4/Context.pm	Wed Apr  5 15:06:58 2006
@@ -15,7 +15,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Context.pm,v 1.18.2.4 2005/09/01 12:26:19 hdl Exp $
+# $Id: Context.pm,v 1.18.2.5 2006/04/05 15:06:58 hdl Exp $
 # Revision History:
 # 2004-08-11 A. Tarallo: Added the function db_escheme2dbi, tested my bugfixes,
 # further  details about them in the code.
@@ -31,7 +31,7 @@
 	qw($context),
 	qw(@context_stack);
 
-$VERSION = do { my @v = '$Revision: 1.18.2.4 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.18.2.5 $' =~ /\d+/g;
 		shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
@@ -635,7 +635,7 @@
 =cut
 #'
 sub set_userenv{
-	my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $userflags, $emailaddress)= @_;
+	my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $userbranchname, $userflags, $emailaddress)= @_;
 	my $var=$context->{"activeuser"};
 	my $cell = {
 		"number"     => $usernum,
@@ -645,6 +645,7 @@
 #		"surname"    => $usersurname,
 #possibly a law problem
 		"branch"     => $userbranch,
+		"branchname"     => $userbranchname,
 		"flags"      => $userflags,
 		"emailaddress"	=> $emailaddress,
 	};





More information about the Koha-cvs mailing list