[interchange-cvs] interchange - heins modified 5 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Mon Nov 18 11:56:01 2002


User:      heins
Date:      2002-11-18 16:55:15 GMT
Modified:  lib/Vend Dispatch.pm Order.pm SOAP.pm Session.pm
Modified:  lib/Vend/Payment WellsFargo.pm
Log:
* Allow alternate values spaces with $CGI->{mv_values_space}. This allows
  fill-in wizards, surveys, and such to not pollute the user's normal
  values.

  Use with caution -- if someone is in the practice of using $Values
  to set catalog behavior (usually a poor idea) then it can cause
  anomalies.

* Clean up a few references to $Vend::Session->{values} which should
  never be done anymore -- we had handled almost all of this previously.
  It should always reference $::Values.

Revision  Changes    Path
1.7       +6 -2      interchange/lib/Vend/Dispatch.pm


rev 1.7, prev_rev 1.6
Index: Dispatch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Dispatch.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Dispatch.pm	15 Nov 2002 13:43:10 -0000	1.6
+++ Dispatch.pm	18 Nov 2002 16:55:15 -0000	1.7
@@ -1,6 +1,6 @@
 # Vend::Dispatch - Handle Interchange page requests
 #
-# $Id: Dispatch.pm,v 1.6 2002/11/15 13:43:10 mheins Exp $
+# $Id: Dispatch.pm,v 1.7 2002/11/18 16:55:15 mheins Exp $
 #
 # Copyright (C) 2002 ICDEVGROUP <interchange@icdevgroup.org>
 # Copyright (C) 2002 Mike Heins <mike@perusion.net>
@@ -26,7 +26,7 @@
 package Vend::Dispatch;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.6 $, 10);
+$VERSION = substr(q$Revision: 1.7 $, 10);
 
 use POSIX qw(strftime);
 use Vend::Util;
@@ -1196,6 +1196,10 @@
 
 	$Vend::Calc_initialized = 0;
 	$CGI::values{mv_session_id} = $Vend::Session->{id} = $Vend::SessionID;
+	if(my $vspace = $CGI::values{mv_values_space}) {
+		$Vend::Session->{values_repository} ||= {};
+		$::Values = $Vend::Session->{values_repository}{$vspace} ||= {};
+	}
 
 	if($Vend::Cfg->{CookieLogin}) {
 		COOKIELOGIN: {



2.38      +3 -3      interchange/lib/Vend/Order.pm


rev 2.38, prev_rev 2.37
Index: Order.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Order.pm,v
retrieving revision 2.37
retrieving revision 2.38
diff -u -r2.37 -r2.38
--- Order.pm	18 Nov 2002 16:33:47 -0000	2.37
+++ Order.pm	18 Nov 2002 16:55:15 -0000	2.38
@@ -1,6 +1,6 @@
 # Vend::Order - Interchange order routing routines
 #
-# $Id: Order.pm,v 2.37 2002/11/18 16:33:47 mheins Exp $
+# $Id: Order.pm,v 2.38 2002/11/18 16:55:15 mheins Exp $
 #
 # Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -28,7 +28,7 @@
 package Vend::Order;
 require Exporter;
 
-$VERSION = substr(q$Revision: 2.37 $, 10);
+$VERSION = substr(q$Revision: 2.38 $, 10);
 
 @ISA = qw(Exporter);
 
@@ -1222,7 +1222,7 @@
 
 # Contributed by Ton Verhagen -- April 15, 2000
 sub _isbn {
-	# $ref is to Vend::Session->{'values'} hash (well, actually ref to %CGI::values)
+	# $ref is to $::Values hash (well, actually ref to %CGI::values)
 	# $var is the passed name of the variable
 	# $val is current value of checked variable
 	# This routine will return 1 if isbn is ok, else returns 0



2.3       +3 -5      interchange/lib/Vend/SOAP.pm


rev 2.3, prev_rev 2.2
Index: SOAP.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/SOAP.pm,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -r2.2 -r2.3
--- SOAP.pm	16 Sep 2002 23:06:31 -0000	2.2
+++ SOAP.pm	18 Nov 2002 16:55:15 -0000	2.3
@@ -1,6 +1,6 @@
 # Vend::SOAP - Handle SOAP connections for Interchange
 #
-# $Id: SOAP.pm,v 2.2 2002/09/16 23:06:31 mheins Exp $
+# $Id: SOAP.pm,v 2.3 2002/11/18 16:55:15 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -34,7 +34,7 @@
 use strict;
 
 use vars qw($VERSION @ISA $AUTOLOAD);
-$VERSION = substr(q$Revision: 2.2 $, 10);
+$VERSION = substr(q$Revision: 2.3 $, 10);
 @ISA = qw/SOAP::Server/;
 
 my %Allowed_tags;
@@ -211,11 +211,9 @@
 	shift;
 	open_soap_session();
 	my $putref;
-	my $ref = $Vend::Session->{values};
+	my $ref = $::Values ||= {};
 #::logDebug("ref from session is " . ::uneval($ref));
 	if($putref = shift) {
-		$ref = $Vend::Session->{values} = {}
-			if ! ref($ref);
 		%{$ref} = %{$putref};
 	}
 	close_soap_session();



2.10      +7 -10     interchange/lib/Vend/Session.pm


rev 2.10, prev_rev 2.9
Index: Session.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Session.pm,v
retrieving revision 2.9
retrieving revision 2.10
diff -u -r2.9 -r2.10
--- Session.pm	15 Nov 2002 13:43:10 -0000	2.9
+++ Session.pm	18 Nov 2002 16:55:15 -0000	2.10
@@ -1,6 +1,6 @@
 # Vend::Session - Interchange session routines
 #
-# $Id: Session.pm,v 2.9 2002/11/15 13:43:10 mheins Exp $
+# $Id: Session.pm,v 2.10 2002/11/18 16:55:15 mheins Exp $
 # 
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -26,7 +26,7 @@
 require Exporter;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 2.9 $, 10);
+$VERSION = substr(q$Revision: 2.10 $, 10);
 
 @ISA = qw(Exporter);
 
@@ -294,11 +294,8 @@
 	my $time = time;
     $Vend::Session->{'time'} = $time;
 	delete $Vend::Session->{values}->{mv_credit_card_number};
-    my $save = $Vend::Session->{'user'};
-    undef $Vend::Session->{'user'};
-    #undef $Vend::Session->{'arg'};
+    my $save = delete $Vend::Session->{'user'};
 	for(@Vend::TmpScratch) {
-#::logDebug ("delete TmpScratch=$_");
 		delete $::Scratch->{$_};
 	}
 	$Vend::Session->{username} = $Vend::username;
@@ -403,7 +400,7 @@
 
 	$Vend::Session->{arg}  = $Vend::Argument;
 
-    $::Values	= $Vend::Session->{'values'};
+    $::Values	= $Vend::Session->{values};
     $::Scratch	= $Vend::Session->{scratch};
     $::Carts	= $Vend::Session->{carts};
     $Vend::Interpolate::Tmp ||= {};
@@ -458,7 +455,7 @@
     };
 	$Vend::Session->{shost} = $CGI::remote_addr
 		if $CGI::secure;
-	$::Values     = $Vend::Session->{'values'};
+	$::Values     = $Vend::Session->{values};
 	$::Scratch	  = $Vend::Session->{scratch};
 	$::Scratch->{mv_locale} ||= $Vend::Cfg->{DefaultLocale};
 	$::Carts	  = $Vend::Session->{carts};
@@ -554,8 +551,8 @@
 
 	$time = $time || time();
 
-	if(defined $Vend::Session->{'values'}->{mv_expire_time}) {
-		$expire = $Vend::Session->{'values'}->{mv_expire_time};
+	if(defined $::Values->{mv_expire_time}) {
+		$expire = $::Values->{mv_expire_time};
 		unless($expire =~ /^\d{6,}$/) {
 			$expire = Vend::Config::time_to_seconds($expire);
 		}



1.3       +3 -3      interchange/lib/Vend/Payment/WellsFargo.pm


rev 1.3, prev_rev 1.2
Index: WellsFargo.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Payment/WellsFargo.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- WellsFargo.pm	17 Jun 2002 22:24:11 -0000	1.2
+++ WellsFargo.pm	18 Nov 2002 16:55:15 -0000	1.3
@@ -1,6 +1,6 @@
 # Vend::Payment::WellsFargo - Interchange WellsFargo support
 #
-# $Id: WellsFargo.pm,v 1.2 2002/06/17 22:24:11 jon Exp $
+# $Id: WellsFargo.pm,v 1.3 2002/11/18 16:55:15 mheins Exp $
 #
 # Copyright (C) 1999-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -33,7 +33,7 @@
 
 =head1 Interchange WellsFargo Support
 
-Vend::Payment::WellsFargo $Revision: 1.2 $
+Vend::Payment::WellsFargo $Revision: 1.3 $
 
 =head1 SYNOPSIS
 
@@ -463,7 +463,7 @@
         Ecom_payment_card_expdate_year	=> $actual->{mv_credit_card_exp_year},
         Ecom_payment_card_expdate_month	=> $actual->{mv_credit_card_exp_month},
         Ecom_payment_card_number	=> $actual->{mv_credit_card_number},
-        Ecom_payment_card_type		=> "\U$Vend::Session->{values}->{mv_credit_card_type}",
+        Ecom_payment_card_type		=> "\U$::Values->{mv_credit_card_type}",
         Ecom_payment_card_verification	=> 123,
     );