#======================================================#
# EveryAuction Addon
# Administration Menuing Add-on v1.2
#------------------------------------------------------#
# This version DOES NOT require the Edit Auction Add-on
#======================================================#
# PiTA - Park In The Alley Software (Auction-Script.com)
#======================================================#
# Author: Splatt 04/06/00
# justguns.com auction-script.com compalley.com
#------------------------------------------------------#
# Unauthorized redistribution is prohibited!!!
# The latest version of my addons can be found at:
# www.auction-script.com/addons
#======================================================#
#------------------------------------------------------#
# !! CHANGES NEEDED TO AUCTION.CGI !!
#------------------------------------------------------#
# Find this section in the beginning of the main code:
#
# &get_form_data; # parse arguments from post
# @ARGV = split(/\\*\&/, $ENV{'QUERY_STRING'});
# $ARGV[0] =~ s/\W//g;
# $ARGV[1] =~ s/\D//g;
#
#------------------------------------------------------#
#
# If it's not already, rem out the last line so it looks like this:
#
# &get_form_data; # parse arguments from post
# @ARGV = split(/\\*\&/, $ENV{'QUERY_STRING'});
# $ARGV[0] =~ s/\W//g;
# #$ARGV[1] =~ s/\D//g;
#
#------------------------------------------------------#
#------------------------------------------------------#
# Administration Menu Add-on
#------------------------------------------------------#
#------------------------------------------------------#
# This add-on is basically just a menuing system for all the admin functions.
# It uses mostly the built in features found in EveryAuction.
#
# SYNTAX: auction.cgi?your-admin-password
#
# It will allow you to Edit and Delete USERS.
# It will allow you to Edit and Delete AUCTIONS.
#
#------------------------------------------------------#
#------------------------------------------------------#
# !! CHANGES NEEDED TO AUCTION.CGI !!
#------------------------------------------------------#
# Add this line:
# elsif ($form{'action'} eq 'citm') { &changeitem; }
# After this line:
# elsif ($form{'action'} eq 'creg') { &proccreg; }
# Add this line to the auction script:
# elsif ($ARGV[2] eq 'e') { &editem; }
# After this line:
# elsif ($ARGV[2] eq 'r') { &remitem; }
#------------------------------------------------------#
# Place this in your elsif section, I have mine above the
# elsif ($ARGV[2] eq 'password') { &password; } in auction.cgi(.pl)
#------------------------------------------------------#
# elsif ($ARGV[0] eq $adminpass) { &admin; }
# elsif (($ARGV[0] eq 'admin_auct_edit') && ($ARGV[2] eq $adminpass)) { &admin_auct_edit; }
# elsif (($ARGV[0] eq 'admin_auct_rem') && ($ARGV[2] eq $adminpass)) { &admin_auct_rem; }
# elsif (($ARGV[0] eq 'admin_user_edit') && ($ARGV[2] eq $adminpass)) { &admin_user_edit; }
# elsif (($ARGV[0] eq 'admin_user_proc') && ($ARGV[2] eq $adminpass)) { &admin_user_proc; }
# elsif (($ARGV[0] eq 'admin_user_rem') && ($ARGV[2] eq $adminpass)) { &admin_user_rem; }
# elsif (($ARGV[0] eq 'moveuser') && ($ARGV[2] eq $adminpass)) { print "
ERROR MOVING FILE
" unless &movefile("$basepath$regdir/$ARGV[3]", "$basepath$oldreg/$ARGV[3]"); }
# End Add-on By: Splatt ##########################################
#------------------------------------------------------#
#------------------------------------------------------#
# NOTE: If you experience problems accessing the admin
# functions move the elsif statements farther up the
# existing elsif statements in auction.cgi
#------------------------------------------------------#
#------------------------------------------------------#
# M A I N P R O G R A M
#------------------------------------------------------#
#------------------------------------------------------#
# Admin Add-on: Directory to place deleted users
$oldreg = 'old_users';
#------------------------------------------------------#
# MAIN CODE
#------------------------------------------------------#
#------------------------------------------------------#
# Add-on Sub: Administration Utility
# Main Sub
#------------------------------------------------------#
sub admin {
print "";
print "Administration Utility
\n\n";
print "[Display Auctions For Editing]\n\n";
print "[Display Auctions For Deleting]
";
print "[Display Users For Editing]\n\n";
print "[Display Users For Deleting]
";
}
#------------------------------------------------------#
# Add-on Sub: Administration Utility
# Edit Auction Sub
#------------------------------------------------------#
sub admin_auct_edit {
if ($ARGV[2] ne $adminpass) { &badpassword; }
print "";
print "ADMIN: EDIT Auctions
\n";
print "\n";
print "| Item | Closes | Num Bids | High Bid |
\n";
foreach $key (sort keys %category) {
opendir THEDIR, "$basepath$key" || die "Unable to open directory: $!";
@allfiles = readdir THEDIR;
closedir THEDIR;
foreach $file (sort { int($a) <=> int($b) } @allfiles) {
if (-T "$basepath$key/$file") {
open THEFILE, "$basepath$key/$file";
($title, $reserve, $inc, $desc, $image, @bids) = ;
close THEFILE;
chomp($title, $reserve, $inc, $desc, $image, @bids);
@lastbid = split(/\[\]/,$bids[$#bids]);
$file =~ s/\.dat//;
@closetime = localtime($file);
$closetime[4]++;
@firstbid = split(/\[\]/,$bids[0]);
$timediff = ($file - time);
print "| $category{$key}\: $title | $closetime[4]/$closetime[3] | $#bids | \$$lastbid[2] |
\n";
}
}
}
print "
\n";
}
#------------------------------------------------------#
# Add-on Sub: Administration Utility
# Delete Auction Sub
# Uses EveryAuction Functions
#------------------------------------------------------#
sub admin_auct_rem {
if ($ARGV[2] ne $adminpass) { &badpassword; }
print "";
print "ADMIN: DELETE Auctions
\n";
print "Caution: Clicking on an item immediately deletes it!
";
print "\n";
print "| Item | Closes | Num Bids | High Bid |
\n";
foreach $key (sort keys %category) {
opendir THEDIR, "$basepath$key" || die "Unable to open directory: $!";
@allfiles = readdir THEDIR;
closedir THEDIR;
foreach $file (sort { int($a) <=> int($b) } @allfiles) {
if (-T "$basepath$key/$file") {
open THEFILE, "$basepath$key/$file";
($title, $reserve, $inc, $desc, $image, @bids) = ;
close THEFILE;
chomp($title, $reserve, $inc, $desc, $image, @bids);
@lastbid = split(/\[\]/,$bids[$#bids]);
$file =~ s/\.dat//;
@closetime = localtime($file);
$closetime[4]++;
@firstbid = split(/\[\]/,$bids[0]);
$timediff = ($file - time);
print "| $category{$key}\: $title | $closetime[4]/$closetime[3] | $#bids | \$$lastbid[2] |
\n";
}
}
}
print "
\n";
}
#------------------------------------------------------#
# Add-on Sub: Administration Utility
# Delete User Sub
# Uses EveryAuction Functions
#------------------------------------------------------#
sub admin_user_rem {
if ($ARGV[2] ne $adminpass) { &badpassword; }
print "";
print "ADMIN: DELETE Users
\n";
print "Caution: Clicking on an item immediately deletes it!
";
print "\n";
print "| User Name | Real Name | EMail | City ST ZIP | Password |
\n";
opendir THEDIR, "$basepath$regdir" || die "Unable to open directory: $!";
@allfiles = readdir THEDIR;
closedir THEDIR;
foreach $file (sort { int($a) <=> int($b) } @allfiles) {
if (-T "$basepath$regdir/$file") {
open REGFILE, "$basepath$regdir/$file";
($password,$email,$add1,$add2,$add3,@junk) = ;
chomp($password,$email,$add1,$add2,$add3,@junk);
close REGFILE;
$newname = substr($file,0,(length($file)-4));
print "| $newname | $add1 | $email | $add3 | $password |
\n";
}
}
print "
\n";
}
#------------------------------------------------------#
# Add-on Sub: Administration Utility
# Edit User Select Sub
#------------------------------------------------------#
sub admin_user_edit {
if ($ARGV[2] ne $adminpass) { &badpassword; }
print "";
print "ADMIN: EDIT Users
\n";
print "\n";
print "| User Name | Real Name | EMail | City ST ZIP | Password |
\n";
opendir THEDIR, "$basepath$regdir" || die "Unable to open directory: $!";
@allfiles = readdir THEDIR;
closedir THEDIR;
foreach $file (sort { int($a) <=> int($b) } @allfiles) {
if (-T "$basepath$regdir/$file") {
open REGFILE, "$basepath$regdir/$file";
($password,$email,$add1,$add2,$add3,@junk) = ;
chomp($password,$email,$add1,$add2,$add3,@junk);
close REGFILE;
$newname = substr($file,0,(length($file)-4));
print "| $newname | $add1 | $email | $add3 | $password |
\n";
}
}
print "
\n";
}
#------------------------------------------------------#
# Add-on Sub: Administration Utility
# Edit User Form Sub
#------------------------------------------------------#
sub admin_user_proc {
if (-f "$basepath$regdir/$ARGV[3]") {
&oops('ALIAS') unless (open(REGFILE, "$basepath$regdir/$ARGV[3]"));
($password,$email,$add1,$add2,$add3,@junk) = ;
chomp($password,$email,$add1,$add2,$add3,@junk);
close REGFILE;
$newname = substr($ARGV[3],0,(length($file)-4));
print "