[interchange-cvs] interchange - pajamian modified 3 files
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Mon Mar 16 10:06:12 UTC 2009
User: pajamian
Date: 2009-03-16 10:06:12 GMT
Modified: . WHATSNEW-5.7
Modified: lib/Vend Config.pm Dispatch.pm
Log:
Added SourcePriority catalog directive:
SourcePriority <source_list>
<source_list> is a prioritized list of cgi variables to get the source
(affiliate) name from. Can also include the following:
mv_pc - has the current special casing of mv_pc, (ie RESET is special as
are values that contain only digits).
cookie-foo check the cookie with the foo label.
session - stop here if session already exists, do not check any further
variables.
session-foo - stop here if foo session variable is set.
Default: SourcePriority mv_pc mv_source
Examples:
Check the MV_SOURCE cookie for an affiliate name as well as the other defaults:
SourcePriority mv_pc mv_source cookie-MV_SOURCE
...as above, but you don't want your affiliates using mv_pc:
SourcePriority mv_source cookie-MV_SOURCE
Check the cgi variable affid instead:
SourcePriority affid
Say you send affiliate traffic to other sites, and you don't want
those sites to get credit for sales if a customer follows a banner from
them back to your site:
SourcePriority session mv_pc mv_source
If you want affiliates who use the specialsource cgi variable instead of
mv_source to get special treatment and can override customers who
already have sessions:
SourcePriority specialsource session mv_pc mv_source
If you want to allow affiliates to get credit if there is a
session but only if no other affiliate is already set:
SourcePriority session-source mv_pc mv_source
Revision Changes Path
2.31 interchange/WHATSNEW-5.7
rev 2.31, prev_rev 2.30
Index: WHATSNEW-5.7
===================================================================
RCS file: /var/cvs/interchange/WHATSNEW-5.7,v
retrieving revision 2.30
retrieving revision 2.31
diff -u -r2.30 -r2.31
--- WHATSNEW-5.7 13 Mar 2009 18:57:37 -0000 2.30
+++ WHATSNEW-5.7 16 Mar 2009 10:06:12 -0000 2.31
@@ -42,6 +42,8 @@
That would look in the database field "merge_to" for a user name
to change to.
+* Added new SourcePriority catalog directive.
+
Payment
-------
2.242 interchange/lib/Vend/Config.pm
rev 2.242, prev_rev 2.241
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.241
retrieving revision 2.242
diff -u -r2.241 -r2.242
--- Config.pm 29 Jan 2009 17:13:26 -0000 2.241
+++ Config.pm 16 Mar 2009 10:06:12 -0000 2.242
@@ -1,6 +1,6 @@
# Vend::Config - Configure Interchange
#
-# $Id: Config.pm,v 2.241 2009-01-29 17:13:26 mheins Exp $
+# $Id: Config.pm,v 2.242 2009-03-16 10:06:12 pajamian Exp $
#
# Copyright (C) 2002-2009 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -54,7 +54,7 @@
use Vend::Data;
use Vend::Cron;
-$VERSION = substr(q$Revision: 2.241 $, 10);
+$VERSION = substr(q$Revision: 2.242 $, 10);
my %CDname;
my %CPname;
@@ -714,6 +714,7 @@
['BounceReferrals', 'yesno', 'no'],
['OrderCleanup', 'routine_array', ''],
['SessionCookieSecure', 'yesno', 'no'],
+ ['SourcePriority', 'array_complete', 'mv_pc mv_source'],
];
@@ -1338,6 +1339,10 @@
}
}
+ # Set up hash of keys to hide for BounceReferrals
+ $C->{BounceReferrals_hide} = { map { ($_, 1) } grep { !(/^cookie-/ or /^session(?:$|-)/) } @{$C->{SourcePriority}} };
+ @{$C->{BounceReferrals_hide}}{qw(mv_form_charset mv_session_id)} = (1) x 2;
+
finalize_mapped_code();
set_readonly_config();
1.108 interchange/lib/Vend/Dispatch.pm
rev 1.108, prev_rev 1.107
Index: Dispatch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Dispatch.pm,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- Dispatch.pm 14 Jan 2009 01:09:52 -0000 1.107
+++ Dispatch.pm 16 Mar 2009 10:06:12 -0000 1.108
@@ -1,6 +1,6 @@
# Vend::Dispatch - Handle Interchange page requests
#
-# $Id: Dispatch.pm,v 1.107 2009-01-14 01:09:52 jon Exp $
+# $Id: Dispatch.pm,v 1.108 2009-03-16 10:06:12 pajamian Exp $
#
# Copyright (C) 2002-2009 Interchange Development Group
# Copyright (C) 2002 Mike Heins <mike at perusion.net>
@@ -26,7 +26,7 @@
package Vend::Dispatch;
use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.107 $, 10);
+$VERSION = substr(q$Revision: 1.108 $, 10);
use POSIX qw(strftime);
use Vend::Util;
@@ -1220,6 +1220,7 @@
}
}
+my %source_keys_hide;
sub dispatch {
my($http) = @_;
$H = $http;
@@ -1442,21 +1443,56 @@
$Vend::Session->{'arg'} = $Vend::Argument = ($CGI::values{mv_arg} || undef);
my $new_source;
- if ($CGI::values{mv_pc} and $CGI::values{mv_pc} =~ /\D/) {
- $new_source = $Vend::Session->{source} = $CGI::values{mv_pc} eq 'RESET'
- ? ''
- : $CGI::values{mv_pc};
- }
- elsif($CGI::values{mv_source}) {
- $new_source = $Vend::Session->{source} = $CGI::values{mv_source};
- }
+ SOURCEPRIORITY: {
+ if ($CGI::values{mv_pc} and $CGI::values{mv_pc} eq 'RESET') {
+ $Vend::Session->{source} = '';
+ last SOURCEPRIORITY;
+ }
+
+ foreach (@{$Vend::Cfg->{SourcePriority}}) {
+ if ($_ eq 'mv_pc') {
+ if ($CGI::values{mv_pc} and $CGI::values{mv_pc} =~ /\D/) {
+ $new_source = $Vend::Session->{source} = $CGI::values{mv_pc};
+ last SOURCEPRIORITY;
+ }
+ }
+
+ elsif ($_ =~ /^cookie-(.+)/) {
+ my $cookie = Vend::Util::read_cookie($1);
+ if (length $cookie) {
+ $Vend::Session->{source} = $cookie;
+ last SOURCEPRIORITY;
+ }
+ }
+
+ elsif ($_ eq 'session') {
+ if ($sessionid) {
+ last SOURCEPRIORITY;
+ }
+ }
+
+ elsif (/^session-(.+)/) {
+ if (length $Vend::Session->{$1}) {
+ last SOURCEPRIORITY;
+ }
+ }
+
+ else {
+ if (length $CGI::values{$_}) {
+ $new_source = $Vend::Session->{source} = $CGI::values{$_};
+ last SOURCEPRIORITY;
+ }
+ }
+ }
+ } #SOURCEPRIORITY
+
if ($new_source and $CGI::request_method eq 'GET' and $Vend::Cfg->{BounceReferrals}) {
my $path = $CGI::path_info;
$path =~ s:^/::;
my $form =
join '',
map { "$_=$CGI::values{$_}\n" }
- grep !/^mv_(?:pc|source)$/,
+ grep { !$Vend::Cfg->{BounceReferrals_hide}->{$_} }
sort keys %CGI::values;
my $url = vendUrl($path eq '' ? $Vend::Cfg->{DirectoryIndex} : $path, undef, undef, { form => $form, match_security => 1 });
my $msg = get_locale_message(
More information about the interchange-cvs
mailing list