#!/usr/bin/perl
########################################################################
# SellWide Affiliate Manager for ClickBank - Version: 2.0 #
# Copyright 2002 SellWide Corporation #
# Last modified 06/11/2002 #
# Authors: Andrew Kolobikhin and Vadim Rachkowan #
# Available at http://www.sellwide.net #
########################################################################
# COPYRIGHT NOTICE #
# Copyright 2002 SellWide Corporation. All Rights Reserved. #
# #
# This script may be used as long as you don't change this header or #
# any of the parts that give Vadim Rachkowan, SellWide Corporation, #
# or it's Employees credit for writing this script. #
# #
# By using this script you agree to indemnify me from any liability #
# that might arise from its use. #
# #
# Redistributing and or selling the code for this program without #
# prior written consent is expressly forbidden. #
# #
# Use of the Affiliate Manager for ClickBank for any unauthorized #
# purpose is expressly prohibited by law, and may result in severe #
# civil and criminal penalties. Violators will be prosecuted to the #
# maximum extent possible. #
# #
# YOU MAY NOT RESELL OR RELEASE THIS PROGRAM TO OTHERS #
# IT IS FOR YOUR PERSONAL USE ONLY. #
# #
########################################################################
#################################################################
# CHANGE THESE VARIABLES: #
#################################################################
# Type the URL address of the swres.cgi
$scriptpath="http://www.easyseo.com/affiliates/swres.cgi";
# Type the full path to your Mail program.
# If you're not sure of this, ask your server administrator
$mailprog="/usr/sbin/sendmail";
# Type your email address. Make sure
# to place a \ in front of the @
# As an example: admin\@sellwide.net
$fromaddr="admin\@easyseo.com";
# Type your name. It will appear as a "From"
# name in all of your emails.
$frname="EasySEO Customer Service";
# Type your ClickBank nickname
$mynick="easyseo";
# Enter the Admin password (case sensetive 8 chars max)
$pass="lion2304";
#################################################################
##-------------------------------------------------------------##
##-- !!! DO NOT EDIT ANYTHING BELOW !!! --##
##-------------------------------------------------------------##
# Removing or altering the code below will void your #
# acceptance of the terms and conditions and consequently #
# you will no longer be able to use the program. #
#---------------------------------------------------------------#
#################################################################
$htmlpath="$ENV{'DOCUMENT_ROOT'}";
$usersfile="users.rdb";
$mailprog=$mailprog." -t";
$scriptpath=~/http:\/\/([^\/]+)/;
$dirname="html";
$host1="http://$1/$dirname";
@months=("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
&readparse;
if("$FORM{'frame'}" eq 'top'){
if ($FORM{'password'} eq "$pass"){
&top
} else {
error("Password wrong!")
}
}
if($FORM{'mode'} eq 'register'){
if (($FORM{'name'} ne "") && ($FORM{'nick'} ne "") && ($FORM{'email'} ne "")){
my($username)=$FORM{'name'};
my($secname);
$username=~/^\s*(\w{1,20})\s*(\w{0,20}).*$/;
$secname=$2;$secname=~tr/A-Z/a-z/;$secname="\u$secname";
$username=$1;$username=~tr/A-Z/a-z/;$username="\u$username";
$FORM{'email'} =~ tr/A-Z/a-z/;
$FORM{'nick'} =~ tr/A-Z/a-z/;
if ($secname ne ""){$secname=" ".$secname};
$FORM{'name'}="$username$secname";
if (checkuser($FORM{'nick'})){
&adduser;
&afterreg;
sendreport("$fromaddr","Affiliate registration","\nYou have a new affiliate:\n\nName: $FORM{'name'}\nEmail: $FORM{'email'}\nNick: $FORM{'nick'}\nIP addr: $ENV{'REMOTE_ADDR'}\n");
&makepage;
} else {
@message=getfile("letter.txt");
$subject=shift(@message);
$letter=join("\n",@message);
&afterreg;
&sendmail;
sendreport("$fromaddr","Affiliate registration repeated","\nYou have a new affiliate:\n\nName: $FORM{'name'}\nEmail: $FORM{'email'}\nNick: $FORM{'nick'}\nIP addr: $ENV{'REMOTE_ADDR'}\n");
}
} else {
error("You have to fill all fields!");
}
} elsif($FORM{'mode'} eq 'delete'){
&deluser;
&editprosp
} elsif($FORM{'mode'} eq 'foradmin'){
&foradmin
} elsif($FORM{'mode'} eq 'editprosp'){
&editprosp
} elsif($FORM{'mode'} eq 'conf'){
letterbody("letter.txt");
} elsif($FORM{'mode'} eq 'mass'){
letterbody("letter1.txt");
} elsif($FORM{'mode'} eq 'savelet'){
&savelet;
$red="http://www.sellwide.net/remote/swresnews.shtml";
letterbody($file);
} elsif($FORM{'mode'} eq 'preview'){
&savelet;
&preview;
} elsif($FORM{'mode'} eq 'mailing'){
&mailer;
print "Content-type:text/html\n\n";
print <<_html2;
Congratulations!
The mailing has been started.
You will receive a confirmation e-mail when the mailing has been completed.
_html2
} elsif(keys(%FORM)){
@asss=keys(%FORM);
&addclick
} else {
&showform
};
sub savelet{
$subject=$FORM{'subject'};
$body=$FORM{'body'};
$body=~s/\r\s/\n/g;
$file=$FORM{'file'};
open(FILE,">$file");
flock(FILE,2);
print FILE "$subject\n$body\n";
close(FILE);
}
sub top{
print "Content-type:text/html\n\n";
print<<_html_;
menu bar