#!/usr/local/bin/perl ################################################################ # DO NOT EDIT ANYTHING BELOW # ################################################################ ################################################################ # TITLE: Tell-a-Friend # # VERSION: 1.25 # # CREATED ON: August 13, 2000 # # LAST UPDATED: September 27, 2000 # # E-MAIL: support@cgibiz.com # # WEB SITE: http://www.cgibiz.com # ################################################################ # COPYRIGHT (C) 2000 ARVYDAS STRAUSAS. ALL RIGHTS RESERVED # ################################################################ # Copyright Notice # # ---------------- # # This script can be freely used and distributed, but any # # modification of it without the written consent of Arvydas # # Strausas is strictly prohibited. Copying any of the code # # contained within this script and claiming it as your own is # # also prohibited. You may not remove any of these header # # notices. By using this code you agree to indemnify author # # from any liability that might arise from it's use. # ################################################################ use integer;use Socket;use cg;require"tell.ini";cg::content_type("text/html");my$i;my$template="tell.html";my$version="Ufmm.b.Gsjfoe!2/36";my%friends;$cg::params{"version"}=de("Qpxfsfe!cz!=b!ubshfu>`cmbol!isfg>#iuuq;00xxx/dhjcj{/dpn#?$version=0b?");$cg::params{"referer"}=$ENV{"HTTP_REFERER"}if!$cg::params{"referer"};$cg::params{"referer"}=$ini::website if!$cg::params{"referer"};$cg::params{"name"}=$cg::params{"email"}if!$cg::params{"name"};if($ini::webmaster){$friends{$ini::webmaster}="Webmaster";}for($i=0;defined($_=$cg::params{"friends_email$i"});$i++){$friends{$_}=$cg::params{"friends_name$i"}if$_;}if($i){my$letter;open(LETTER,"$ini::templates_dir/tell.txt")or error("$ini::templates_dir/tell.txt");read(LETTER,$letter,-s LETTER);close(LETTER);open(LOG,">>$ini::stats_dir/tell.log")or error("$ini::stats_dir/tell.log");foreach(keys(%friends)){$cg::params{"friends_name"}=$friends{$_}?$friends{$_}:$_;$cg::params{"friends_email"}=$_;$_=$letter;s/\$(\w+)/$cg::params{$1}/ges;mail($cg::params{"email"},$cg::params{"friends_email"},$_);print(LOG time()."\t$cg::params{'referer'}\t$cg::params{'email'}\t$cg::params{'friends_email'}\n");}close(LOG);if($cg::params{"confirm"}eq"yes"){mail($cg::params{"email"},$cg::params{"email"},parse_template("told.txt"));}$template="told.html";}if(($_=parse_template($template))=~/$cg::params{"version"}/o){cg::print($_);}sub de{my$s=$_[0];$s=~s/([\!-\~])/chr(ord($1) - 1)/eg;return$s;}sub parse_template{my$s;my$parsed="";open(TEMPLATE,"$ini::templates_dir/$_[0]")or error("$ini::templates_dir/$_[0]");while(defined($s=