#!/usr/bin/perl ############################################################################### # ImageFolio Commerce Version 1.0 ############################################################################### # ImageFolio Commerce by BizDesign, Inc. # written by Greg Raaum and Dirk Koppers # Available from http://www.ImageFolio.com # =========================================================================== # COPYRIGHT NOTICE : # # Copyright (c) 1999-2002 BizDesign, Inc. All rights reserved. # # Selling the code for this program without prior written consent is # expressly forbidden. # # Obtain written permission before redistributing this software over the # Internet or in any other medium. In all cases copyright and header must # remain intact. # # Feel free to modify the code of this program to suit your likings. # # Although this program has been thoroughly tested on BizDesign's servers, we # do not warrant that it works on all servers and will not be held liable # for anything, including but not limited to, misusage, error, or loss of data. # # Use at your own risk! ############################################################################### # Do not modify below this line unless you know what you are doing. ############################################################################### use vars qw/$libpath $referrer_check $domain $image_directory/; eval { ($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX ($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows $| = 1; # flush output local(%FORM) = &parse_form; require "config.pl"; # Change this to the absolute path if you have problems. require "taxandship_config.pl"; # Change this to full path to config.pl if you have problems. require "$libpath/db_interact.pl"; require "$libpath/shared.pl"; ⊤ }; if ($@) { print "Content-type: text/html\n\n
Script Error: $@\n"; } exit; ############################################################################### # TOP # Determines what to do ############################################################################### sub top { # local(%FORM) = &parse_form; if (!$allow_free_access && $not_validated && !$FORM{'login'}) { if ($not_validated == 2) { $nvq = '&addcat=1&new=1'; } print "Location:$imagefolio_url?login=1$nvq\n\n"; } &load_values; if (!$FORM{'lightbox'}){ if ($referrer_check && $ENV{'HTTP_REFERER'}) { &check_referrer; }} if ($FORM{'action'} eq "view") { require "$libpath/images.pl"; &view_image; } elsif ($FORM{'direct'}) { require "$libpath/thumbnails.pl"; &gen_image_table; } elsif ($FORM{'advsearch'}) { require "$libpath/search.pl"; &advsearch; } elsif ($FORM{'login'}) { require "$libpath/accounts.pl"; &login; } elsif ($FORM{'logout'}) { require "$libpath/accounts.pl"; &logout; } elsif ($FORM{'search'}) { require "$libpath/search.pl"; &search; } elsif ($FORM{'lightbox'}) { require "$libpath/lightbox.pl"; &gen_image_table; } elsif ($FORM{'order'} eq "view") { require "$libpath/orders_history.pl"; &orders_history; } elsif ($FORM{'download'}) { require "$libpath/download.pl"; &dowload_order; } elsif ($FORM{'imageconvert'}) { require "$libpath/imageconvert.pl"; &load_ic; } # else { if (!$FORM{'loginsuccess'}) { &delete_custsessions; } else { require "$libpath/home.pl"; &gen_home_page; } } ############################################################################### # CHECK REFERRER # Make sure we are pulling this page from the site and not a bookmark or link ############################################################################### sub check_referrer { my $ok; foreach $referer (@ref) { if ($ENV{'HTTP_REFERER'} =~ m|https?://([^/]*)$referer|i) { $ok = 1; last; } } if ($ok != 1) { print "Location:$domain\n\n"; exit; } } ############################################################################### # LOAD VALUES # Establishes default values for commonly used variables ############################################################################### sub load_values { my ($found, $i, $pos, $count, $cnt, $nav, $subcatlinks, $thumbimages, $template); if ($FORM{'direct'}) { if ( (!(-e "$image_directory/$FORM{'direct'}")) || (!(-d "$image_directory/$FORM{'direct'}")) || ($FORM{'direct'} =~ /\.\./) ) { print qq|Content-type: text/html\n\n