#!/usr/bin/perl # # FTP/WWW Installation Instructions: # # This file is actually a perl program that may be used to install # AgoraCart on a UNIX or LINUX web hosting server that has only FTP access. # Copyright 2000 to Present by K-Factor Technologies,Inc / AgoraCart.com # # This is NOT FREE AND/OR GPL SOFTWARE! # This software is a separate script to install an ecommerce shopping cart and # is the confidential and proprietary information of K-Factor Technologies, Inc. You shall # not disclose such Confidential Information and shall use it only in # conjunction with the AgoraCart (aka agora.cgi) shopping cart and/or AgoraCart Gold, # AgoraCart Pro, AgoraSQL, AgoraCartSQL, or AgoraSuite. # # This script requires the following Perl module to be installed: LWP::Simple # # This script installs Only AgoraCart Version 5.2.005. A new copy needs to be obtained for future releases. # # STEP 1 -- Put the correct path to perl on line 1 of this file, above. # # STEP 2 -- Transfer this file via FTP, in ASCII mode, in the directory of your # hosting account that you wish to install your store. # # STEP 3 -- Rename this file to FTP5.cgi # # STEP 4 -- make this file readable/executeable (chmod 755) via your FTP software. # # STEP 5 -- If you already have # a directory named 'store52', please rename it to something else now! # # STEP 6 -- run this script from your web browser via a URL like: # http://www.yourdomain.com/FTP5.cgi # # STEP 7 -- Make sure this file is erased from your server immediately. # this script will attempt to delete itself and the compressed files it downloads. # # # Copyright (c) 2000 to Present by K-Factor Technologies, Inc and AgoraCart. # http://www.k-factor.net/ and http://www.AgoraCart.com/ # All Rights Reserved. # # Use with permission only with AgoraCart # # K-Factor Technologies, Inc. MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT # THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESSED OR IMPLIED, # INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, # OR NON-INFRINGEMENT. # # K-Factor Technologies, Inc. SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY # LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS # SOFTWARE OR ITS DERIVATIVES. # # You may not give this script/add-on away or distribute it an any way without # written permission from K-Factor Technologies, Inc. K-Factor Technologies, Inc. # reserves any and all rights to distributions, add-ons, and other works based on this # piece of software as well as any and all rights to profit sharing and/or to charge for # such works and/or derivatves. # ###################################################################### sub get_pro_file { $target_file = "http://www.agoracart.com/$filename"; use LWP::Simple; $file = get($target_file); } ###################################################################### sub write_file { my $msg = "Can't Open $filename"; open(UPLOADFILE,">./$filename") || die $msg; print (UPLOADFILE $file); close(UPLOADFILE); } ###################################################################### sub print_footer { print qq~

~; } ###################################################################### sub print_problem { print qq~ ERROR:
There was a problem with getting the files needed to complete your installation request. Please try again later or use another installation method ~; } ###################################################################### sub get_extract { print qq~ AgoraCart Version 5.2.005 Installation
AgoraCart 5.2.005 Installation In Progress

The Standard version is installing ...


~; $error3 = "not in gzip format"; $error4 = "Error exit delayed from previous errors"; $result = ''; $message_pro_access = qq~
SUCCESS!!!!


Thank you for using AgoraCart. Your AgoraCart version 5.2.005 shopping cart has been installed, but it will still need some basic configuration before it is secure and fully functional.

Please edit your store settings/configuration using the following link (Please bookmark it!):

http://www.your-domain-name.com/store52/protected/manager.cgi (opens new window)

using the following credentials:
username: manager
password: admin


Initial/Basic Setup Cheat Sheet for Version 5.2.005:

SETUP NOTES:

1) Make sure to setup the Primary/Core Agoracart Settings prior to setting any other settings
2) Set the password settings prior to using the update/upgrade modules manager.

  • Primary/Cart AgoraCart Setup/Settings (make sure your URLs are correct! save and login again)
  • Password Settings (save and then login again)
  • Set .htaccess protection (on main link menu, skip if not shown as a link. submit and login at popup login screen)
  • Upgrade AgoraCart Modules (upgrade any modules that should be upgraded. Skip new modules/features for now)
  • Store Design - Misc Settings (fill in what makes sense to change)
  • Shipping Settings and Logic (set up. If not sure, consult user manuals and forums for help)
  • Tax Settings and Logic (set up. If not sure, consult user manuals and forums for help)
  • Payment Gateway (set main gateway in Main Store Setup/Settings screen)
  • Test store with default products (can delete later)
  • Finish store setup and product/service database entry.

~; if (-e $filename) { print qq~
AgoraCart tarball file already here

AgoraCart is installing ...



~; $result = `tar -xzvpf $filename 2>&1`; } else { &get_pro_file; #.tgz if ($file ne '') { &write_file; $result = `tar -xzvpf $filename 2>&1`; if (($result ne '') && (($result !~ /$error3/i)||($result !~ /$error4/i))) { print $message_pro_access; } elsif (($result =~ /$error3/i) || ($result =~ /$error4/i)) { unlink $filename; $filename = "AgoraCart5_2_005.tar.gz"; if (-e $filename) { print qq~
AgoraCart tarball file already here

AgoraCart is installing ...



~; } else { &get_pro_file; &write_file; } $result = `tar -xzvpf $filename 2>&1`; if (($result ne '') && (($result =~ /agora/i)||($result =~ /protected/i))) { print $message_pro_access; } else { &print_problem; } # end inner result } # end of result - outter } # end of file } &print_footer; unlink $filename; unlink $filename2; } ###################################################################### use CGI qw(:standard); use CGI::Carp qw/fatalsToBrowser/; $| = 1; $ENV{'PATH'} = "/bin:/usr/bin"; $filename = "AgoraCart5_2_005.tgz"; $filename2 = "FTP5.cgi"; $file = ''; foreach my $sparam (param()){$form_data{$sparam} = param($sparam);} print "Content-type: text/html\n\n"; if ($form_data{"install_now"}) { &get_extract; } else { $temp2 = "$ENV{'SERVER_NAME'}"; $temp = $ENV{'PATH'}; $ENV{'PATH'} = "/bin:/usr/bin"; $my_id = `id`; $whoami = `whoami`; $ENV{'PATH'} = $temp; $my_modules = ''; $lwp_error_message = ''; foreach $x(qw( LWP::UserAgent LWP::Simple File::Copy MIME::QuotedPrint HTTP::Request XML::Simple Net::SSLeay )) { eval "use $x"; $my_modules .= "
$x : "; if ($x eq "XML::Simple") { $my_modules .= "$@" ? 'will use AgoraCart Gold supplied version'."" : ' installed'; } elsif ($x eq "LWP::UserAgent") { my $temp_thingy = ' installed'; my $test_perl_module = `perl -MLWP::UserAgent -e 'print "$LWP::UserAgent::VERSION\n"'`; if ($test_perl_module < 2.999 && $test_perl_module ne '') { $lwp_error_message = "

WARNING: the LWP::UserAgent Perl Module is too old. You will not be able to get Gold Version notices nor use the Upgrade manager, but your cart will work perfectly for customers without these. Please ask your hosting provider to update the LWP::UserAgent Perl Module, currently at: $test_perl_module
"; $temp_thingy .= " BUT OUTDATED"; } $my_modules .= "$@" ? 'NOT installed'."" : $temp_thingy; } else { $my_modules .= "$@" ? 'NOT installed'."" : ' installed'; } $my_modules .= "
\n"; } $test8 = sprintf("%vd", $^V); if ($test8 lt "5.6.1") { $my_modules .= "

WARNING: Your Perl version is VERY old (Released before August of 2003). The most current Perl version is 5.10.x. AgoraCart Gold 5.1.000 and above requires at least Perl 5.6.1 but works best on Perl 5.8.6 or higher. Please ask your hosting provider to upgrade Perl to at least version 5.8.8
"; }elsif ($test8 lt "5.6.9") { $my_modules .= "

Your Perl version is OK but VERY old (Released late 2003). The most current Perl version is 5.10.0. AgoraCart Gold 5.1.000 and above requires at least Perl 5.6.1 but works best on Perl 5.8.6 or higher. We recommend that ask your hosting provider to upgrade Perl to version 5.8.8. You can still use / install AgoraCart
"; } elsif ($test8 lt "5.8.6") { $my_modules .= "

Your Perl version is OK but slightly outdated. The most current Perl version is 5.10.0 or even 5.8.8 is okay Please ask your hosting provider to upgrade Perl to version 5.8.8. You can still use / install AgoraCart
"; } if (!(-e $filename2)) { print qq~ AgoraCart Version 5.2.005 Installation
AgoraCart Version 5.2.005 Installer

Thank You for using Agoracart and supporting the project!


Please rename this file to FTP5.cgi and try again!


Brought to you by AgoraCart.com



~; exit; } else { print qq~ AgoraCart Version 5.2.005 Installation
AgoraCart Version 5.2.005 Installer

Thank You for using Agoracart and supporting the project!


This program has been designed to make the process of installing AgoraCart as easy as possible.

The first thing that you should know is that this program may not work for everyone. With all the possible configurations of server it is possible that you may run into problems installing this software on your server.

First we need to determine who scripts run as on your server. If they run under a generic user, which is the case on some servers, you will not be able to use this installation program. You must be very careful about this because if you do install the software using the script under a generic id you may not be able to edit, change, or delete the files once they are installed.


Here are the results for your server:
Server: $temp2
Scripts are running under id: $my_id
Unix 'whoami' responds with: $whoami

Perl Module Check:
Perl Version: ~; printf "%vd", $^V; print qq~ $my_modules $lwp_error_message

If the Unix whoami command responds back with your username, you do not need the wrappers and you can go ahead and proceed with the install.

If the Unix whoami command and/or the UID response is: 'nobody', 'www', 'apache', or something other than your username (typically the ID you use to login with when accessing your hosting account), you should NOT use this install script, and you might also need to install wrappers.



Brought to you by AgoraCart.com



~; exit; } }