[ic] HELP !! Problem with "[history-scan%20exclude=nothing]"

J. Pla interchange-users@interchange.redhat.com
Mon Mar 18 13:20:00 2002


Hi, in my catalog.cfg file are there the same that you type.

Here is my catalog.cfg file. Can you tell me if there are any word or path
that is not correct.

#==========================================================================#

# catalog.cfg
# See the 'icconfig' document for details.

#==========================================================================#

# Read in initial variables from a database.
VariableDatabase variable

#==========================================================================#

# Allow a template to drop in some beginning config.
include etc/before.cfg

#==========================================================================#

# Warn if any important modules or usertags are missing.

Require module Digest::MD5    "Need %s %s for better cache keys."
Require module Safe::Hole
Require module SQL::Statement
Require module LWP::Simple

Require UserTag   email email_raw var loc table_editor button

#==========================================================================#

# Can send various files outside the catalog directory, for disk partition
# reasons, for example.

ParseVariables  Yes

ifdef LOGDIR
ErrorFile       __LOGDIR__/error.log
AsciiTrack      __LOGDIR__/tracking.asc
TrackFile       __LOGDIR__/usertrack
endif

ifndef LOGDIR
AsciiTrack      logs/tracking.asc
TrackFile       logs/usertrack
endif

ifdef CACHEDIR
SessionDatabase __CACHEDIR__/session
ScratchDir      __CACHEDIR__/tmp
endif

ifndef CACHEDIR
SessionDatabase session
ScratchDir      tmp
endif

#==========================================================================#

# Database setup

ParseVariables  Yes

ifndef SQLDSN
Variable  SQLDSN
endif

ifdef MYSQL
include dbconf/mysql/mysql.cfg
endif

ifdef PGSQL
include dbconf/pgsql/pgsql.cfg
endif

ifdef ORACLE
include dbconf/oracle/oracle.cfg
endif

# Default DBM if nothing else defined
ifndef SOME_DATABASE
include dbconf/default_db/default_db.cfg
endif

ProductFiles   products
Database products products.txt TAB
#==========================================================================#

# The URLs which are written to refer back to our catalog.

ParseVariables  Yes

VendURL    http://__SERVER_NAME____CGI_URL__
SecureURL  __SECURE_SERVER____CGI_URL__

ifndef SECURE_ENABLE
SecureURL  http://__SERVER_NAME____CGI_URL__
endif

# Set the image path for relative images
ImageDir          __IMAGE_DIR__/
ImageDirInternal  http://__SERVER_NAME____IMAGE_DIR__/

#==========================================================================#

# Here we set up the catalog theme.

ParseVariables Yes

ifndef STYLE
Variable STYLE default
endif
include templates/__STYLE__/theme.cfg

#==========================================================================#

# Last locale specified is the default.
Locale          en_US LC_CTYPE C
LocaleDatabase  locale

#==========================================================================#

# Various catalog settings.

ScratchDefault  mv_add_dot_html   1
ScratchDefault  mv_no_session_id  1
ScratchDefault  mv_no_count       1

SpecialPage  catalog  index
SpecialPage  report   ../etc/report
SpecialPage  receipt  ../etc/receipt

# Allow others in our group to read/write files by default
ReadPermission  group
WritePermission group

# If a specific user session accesses our catalog more than this many times
# in a 30-second time period. If the limit is exceeded, the LockoutCommand
# (if set) is executed. Set this to 0 if you're getting links to 127.0.0.1
# during your testing.
RobotLimit  100

# Sets Interchange to not parse <BODY MV="body 1"> and other tags within
# HTML tags. Use [pragma no_html_parse 0] to enable on an individual page.
Pragma  no_html_parse

# Strip whitespace from top of pages so you don't have to scroll down
# before the HTML starts when doing 'view source' in a browser.
Pragma  strip_white

#==========================================================================#

# User session related settings.

# Whether to encrypt passwords in UserDB
# We usually don't for users, so we can mail them their password
# We DO in admin, that is set in catalog_after.cfg
UserDB    default    crypt         0

# Change a field to something that doesn't conflict in MySQL
UserDB    default    time_field    mod_time

# Don't want people setting their credit limit or dealer status directly
UserDB    default    scratch       "dealer price_level credit_limit"

# minimal login stuff for affiliate
UserDB    affiliate  user_field    affiliate
UserDB    affiliate  database      affiliate
UserDB    affiliate  time_field    none
UserDB    affiliate  crypt         0

# Set this to Yes if you want auto-login capability for users.
# You must be careful about malicious JavaScripts in your embedded code.
CookieLogin  Yes

#==========================================================================#

# Cart, order, and route settings.

ParseVariables  Yes

ValuesDefault   country      __SHIP_DEFAULT_COUNTRY__
ValuesDefault   mv_shipmode  __SHIP_DEFAULT_MODE__
DefaultShipping __SHIP_DEFAULT_MODE__

MailOrderTo     __ORDERS_TO__

AlwaysSecure    ord/checkout login change_password

## Set this if you have a different secure server
#AlwaysSecure   order ord/checkout ord/basket login change_password process

PriceField      0
CommonAdjust    :sale_price, ;:price, ;$, ==:options

EncryptKey  __PGP_KEY__

# This prevents a user from setting this value, you may want to unset
# this if you have user-selectable handling charges like insurance
FormIgnore   mv_handling
#
#

# Along these lines further, for better integrity and less chance of a
# user screwing up your order routes:
# Note that __ORDER_ROUTES__ is empty by default, default Route "default"
# is used with cascades
FormIgnore      mv_order_route

## This route places the order entry in the database. If you don't
## have an inventory table (or a userdb table for that matter) make
## sure you remove it from the list of "transactions" tables.

Route log  <<EOF
        empty        1
        encrypt      0
        increment    0
        report       etc/log_transaction
        supplant     0
        track        logs/log
EOF

## This route places the order entry in the database when you are
## entering an order from the admin. See above.
Route log_entry  <<EOF
        empty        1
        encrypt      0
        report       etc/log_entry
        supplant     0
        track        logs/log
EOF

ifdef TRANSACTION_TABLES
Route log       transactions '__TRANSACTION_TABLES__'
Route log_entry transactions '__TRANSACTION_TABLES__'
endif

## This route copies the user if they requested that. We don't
## care (much) if it fails, so error_ok is set and failure will
## not cause the order to fail
Route copy_user  <<EOF
        empty        1
        error_ok     1
        encrypt      0
        increment    0
        report       etc/mail_receipt
        supplant     0
        track        logs/log
EOF

ParseVariables Yes
## This route emails the order to you unless email is set to "",
## and failsafe-logs the order report a couple of places
Route main  <<EOF
        attach            0
        credit_card       1
        default           1
        email             '__ORDERS_TO__'
        encrypt           0
        errors_to         '__ORDERS_TO__'
        pgp_cc_key        "__PGP_KEY__"
        pgp_key           "__PGP_KEY__"
        receipt           etc/receipt.html
        report            etc/report
        supplant          1
        individual_track  orders
        track             logs/tracking.asc
EOF

# Order routes can be maintained in a database
# CHANGES TO THIS WILL OVERRIDE THE ROUTES ABOVE.
RouteDatabase   route

# Default route is run if no routes set, this should be last Route
# always
Route   default   master          1
Route   default   cascade         "log main copy_user"
Route   default   empty           1
Route   default   supplant        1
Route   default   email           '__ORDERS_TO__'

## Uncomment this if you want Routes read dynamically from DB
#Route   default   dynamic_routes  1
## Uncomment this if you want ITL allowed in routes
#Route   default   expandable      1

## These routes are not order routes, but payment routes
Route  authorizenet  id           "__AUTHNET_ID__"
Route  authorizenet  secret       "__AUTHNET_SECRET__"
Route  authorizenet  host         "__AUTHNET_HOST__"
Route  authorizenet  referer      "__AUTHNET_REFERER__"

Route  cybercash     configfile   "__CYBER_CONFIGFILE__"

Route  itransact     id           "__ITRANSACT_ID__"

Route  signio        id           "__SIGNIO_ID__"
Route  signio        secret       "__SIGNIO_SECRET__"
Route  signio        partner      "__SIGNIO_PARTNER__"
Route  signio        vendor       "__SIGNIO_VENDOR__"
Route  signio        host         "__SIGNIO_SERVER__"

Route  skipjack      id           "__SKIPJACK_ID__"
Route  skipjack      partner      "__SKIPJACK_PARTNER__"


SalesTax        __TAXFIELD__
TaxShipping     __TAXSHIPPING__
SeparateItems   Yes

OrderCounter    etc/order.number
OrderLineLimit  200
OrderProfile    etc/profiles.order etc/profiles.login etc/profiles.misc

#==========================================================================#

# Static page build settings.

NoCache  <<EOF
        admin
        login
        account
        logout
        config
        multi
        ord/basket
        ord/checkout
        query
        reconfig
        special
EOF

Static        __CATALOG_STATIC__
StaticLogged  __LOGGED_STATIC__
StaticAll     Yes
StaticDBM     static
StaticDepth   2
StaticDir     __SAMPLEHTML__/pages
StaticFly     Yes
StaticPath    __SAMPLEURL__/pages

#==========================================================================#

ifdef UI_TRAFFIC_STATS
TrackFile __UI_TRAFFIC_STATS__
endif

# Deal with customer click history. For example, after adding an item to
# the cart, the user can return to a specific search results page.
History 10
UserTag history-scan Order find exclude default
UserTag history-scan addAttr
UserTag history-scan Routine <<EOR
my %var_exclude = ( qw/
        mv_credit_card_number 1
        mv_pc                 1
        mv_session_id         1
/);
sub {
        my ($find, $exclude, $default) = @_;
        my $ref = $Vend::Session->{History}
                or return $Tag->area($default ||
$Config->{SpecialPage}{catalog});
        my ($hist, $href, $cgi);
        $exclude = qr/$exclude/ if $exclude;
        for(my $i = $#$ref; $i >= 0; $i--) {
                #Log("checking $ref->[$i][0] for $exclude");
                next if $ref->[$i][0] eq 'expired';
                if ($exclude and $ref->[$i][0] =~ $exclude) {
                        next;
                }
                if($find) {
                        next unless $ref->[$i][0] =~ /$find/;
                }
                ($href, $cgi) = @{$ref->[$i]};
                last;
        }
        return $Tag->area($default || $Config->{SpecialPage}{catalog})
                if ! $href;
        my $form = '';
        for(grep !$var_exclude{$_}, keys %$cgi) {
                $form .= "\n$_=";
                $form .= join("\n$_=", split /\0/, $cgi->{$_});
        }
        return $Tag->area( { href => $href, form => $form} );
}
EOR

# Allow delivery of soft goods (downloadable files).
ActionMap  deliver   <<EOR
sub {
        my $deliverable = shift;
        $Scratch->{deliverable} = $CGI->{mv_arg};
        $CGI->{mv_nextpage} = 'deliver';
        if(! $Session->{username} and $CGI->{mv_username}) {
                $Tag->userdb('login');
        }
        return 1;
}
EOR

# Allow customers to have their passwords emailed to them.
ActionMap  get_password   <<EOR
sub {
        $Config->{NoSearch} = '';
        $CGI->{mv_nextpage} = $CGI->{mv_search_page} =
'action/get_password';
        $CGI->{mv_todo} = 'search';
        $Tag->update('process');
        return 1;
}
EOR

#==========================================================================#

# Allow a template to drop in some ending config.
include etc/after.cfg

#==========================================================================#
SpecialPage checkout ord/checkout
SpecialPage failed special/error_on_order
SpecialPage interact special/browser_problem
SpecialPage noproduct special/no_product_found
SpecialPage order ord/basket
SpecialPage search srch/results

----------------------------------------------------------------------------
--------------------------------

Thank's in advance again!!
----- Original Message -----
From: "Jonathan Clark" <jonc@webmaint.com>
To: <interchange-users@interchange.redhat.com>
Sent: Monday, March 18, 2002 6:44 PM
Subject: RE: [ic] HELP !! Problem with "[history-scan%20exclude=nothing]"


>
> > Ic 4.8.3
> > Catalog URL      http://ferranferrer.com/~ferranfe/cgi-bin/cart.cgi
> > Secure URL      http://ferranferrer.com/~ferranfe/cgi-bin/cart.cgi
> > Location of Error Logs      Global:
> > /usr/local/cpanel/3rdparty/interchange/error.log
> > Local: error.log
> > Active sessions      Show active sessions
> > (last 60 minutes)
> > Last order number      TEST0000
>
> ok. 4.8.3
>
> Please can you check for the history-scan tag definition in catalog.cfg.
>
> I have included it below for your reference. It should be almost at the
> bottom of the file.
>
> Please also look in the error.log file at around 4:41am when the server
> daemon was restarted.
>
> Jonathan
> Webmaint.
>
> ====
>
> # Deal with customer click history. For example, after adding an item to
> # the cart, the user can return to a specific search results page.
> History 10
> UserTag history-scan Order find exclude default
> UserTag history-scan addAttr
> UserTag history-scan Routine <<EOR
> my %var_exclude = ( qw/
> mv_credit_card_number 1
> mv_pc                 1
> mv_session_id         1
> /);
> sub {
> my ($find, $exclude, $default) = @_;
> my $ref = $Vend::Session->{History}
> or return $Tag->area($default || $Config->{SpecialPage}{catalog});
> my ($hist, $href, $cgi);
> $exclude = qr/$exclude/ if $exclude;
> for(my $i = $#$ref; $i >= 0; $i--) {
> #Log("checking $ref->[$i][0] for $exclude");
> next if $ref->[$i][0] eq 'expired';
> if ($exclude and $ref->[$i][0] =~ $exclude) {
> next;
> }
> if($find) {
> next unless $ref->[$i][0] =~ /$find/;
> }
> ($href, $cgi) = @{$ref->[$i]};
> last;
> }
> return $Tag->area($default || $Config->{SpecialPage}{catalog})
> if ! $href;
> my $form = '';
> for(grep !$var_exclude{$_}, keys %$cgi) {
> $form .= "\n$_=";
> $form .= join("\n$_=", split /\0/, $cgi->{$_});
> }
> return $Tag->area( { href => $href, form => $form} );
> }
> EOR7
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users