#!/usr/bin/perl ############################################## # # EveryAuction # von Matt Hahnfeld, EverySoft # # Ins Deutsche übersetzt von Dan Sepeur # URL: http://www.tag4tag.com # Mail: dan@tentacle.de # # Die erste FreewareAuktion von den Machern # von EveryChat(tm). # # Version 1.01 (5/10/98) # # Sie dürfen dieses Script für persönliche # Zwecke und den Einsatz in Firmen, aber nicht # für den Verkauf ohne die schriftliche Genehmigung # des Autors verändern und modifizieren. # Weiterhin übernimmt der Autor keine Garantie # für die beim Einsatz dieses Scriptes entstandenen # Schaden an Hard und Software. # # DER WIEDERVERKAUF IN JEGLICHER FORM IST STRIKT # VERBOTEN! # # (c) 1998 EverySoft # # http://www.everysoft.com/auction/ # ############################################## ############################################## # Der Input-String hat folgende Form: # auction.cgi?[category]&[number]&[r|n|u|c|v] # # Wenn dieser nicht gegeben ist, zeigt das # Script beim Aufruf eine Übersicht der # Kategorien. # # Wenn ein Kategorieverzeichnis angegeben ist # zeigt das Script die Einträge in dieser # Kategorie. # # Wenn das Kategorieverzeichnis und die # Eintragsnnummer angegeben wird, zeigt # das Script den Eintrag. # # Wenn das Kategorieverzeichnis, die # Eintragsnummer und der Buchstabe "r" # angegeben wird, dann wird der Eintrag # aus der Datenbank gelöscht. # # Wenn das Kategorieverzeichnis, die # Eintragsnummer und der Buchstabe "n" # angegeben wird, dann wird ein neuer Eintrag # generiert. Die Eintragsnummer wird dann # ignoriert. # # Wenn das Kategorieverzeichnis, die # Eintragsnummer und der Buchstabe "u" # angegeben wird, kann man einen neuen # User registrieren. Die Eintragsnummer # wird auch in diesem Falle ignoriert. # # Wenn das Kategorieverzeichnis, die # Eintragsnummer und der Buchstabe "c" # angegeben wird, dann kann der User seine # Registrierdaten ändern. Hierbei wird # wiederum die Eintragsnummer ignoriert. # # Wenn das Kategorieverzeichnis, die # Eintragsnummer und der Buchstabe "v" # angegeben wird, dann kann der User # seinen persönlichen Status einsehen. # Dieser zeigt ihm, an welchen Auktionen # er aktiv teilgenommen hat und was er # schon alles ersteigert hat. Die # Eintragnsummer wird auch hier ignoriert. # # ############################################## # Konfigurationssektion # Editieren Sie diese Variablen # Das Basisverzeichnis. Wir brauchen den # absoluten Pfad für das Basisverzeichnis. # Achten Sie auf den abschliessenden Slash (/). # ER MUSS GESETZT SEIN, SONST LÄUFT DIE # AUKTION NICHT! $basepath = '/home/www/doc/gemaelde_boersede//auktion/index.html'; # Verzeichnis für geschlossene Auktionen # Hier werden die Informationen über abgelaufene # Auktionen gespeichert. Wenn Sie diese Infos # nicht speichern wollen, so lassen Sie die # Variable einfach frei. Dies würde Ihnen ein # wenig Speicherplatz sparen (''). # Ansonsten müssen Sie es anlegen. $closedir = 'closed'; # Userregistrierungsverzeichnis. # In diesem Verzeichnis werden die Userregistrierungen # gespeichert. Wenn Sie nicht möchten, daß eine # Registrierung erforderlich ist, lassen Sie die # Variable einfach frei. Dies spart Ihnen ein wenig # Speicherplatz. Ansonsten muss das Verzeichnis # angelegt werden. $regdir = 'reg'; # Listen Sie hier die Verzeichnisse und die # damit verbundenen Kategorienamen. # Die Verzeichnisse müssen Unterverzeichnisse # Ihres Basisverzeichnisses sein. %category = ( g_zeitg => 'Modern & Contemporary Art', g_20_jh => 'Paintings of the 20th Century', g_19_jh => 'Paintings of the 19th Century', g_17_jh => 'Old Master Paintings', h_aqua => 'Watercolor, Works on Paper', m_print => 'Engravings, Prints', p_cont => 'Contemporary Art Photography', p_hist => 'Historical Art Photography', v_antique => 'Antique Sculptures', v_varia => 'Contemporary Sculptures', w_erotic => 'Erotic Art', ); # Dies ist das Kennwort um Auktionen zu löschen. # Lassen Sie diesen Eintrag frei um jedem die # Möglichkeit zu geben, Einträge zu löschen. $adminpass = 'w7wolf'; # Hier wird es etwas schwieriger. # Der Autor schreibt, man solle hier die # IP-ADRESSE des Mailservers angeben, den # man zum versenden der Mails an den Bieter # oder den Verkäufer benutzen möchte. Da wir # aber alle mehr oder weniger Sendmail einsetzen # habe ich (Dan Sepeur) diese Angabe so umgestellt, # dass man nur noch den Pfad zu Sendmail angeben # muss. Es wurde weiter unterhalb auch eine # entsprechende Routine eingebunden. Also: # Bitte Pfad zu Sendmail angeben. $mailserver = "sendmail"; # Diese Zeile gibt die URL zu Ihrem Server # wieder. Sie wird benutzt zum senden von # eMails mit der "Überboten-Nachricht". # Das Script erkennt das Ende der URL # automatisch. Man braucht keinen abschliessenden # Slash (/) zu setzen. Wenn Sie keine # "Sie sind überboten worden" - eMail senden # wollen, dann lassen Sie dieses Feld bitte leer. $scripturl = "www.gemaelde-boerse.de"; # Hier können Sie die Farben für die Tabellen # und mehr angeben, die generiert werden sollen. # Die voreingestellte Kombination macht schon # einen sehr professionellen Eindruck. # Werte müssen im HEX-Format angegeben sein. $colorbg = '#000000'; $colortext = '#000000'; $colorlink = '#FFCC00'; $colorvlink = '#FFCC00'; $coloralink = '#FF0000'; $colortablehead = '#FFCC00'; $colortablebody = '#666666'; # Der Seitenname (Wird in den Kopf jeder Seite gestellt) $sitename = 'Fine Art Stock Market - Fine Art Auctions'; # Hier kann festgelegt werden, ob die Auktion # eine bestimmte Zeit nach dem Höchstgebot geschlossen # werden soll oder ob sie regulär, auch wenn das # Höchstgebot schon eingegangen ist, den vordefinierten # Zeitraum ablaufen soll. # Die Angabe steht für Minuten. # Setzen Sie eine 0, so wird die Auktion ganz # normal ablaufen, setzen Sie eine 5, dann wird # die Auktion 5 Minuten nach dem Eingang des # Höchstgebotes geschlossen. $aftermin = 0; # File locking aktivieren? 1 (ja) # für die meisten Systeme aber setzen Sie es auf # 0 (nein) wenn Sie Flock-Fehler oder Script- # Zusammenbrüche reportiert haben möchten. $flock = 1; # Darf der User posten? 1=ja 0=nein $newokay = 1; ############################################## # HAUPTPROGRAMM # AB HIER BRAUCHEN SIE NICHTS MEHR ZU VERÄNDERN ############################################## # Den Seitenheader ausgeben # print "Content-type: text/html\n\n"; print <<"EOF"; Fine Art Stock Market - Fine Art Auctions EOF print ""; # Advertising Banners #
Please visit our sponsors.
print <<"EOF";
Fine Art Stock Market Home Stock Market
Zurück German Site
Fine Art Stock Market - Fine Art Auctions
Fine Art Auctions
  
Galleries Paintings Artists Photography Exhibitions Auctions Service
EOF #print ""; #print " [Register] "; #print " [Post Item]
" if ($newokay); #print " [Categories] "; #print " [All Items]
"; #print " [Change Registration] " if ($regdir); #print " [Forgot Password] "; #print " [Closed Auctions] " if ($regdir) && ($closedir); #print "

Keyword Username Item Number
\n"; # print <<"EOF"; print "
"; print ""; print ""; print "" if ($newokay); print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "" if ($regdir); print "" if ($regdir); print ""; print ""; print "" if ($regdir) && ($closedir); print"
WIDTH=1
New User Registration
Post a new Item
WIDTH=1
Fine Art Categories
"; &dispcat; print "
WIDTH=1

Keyword Username Item Number
WIDTH=1
List all Auctions
List all Auctions (with pictures)
Mail this Auction to a Friend
WIDTH=1
FAQ
User Agreement
WIDTH=1
Change Registration
Lost Your Password
WIDTH=1
Closed Auctions
"; print "
   "; # ############################################## &get_form_data; # parse arguments from post @ARGV = split(/\\*\&/, $ENV{'QUERY_STRING'}); $ARGV[0] =~ s/\W//g; #$ARGV[1] =~ s/\D//g; if ($form{'action'} eq 'bid') { &procbid; } elsif ($form{'action'} eq 'new') { &procnew; } elsif ($form{'action'} eq 'reg') { &procreg; } elsif ($form{'action'} eq 'creg') { &proccreg; } elsif ($form{'action'} eq 'citm') { &changeitem; } elsif ($form{'action'} eq 'repost') { &newitem; } elsif ($form{'action'} eq 'closeditems1') { &viewclosed1; } elsif ($form{'action'} eq 'closeditems2') { &viewclosed2; } elsif ($form{'searchstring'}) { &procsearch; } ########### 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]"); } # # MailTo Add-on ############################## elsif ($form{'action'} eq 'mailto') { &mailtosend; } elsif ($ARGV[0] eq 'mailto') { &mailto; } # # End Add-on ################################# elsif ($form{'action'} eq 'password1') { &password2; } elsif ($ARGV[2] eq 'password') { &password; } elsif ($ARGV[0] eq 'allnp') { &allcategorynp; } elsif ($ARGV[0] eq 'all') { &allcategory; } elsif ($ARGV[0] eq 'close') { &autoclose; } elsif ($ARGV[2] eq 'u') { &newreg; } elsif ($ARGV[2] eq 'c') { &changereg; } elsif ($ARGV[2] eq 'v') { &viewclosed; } elsif ($ARGV[2] eq 'n') { &newitem; } elsif (($regdir ne "") && ($ARGV[0] eq $regdir)) { &dispmain; } # be sure nobody is trying to hack the user dir elsif (!(($ARGV[0]) && (-d "$basepath$ARGV[0]"))) { &dispmain; } elsif ($ARGV[2] eq 'r') { &remitem; } elsif ($ARGV[2] eq 'e') { &editem; } elsif (!(($ARGV[1]) && (-f "$basepath$ARGV[0]/$ARGV[1].dat"))) { &displist; } else { &dispitem; } ############################################## # Seitenfuss ausgeben # print <<"EOF";
Fine Art Auctions
  
Forum Mailing List Offers Wanted Contact Links Search Top
© 1998, 1999 PDM All rights reserved
Powered by EveryAuction 1.01
BRD.NET
Site Meter
Click here to visit our sponsor
Free Advertising from Click2Net!
EOF # ############################################## ############################################## # Sub: Anzeigen der Kategorieliste # sub dispcat { print "\n"; foreach $key (sort keys %category) { opendir THEDIR, "$basepath$key" || die "Unable to open directory: $!"; @allfiles = grep -T, map "$basepath$key/$_", readdir THEDIR; closedir THEDIR; $numfiles = @allfiles; umask(000); # UNIX file permission junk mkdir("$basepath$key", 0777) unless (-d "$basepath$key"); print "$category{$key} ($numfiles)
"; } print "
\n"; } ############################################## ############################################## # Sub: Anzeigen der Hauptseite # sub dispmain { print <<"EOF";


The Fine Art Stock Market Auction is an online auction selling high quality Fine Art like Paintings, Fine Art Photography, Sculptures and Fine Art Prints.

Fine Art Auctions

E.H. Compton
South Bavarian Countryside with Farmhouse
EOF } ############################################## # Sub: Anzeigen der Liste von Einträgen # sub displist { print "
"; print "
$category{$ARGV[0]}
"; print "\n"; print "\n"; opendir THEDIR, "$basepath$ARGV[0]" || die "Unable to open directory: $!"; @allfiles = readdir THEDIR; closedir THEDIR; foreach $file (sort { int($a) <=> int($b) } @allfiles) { if (-T "$basepath$ARGV[0]/$file") { open THEFILE, "$basepath$ARGV[0]/$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]++; $camera="(none)"; # $camera = " [Mit Bild]" if (/gemaelde_boerse_cgi/image/index.jpg); $camera = "" if (/gemaelde_boerse_cgi/image/index.jpg); print "\n"; } } print "
ItemPictureClosingNum BidsHigh Bid
$title$camera$closetime[4]/$closetime[3]$#bidsUS\$ $lastbid[2]
\n"; } ############################################## # Sub: Eintrag anzeigen # Hier wird die Kartei für einen einzelnen # Eintrag angezeigt und alle seine Statistiken. sub dispitem { open THEFILE, "$basepath$ARGV[0]/$ARGV[1].dat"; ($title, $reserve, $inc, $desc, $image, @bids) = ; close THEFILE; chomp($title, $reserve, $inc, $desc, $image, @bids); @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); $nowtime = localtime(time); $closetime = localtime($ARGV[1]); $image = "" if (/gemaelde_boerse_cgi/image/index.jpg); print "
"; print "
$title
"; $reservemet = ""; $reservemet = "(reserve price not yet met)" if ($lastbid[2] < $reserve); $reservemet = "(reserve price met)" if (($lastbid[2] >= $reserve) && ($reserve > 0)); print "$image
"; print "
$title
Category: $category{$ARGV[0]}
Offered by: $firstbid[0]
Current Date: $nowtime
Closing: $closetime
or $aftermin minutes after the last bid...
Number of Bids: $#bids
Last Bid: US\$ $lastbid[2] $reservemet
Mail this Auction to a Friend
\n"; print "
"; print "
Description
"; print "$desc"; print "
"; print "
Bid History
"; print "START: "; foreach $bid (@bids) { @thebid = split(/\[\]/,$bid); $bidtime = localtime($thebid[3]); print "$thebid[0] \($bidtime\) - US\$ $thebid[2]
"; } if ((time > $ARGV[1]) && (time > (60 * $aftermin + $thebid[3]))) { print "BIDDING IS NOW CLOSED
"; &closeit; } else { &placebid; } } ############################################## # Sub: Setzen eines Gebots # sub placebid { $lowbid = &parsebid($lastbid[2] + $inc); print <<"EOF";
EOF print "
"; print "
Place A Bid
"; print <<"EOF"; EOF } else { print <<"EOF";

Registration is required to post or bid!

The High Bid Is: US\$ $lastbid[2]
The Lowest You May Bid Is: US\$ $lowbid

Please note that by placing a bid you are making a contract between you and the seller. Once you place a bid, you may not retract it. In some states, it is illegal to win an auction and not purchase the item. In other words, if you don't want to pay for it, don't bid!

EOF if ($regdir eq "") { print <<"EOF";

Your Handle/Alias: (used to track your bid)


Your E-Mail Adress: (must be valid)

Your Bid: US\$

Contact Information: (will be given out only to the seller)

Full Name:

Street Address:

City, State, ZIP, Country:

Your Handle/Alias: (used to track your bid)
Your Password: (must be valid)
Your Bid:US\$

EOF } print <<"EOF";
EOF } ############################################## # Sub: Gebot verarbeiten # sub procbid { if (($regdir ne "") && !($newbidflag)) { $form{'ALIAS'} =~ s/\W//g; $form{'ALIAS'} = lc($form{'ALIAS'}); $form{'ALIAS'} = ucfirst($form{'ALIAS'}); &oops('ALIAS') unless (open(REGFILE, "$basepath$regdir/$form{'ALIAS'}.dat")); ($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids) = ; close REGFILE; chomp($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids); &oops('PASSWORD') unless ((lc $password) eq (lc $form{'PASSWORD'})); } &oops('ALIAS') unless ($form{'ALIAS'}); &oops('EMAIL') unless ($form{'EMAIL'} =~ /.+\@.+/); &oops('BID') unless ($form{'BID'} =~ /^(\d+\.?\d*|\.\d+)$/); $form{'BID'} = &parsebid($form{'BID'}); &oops('ADDRESS1') unless ($form{'ADDRESS1'}); &oops('ADDRESS2') unless ($form{'ADDRESS2'}); &oops('ADDRESS3') unless ($form{'ADDRESS3'}); $timenum = time; $thetime = localtime(time); &oops('ITEM') unless (open ITEM, "$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat"); ($title, $reserve, $inc, $desc, $image, @bids) = ; close ITEM; chomp($title, $reserve, $inc, $desc, $image, @bids); @lastbid = split(/\[\]/,$bids[$#bids]); if ((((time <= $form{'ITEM'}) || (time <= (60 * $aftermin + $lastbid[3]))) && ($form{'BID'} >= $lastbid[2] + $inc)) || ($newbidflag == 1)) { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'ALIAS'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; print "$form{'ALIAS'}, Your Bid has been place on item number $form{'ITEM'} for US\$ $form{'BID'} on
You may want to print this notice as confirmation of your bid.

Go back to the item\n"; $flag=0; foreach $userbid(@userbids) { $flag=1 if ("$form{'CATEGORY'}$form{'ITEM'}" eq $userbid); } if ($flag==0 && $regdir ne "") { &oops('ALIAS') unless (open(REGFILE, ">>$basepath$regdir/$form{'ALIAS'}.dat")); print REGFILE "\n$form{'CATEGORY'}$form{'ITEM'}"; close REGFILE; } &sendemail($lastbid[1], 'You\'ve been outbid!', 'nobody', $mailserver, "You have been outbid on $title\! If you want to place a higher bid, please visit\:\n\n\thttp://$scripturl$ENV{'SCRIPT_NAME'}\?$form{'CATEGORY'}\&$form{'ITEM'}\n\nThe current High Bid is US\$$form{'BID'}.") if (($newbidflag != 1) && $scripturl); } else { print "Either the auction is closed or your bid is too low.
Hit the back button and reload to get the latest auction stats, then try again!\n"; } } ############################################## # Sub: Auktion schliessen # Hier wird der Status "geschlossen" gesetzt sub closeit { if ($ARGV[0] ne $closedir) { # We'll use the @firstbid and @lastbid info defined in &dispitem if ($closedir) { umask(000); # UNIX file permission junk mkdir("$basepath$closedir", 0777) unless (-d "$basepath$closedir"); print "Please notify the site admin that this item cannot be copied to the closed directory even though it is closed.\n" unless &movefile("$basepath$ARGV[0]/$ARGV[1].dat", "$basepath$closedir/$ARGV[0]$ARGV[1].dat"); } else { print "Please notify the site admin that this item cannot be removed even though it is closed.\n" unless unlink("$basepath$ARGV[0]/$ARGV[1].dat"); } if ($lastbid[2] >= $reserve) { &sendemail($lastbid[1], "Auction Close: $title", $firstbid[1], $mailserver, "Congratulations! You are the winner of auction number $ARGV[1].\nYour winning bid was US\$$lastbid[2].\n\nPlease contact the seller to make arrangements for payment and shipping::\n\n$firstbid[4]\n$firstbid[5]\n$firstbid[6]\n$firstbid[1]\n\nThank you for using Fine Art Stock Market Auction!"); } else { &sendemail($lastbid[1], "Auction Close: $title", $firstbid[1], $mailserver, "Congratulations! You were the high bidder on auction number $ARGV[1].\nYour bid was US\$$lastbid[2].\n\nUnfortunately, your bid did not meet the seller\'s reserve price...\n\nYou may still wish to contact the seller to negotiate a fair price:\n\n$firstbid[4]\n$firstbid[5]\n$firstbid[6]\n$firstbid[1]\n\nThank you for using Fine Art Stock Market Auction!"); } &sendemail($firstbid[1], "Auction Close: $title", $lastbid[1], $mailserver, "Auction Number $ARGV[1] Is Now Closed.\nThe High Bid Was US\$$lastbid[2] (Your reserve was: US\$$reserve).\n\nPlease contact the high bidder to make any necessary arrangements:\n\n$lastbid[4]\n$lastbid[5]\n$lastbid[6]\n$lastbid[1]\n\nThank you for using Fine Art Stock Market Auction!"); } } ############################################## # Sub: Eintrag löschen # Hier wird ein Eintrag aus der Auktionsdatenbank # gelöscht. sub remitem { if ($ARGV[3] eq $adminpass) { if (unlink("$basepath$ARGV[0]/$ARGV[1].dat")) { print "Datei wurde erfolgreich gelöscht!\n"; } else { print "Datei konnte nicht gelöscht werden!\n"; } } else { print "Sorry... falsches Administrator-Kennwort zum löschen!\n"; } } ############################################## # Sub: Eintrag hinzufügen # sub newitem { $inc = "100.00"; if ($form{'REPOST'}) { if (open (THEFILE, "$basepath$closedir/$form{'REPOST'}.dat")) { ($title, $reserve, $inc, $desc, $image, @bids) = ; $title =~ s/\"//g; # quotes cause problems for a text input field @lastbid = split(/\[\]/,$bids[$#bids]); close THEFILE; } } print <<"EOF"; EOF print "

"; print "
Post A New Item
"; print <<"EOF";
Titel/Item Name:
No HTML
Category:
Please select
Image URL:
Optional. Should be no larger than 200x200.
Days Until Close:
1-14
Description:
May include HTML - This should include the condition of the item, payment and shipping information, and any other information the buyer should know.
Please note that by placing an item up for bid you are making a contract between you and the buyer. Once you place an item, you may not retract it and you must sell it for the highest bid. In other words, if you don't want to sell it, don't place it up for bid! EOF if ($regdir eq "") { print <<"EOF";
Your Handle/Alias:
Used to track your post
Your E-Mail Address:
Must be valid
Your Starting Bid:US\$
Your Reserve Price:
You are not obligated to sell below this price. Leave blank if none.
US\$
Bid Increment:US\$
Contact Information:
Will be given out only to the buyer
Full Name Name:

Street Adress:

City, State, ZIP, Country:
EOF } else { print <<"EOF";

Registration is required to post or bid! Your Handle/Alias:
Used to track your post Your Password:
Must be valid Your Starting Bid:US\$ Your Reserve Price:
You are not obligated to sell below this price. Leave blank if none.US\$ Bid Increment:US\$ EOF } print <<"EOF";

EOF } ############################################## # Sub: Voransicht # Zeigt die Voransicht des neuen Eintrages. sub preview { $nowtime = localtime(time); $closetime = localtime($form{'ITEM'}); $image = "" if ($form{'IMAGE'}); print "
"; print "
Preview Information
"; #print "

$form{'TITLE'} PREVIEW


Information
\n"; print "$image
$form{'TITLE'}
Category: $category{$form{'CATEGORY'}}
Offered by: $form{'ALIAS'}
Current Time: $nowtime
Closes: $closetime
or $aftermin minutes after last bid...
Number of Bids: 0
Last Bid: US\$ $form{'BID'}
\n"; #print "Description"; #print "$desc"; print "
"; print "
Description
"; print "$form{'DESC'}"; print "
If this looks good, hit ,
else hit the back button on your browser to edit the item.
\n"; foreach $key (keys %form) { $form{$key} =~ s/\>/\[greaterthansign\]/gs; $form{$key} =~ s/\\n"; } print "\n"; } ############################################## # Sub: Eintrag annehmen und in das System integrieren # sub procnew { if ($regdir ne "") { $form{'ALIAS'} =~ s/\W//g; $form{'ALIAS'} = lc($form{'ALIAS'}); $form{'ALIAS'} = ucfirst($form{'ALIAS'}); &oops('ALIAS') unless (open(REGFILE, "$basepath$regdir/$form{'ALIAS'}.dat")); ($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids) = ; close REGFILE; chomp($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids); &oops('PASSWORD') unless ((lc $password) eq (lc $form{'PASSWORD'})); } &oops('TITLE') unless ($form{'TITLE'} && (length($form{'TITLE'}) < 51)); $form{'TITLE'} =~ s/\/\>\;/g; &oops('CATEGORY') unless (-d "$basepath$form{'CATEGORY'}"); $form{'IMAGE'} = "" if ($form{'IMAGE'} eq "http://"); &oops('DAYS') unless (($form{'DAYS'} > 0) && ($form{'DAYS'} < 15)); &oops('DESC') unless ($form{'DESC'}); &oops('ALIAS') unless ($form{'ALIAS'}); &oops('EMAIL') unless ($form{'EMAIL'} =~ /.+\@.+/); &oops('BID') unless ($form{'BID'} =~ /^(\d+\.?\d*|\.\d+)$/); &oops('INC') unless (($form{'INC'} =~ /^(\d+\.?\d*|\.\d+)$/) && ($form{'INC'} >= .01)); $form{'INC'} = &parsebid($form{'INC'}); $form{'RESERVE'} = &parsebid($form{'RESERVE'}); &oops('ADDRESS1') unless ($form{'ADDRESS1'}); &oops('ADDRESS2') unless ($form{'ADDRESS2'}); &oops('ADDRESS3') unless ($form{'ADDRESS3'}); $form{'ITEM'} = ($form{'DAYS'} * 86400 + time); $form{'ITEM'} = ($form{'DAYS'} * 86400 + time) until (!(-f "$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat")); if ($form{'FROMPREVIEW'}) { foreach $key (keys %form) { $form{$key} =~ s/\[greaterthansign\]/\>/gs; $form{$key} =~ s/\[lessthansign\]/\$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'TITLE'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'DESC'}\n$form{'IMAGE'}"; close NEWAUCTION; print "

$form{'TITLE'} was posted under: $category{$form{'CATEGORY'}}...

\n"; $newbidflag=1; &procbid; } else { &preview; } } ############################################## # Sub: Suchvorgang # Zeigt die Suchergebnisse an sub procsearch { print "
"; print "
Search Results- $form{'searchstring'}
"; # print "

Suchergebnisse - $form{'searchstring'}

"; print "\n"; print "\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]++; if($form{'searchtype'} eq 'keyword') { print "\n" if (($title =~ /$form{'searchstring'}/i) || ($desc =~ /$form{'searchstring'}/i)); } elsif($form{'searchtype'} eq 'itemnumber') { print "\n" if (($file =~ /$form{'searchstring'}/i)); } elsif($form{'searchtype'} eq 'username') { $flag=0; foreach $bid(@bids) { if (($bid =~ /$form{'searchstring'}/i) && ($flag==0)) { print "\n"; $flag=1; } } } } } } print "
ItemClosesNum BidsHigh Bid
$key\: $title $newicon$hoticon$closetime[4]/$closetime[3]$#bidsUS\$ $lastbid[2]
$key\: $title $newicon$hoticon$closetime[4]/$closetime[3]$#bidsUS\$ $lastbid[2]
$key\: $title $newicon$hoticon$closetime[4]/$closetime[3]$#bidsUS\$ $lastbid[2]
\n"; } ############################################## # Sub: Benutzerdaten ändern # sub changereg { print <<"EOF";
EOF print "
"; print "
Change Registration
"; print <<"EOF";
This form will allow you to change your street address and/or password.
Your Handle/Alias:
Required for verification
Your Current Password:
Required for verification
Your New Password:
Leave blank if unchanged
Confirm Your New Password:
Leave blank if unchanged
Contact Information:
Leave blank if unchanged
Full Name:

Street Address:

City, State, ZIP, Country:
EOF } ############################################## # Sub: Eintragen der neuen Benutzerdaten # sub proccreg { if ($regdir) { &oops('ALIAS') unless ($form{'ALIAS'}); &oops('OLD PASSWORD') unless ($form{'OLDPASS'}); if ($form{'ADDRESS1'}) { &oops('ADDRESS2') unless ($form{'ADDRESS2'}); &oops('ADDRESS3') unless ($form{'ADDRESS3'}); } if ($form{'NEWPASS1'}) { &oops('NEW PASSWORD VERIFICATION') unless ($form{'NEWPASS2'} eq $form{'NEWPASS1'}); } $form{'ALIAS'} =~ s/\W//g; $form{'ALIAS'} = lc($form{'ALIAS'}); $form{'ALIAS'} = ucfirst($form{'ALIAS'}); if (-f "$basepath$regdir/$form{'ALIAS'}.dat") { &oops('ALIAS') unless (open(REGFILE, "$basepath$regdir/$form{'ALIAS'}.dat")); ($password,$email,$add1,$add2,$add3,@junk) = ; chomp($password,$email,$add1,$add2,$add3,@junk); close REGFILE; &oops('OLD PASSWORD') unless ((lc $password) eq (lc $form{'OLDPASS'})); $form{'NEWPASS1'} = $password if !($form{'NEWPASS1'}); $form{'ADDRESS1'} = $add1 if !($form{'ADDRESS1'}); $form{'ADDRESS2'} = $add2 if !($form{'ADDRESS2'}); $form{'ADDRESS3'} = $add3 if !($form{'ADDRESS3'}); &oops('ALIAS') unless (open NEWREG, ">$basepath$regdir/$form{'ALIAS'}.dat"); print NEWREG "$form{'NEWPASS1'}\n$email\n$form{'ADDRESS1'}\n$form{'ADDRESS2'}\n$form{'ADDRESS3'}"; foreach $bid (@junk) { print NEWREG "\n$bid"; } close NEWREG; print "
"; print "
Registration data changed succesfully
"; print "$form{'ALIAS'}, your information has been successfully changed.\n"; } else { print "
"; print "
Message
"; print "Sorry... That Username is not valid. If you do not have an alias (or cannot remember it) you should create a new account.\n"; } } else { print "
"; print "
Message
"; print "User Registration is Not Implemented on This Server! The System Administrator Did Not Specify a Registration Directory...\n"; } } ############################################## # Sub: Neue Registrierung # sub newreg { print <<"EOF"; EOF print "
"; print "
New User Registration
"; print <<"EOF";
This form will allow you to register to buy or sell auction items. You must enter accurate data, and your new password will be e-mailed to you. Please be patient after hitting the submit button. Registration may take a few seconds.
Your Handle/Alias:
Used to track your post
Your E-Mail Address:
Must be valid
Contact Information:
Will be given out only to the buyer or seller
Full Name:

Street Address:

City, State, ZIP, Country:
With the Registration you are accepting our User Agreement
EOF } ############################################## # Sub: Neuen User Anlegen # sub procreg { if ($regdir) { umask(000); # UNIX file permission junk mkdir("$basepath$regdir", 0777) unless (-d "$basepath$regdir"); &oops('ALIAS') unless ($form{'ALIAS'}); &oops('EMAIL') unless ($form{'EMAIL'} =~ /.+\@.+/); &oops('ADDRESS1') unless ($form{'ADDRESS1'}); &oops('ADDRESS2') unless ($form{'ADDRESS2'}); &oops('ADDRESS3') unless ($form{'ADDRESS3'}); $form{'ALIAS'} =~ s/\W//g; $form{'ALIAS'} = lc($form{'ALIAS'}); $form{'ALIAS'} = ucfirst($form{'ALIAS'}); if (!(-f "$basepath$regdir/$form{'ALIAS'}.dat")) { &oops('NEWREG') unless (open NEWREG, ">$basepath$regdir/$form{'ALIAS'}.dat"); $newpass = &randompass; print NEWREG "$newpass\n$form{'EMAIL'}\n$form{'ADDRESS1'}\n$form{'ADDRESS2'}\n$form{'ADDRESS3'}"; close NEWREG; print "
"; print "
Registration completed
"; print "$form{'ALIAS'}, you should receive an e-mail to $form{'EMAIL'} in a few minutes. It will contain your password needed to post or bid. You may change your password once you receive it. If you do not get an e-mail, please re-register.\n"; &sendemail($form{'EMAIL'}, 'Fine Art Stock Market Auction Password', 'nobody', $mailserver, "PLEASE DO NOT REPLY TO THIS E-MAIL.\n\Thank you for registering to use our auction!\n\nYour new Password is: $newpass\nYour alias (as you entered it) is: $form{'ALIAS'}\n\nThank you for visiting!"); } else { print "
"; print "
Message
"; print "Sorry... that alias is taken. Hit back to try again!\n"; } } else { print "User Registration is Not Implemented on This Server! The System Administrator Did Not Specify a Registration Directory..\n"; } } ############################################## # Sub: Generiere ein Passwort # Generiert ein 8 Buchstaben langes Passwort sub randompass { srand(time ^ $$); @passset = ('a'..'k', 'm'..'n', 'p'..'z', '2'..'9'); $randpass = ""; for ($i = 0; $i < 8; $i++) { $randum_num = int(rand($#passset + 1)); $randpass .= $passset[$randum_num]; } return $randpass; } ############################################## # Sub: Analysiere Gebot # Dies gibt Ihrem Gebot das entsprechende aussehen... # z.B. DM ###.## sub parsebid { $_[0] =~ s/\,//g; @bidamt = split(/\./, $_[0]); $bidamt[0] = "0" if (!($bidamt[0])); $bidamt[0] = int($bidamt[0]); $bidamt[1] = substr($bidamt[1], 0, 2); $bidamt[1] = "00" if (length($bidamt[1]) == 0); $bidamt[1] = "$bidamt[1]0" if (length($bidamt[1]) == 1); return "$bidamt[0].$bidamt[1]"; } ############################################## # Sub: Oops! # Hier werden Fehlermeldungen generiert. sub oops { print "
"; print "
Message
"; print "Something is wrong with the $_[0] - field. Hit back to try again!\n"; die "Something is wrong with the $_[0] - field. Hit back to try again!\n"; #die "Something is wrong with the $_[0] - field. Hit back to try again!\n"; } ############################################## # Sub: Datei verschieben(file1, file2) # Dieses Sub verschiebt Datien. Schnell und sauber! sub movefile { ($firstfile, $secondfile) = @_; return 0 unless open(FIRSTFILE,$firstfile); @lines=; close FIRSTFILE; return 0 unless open(SECONDFILE,">$secondfile"); foreach $line (@lines) { print SECONDFILE $line; } close SECONDFILE; return 0 unless unlink($firstfile); return 1; } ############################################## # SUB: eMail senden # Dies ist der Original-Mailer, der von Dan # ausgeklammert wurde, da er nicht korrekt lief. # Jetzt werden die Mails mit einem Sendmailer # verschickt, der in der nächsten Sektion # steht. # # Nimmt: # (To, Subject, Reply-To, IP ADDRESS of SMTP host, Message) #sub sendemail { # use Socket; # $TO=$_[0]; @TO=split('\0',$TO); # $SUBJECT=$_[1]; # $REPLYTO=$_[2]; # $REMOTE = $_[3]; # $THEMESSAGE = $_[4]; # if ($REMOTE =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) { # $addr = pack('C4', $1, $2, $3, $4); # } # else { die("Bad IP address: $!"); } # $port = 25 unless $port; # $port = getservbyname($port,'tcp') if $port =~ /\D/; # $proto = getprotobyname('tcp'); # socket(S, PF_INET, SOCK_STREAM, $proto) or die("Socket failed: $!"); # $sockaddr = 'S n a4 x8'; # shouldn't this be in Socket.pm? # connect(S, pack($sockaddr, AF_INET, $port, $addr)) or die("Unable to connect: $!"); # # select(S); $| = 1; select(STDOUT); # $a=; # print S "HELO ${SERVERNAME}\n"; # $a=; # print S "MAIL FROM:\n"; # $a=; # print S "RCPT TO:<$TO[0]>\n"; # $a=; # if ($#TO > 0) { foreach (1..$#TO) { print S "RCPT TO: $TO[$_]\n";$a=; } # } # print S "DATA \n"; # $a=; # print S "To: $TO[0]\n"; # if ($#TO > 0) { foreach (1..$#TO) { print S "Cc: $TO[$_]\n"; } # } # print S "Subject: $SUBJECT\n"; # print S "Reply-To: $REPLYTO\n"; # # # Print the body # print S "$THEMESSAGE\n"; # print S ".\n"; # $a=; # print S "QUIT"; # close (S); #} ############################################## # SUB: Send E-mail # UNIX Sendmail Version # wird benutzt, wenn die Originalversion nicht # läuft. Man kann dieses SUB ja auch mal ausklammern # und den Originalmailer einmal laufen lassen. # Vielleicht gehts ja. # # Nimmt: # (To, Subject, Reply-To, Mail Programm (z.B. sendmail), Message) sub sendemail { $TO=$_[0]; @TO=split('\0',$TO); $SUBJECT=$_[1]; $REPLYTO=$_[2]; $REMOTE = $_[3]; $THEMESSAGE = $_[4]; open(S, "|$REMOTE -t"); print S "To: $TO[0]\n"; print S "From: \n"; print S "Subject: $SUBJECT\n"; print S "Reply-To: $REPLYTO\n\n"; # Print the body print S "$THEMESSAGE\n"; print S "\n"; print S ".\n"; close (S); } ############################################## # Sub: Einholen der Formulardaten # sub get_form_data { $buffer = ""; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs=split(/&/,$buffer); foreach $pair (@pairs) { @a = split(/=/,$pair); $name=$a[0]; $value=$a[1]; $value =~ s/\+/ /g; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/~!/ ~!/g; $value =~ s/[\n\r]/ /sg; #remove \n $value =~ s/\[\]//g; #remove [] push (@data,$name); push (@data, $value); } %form=@data; %form; } ############################################## # Sub: Einträge schliessen # sub viewclosed { print <<"EOF"; EOF print "
"; print "
Closed Auctions
"; print <<"EOF";
This form will allow you to view the status and contact information for closed auction items you bid on or listed for auction.
Your Username:
Required for verification
Your Password:
Required for verification
EOF } ############################################## # Sub: Einträge schliessen1 # Zeigt geschlossene Einträge an sub viewclosed1 { $form{'ALIAS'} =~ s/\W//g; $form{'ALIAS'} = lc($form{'ALIAS'}); $form{'ALIAS'} = ucfirst($form{'ALIAS'}); &oops('ALIAS') unless (open(REGFILE, "$basepath$regdir/$form{'ALIAS'}.dat")); ($password,$email,$add1,$add2,$add3,@junk) = ; chomp($password,$email,$add1,$add2,$add3,@junk); close REGFILE; &oops('PASSWORD') unless ((lc $password) eq (lc $form{'PASSWORD'})); print "\n"; print "
\n"; } ############################################## # Sub: Einträge schliessen 2 # Zeigt ebenfalls geschlossene Einträge an. sub viewclosed2 { $form{'bidtoview'} =~ s/\W//g; open (THEFILE, "$basepath$closedir/$form{'bidtoview'}.dat") or &oops('ITEM'); ($title, $reserve, $inc, $desc, $image, @bids) = ; close THEFILE; chomp($title, $reserve, $inc, $desc, $image, @bids); @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); print "
"; print "
$title
\n"; print "

"; print "
"; print "
Description
"; print "$desc"; print "
"; print "
Bid History
"; print "START: "; foreach $bid (@bids) { @thebid = split(/\[\]/,$bid); $bidtime = localtime($thebid[3]); print "$thebid[0] \($bidtime\) - US\$ $thebid[2]
\n"; } print "

Reserve was: US\$ $reserve
\n"; print "

"; print "
Contact Information
"; if ($form{'ALIAS'} eq $firstbid[0]) { print "You were the seller...

\n"; print "Buyer-Informationen:
Alias: $lastbid[0]
E-Mail: $lastbid[1]
Address: $lastbid[4]
$lastbid[5]
$lastbid[6]

High Bid: US\$ $lastbid[2]\n"; print "

Bid History:
\n"; foreach $bid (@bids) { @thebid = split(/\[\]/,$bid); print "$thebid[0] - $thebid[1]
\n"; } print "

You may repost this item if you want to:
\n"; } elsif ($form{'ALIAS'} eq $lastbid[0]) { print "You were a high bidder...

\n"; print "Seller-Information:
Alias: $firstbid[0]
E-Mail: $firstbid[1]
Address: $firstbid[4]
$firstbid[5]
$firstbid[6]

Your High Bid: US\$ $lastbid[2]

\n"; print "Remember, the seller is not required to sell unless your bid price was above the reserve price.."; } else { print "You were not a winner... No further contact information is available.\n"; } } ############################################## # Sub: File Lock # sub filelock { flock (NEWITEM, 2); seek(NEWITEM, 0, 2); } ############################################# # Add-on Sub Print form to request password # This is the form to send out the password sub password { print <<"EOF";

EOF print "
"; print "
Lost Your Password
"; #

Forgot your password?

print <<"EOF";
This form is to be used ONLY if you have already registered and have lost your password.
Your password will be e-mailed to the e-mail address we have on file.
YOUR IP address:
Recorded for security reasons
$ENV{'REMOTE_HOST'}
Your User Name:
Required for verification
EOF } ########################################## # Add-on Sub Process and send out password # Verify Alias and send out the password sub password2 { $form{'ALIAS'} =~ s/\W//g; $form{'ALIAS'} = lc($form{'ALIAS'}); $form{'ALIAS'} = ucfirst($form{'ALIAS'}); &oops('ALIAS') unless (open(REGFILE, "$basepath$regdir/$form{'ALIAS'}.dat")); ($password,$email,$add1,$add2,$add3,@junk) = ; chomp($password,$email,$add1,$add2,$add3,@junk); close REGFILE; &sendemail($email, "Auction Password Request", $mailfrom, $mailserver, "Our system received a request for your password from IP address $form{'IP'} due to it being lost.\n\nYour password is: $password"); print "$form{'ALIAS'}... your password has been sent."; } #------------------------------------------------------# # Add-On Sub: Mail Auction To A Friend # This sub gets the form input info for mailing the auction #------------------------------------------------------# sub mailto { open THEFILE, "$basepath$ARGV[1]/$ARGV[2].dat"; ($title, $reserve, $inc, $desc, $image, @bids) = ; close THEFILE; chomp($title, $reserve, $inc, $desc, $image, @bids); @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); print <<"EOF";
Mail This Auction To A Friend
$title
Item #$ARGV[2]
Your User Name:
Must be valid.
Your Password:
Must be valid.
Email Auction To:
Email address you wish to send the auction to. Will not be verified!!

Registration is required for this procedure!
Optional Message:
Optional personal message added to the default message sent!
EOF } #------------------------------------------------------# #------------------------------------------------------# # Add-On Sub: Mail Auction To A Friend # This sub checks user name and sends the mail #------------------------------------------------------# sub mailtosend { $form{'ALIAS'} =~ s/\W//g; $form{'ALIAS'} = lc($form{'ALIAS'}); $form{'ALIAS'} = ucfirst($form{'ALIAS'}); &oops('not a registered user') unless (open(REGFILE, "$basepath$regdir/$form{'ALIAS'}.dat")); ($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids) = ; close REGFILE; chomp($password, $form{'EMAIL'}, $form{'ADDRESS1'}, $form{'ADDRESS2'}, $form{'ADDRESS3'}, @userbids); &oops('incorrect password') unless ((lc $password) eq (lc $form{'PASSWORD'})); $mailto1 = " Hello, A user at $sitename, $form{'ALIAS'}, has forwarded this auction to you: $form{'MESSAGE'} The item information posted is as follows : Item number : $form{'ITEM'} Item Title : $form{'TITLE'} Current Bid : US\$$form{'BID'} URL Here : http://$scripturl$ENV{'SCRIPT_NAME'}\?$form{'CATEGORY'}\&$form{'ITEM'} Description : $form{'DESC'} Thank you and please tell a friend about us! Sincerely, $sitename "; &sendemail($form{'EMAILADD'},'FWD Auction #' . $form{'ITEM'}, 'nobody', $mailserver, $mailto1); print <<"EOF";
Auction# $form{'ITEM'} was sent to $form{'EMAILADD'}.
Click here to return to the auction.
EOF } ############################################## # Sub: Show all items # This allows a user to see all items in auction sub allcategory { print "
"; print "
All Auctions
"; print "\n"; print "\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]++; $camera="(none)"; # $camera = "" if (/gemaelde_boerse_cgi/image/index.jpg); $camera = "" if (/gemaelde_boerse_cgi/image/index.jpg); print "\n"; } } } print "
ItemPictureClosesBidsHigh Bid
$category{$key}\: $title$camera$closetime[4]/$closetime[3]$#bidsUS\$ $lastbid[2]
\n"; } ############################################## # Sub: Show all items without Pictures # This allows a user to see all items in auction sub allcategorynp { print "
"; print "
All Auctions
"; print "\n"; print "\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]++; $camera="(none)"; $camera = "(Picture)" if (/gemaelde_boerse_cgi/image/index.jpg); # $camera = "" if (/gemaelde_boerse_cgi/image/index.jpg); print "\n"; } } } print "
ItemClosesBidsHigh Bid
$category{$key}\: $title $camera$closetime[4]/$closetime[3]$#bidsUS\$ $lastbid[2]
\n"; } #------------------------------------------------------# # 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 "\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 "\n"; } } } print "
ItemClosesNum BidsHigh Bid
$category{$key}\: $title$closetime[4]/$closetime[3]$#bids\$$lastbid[2]
\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 "\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 "\n"; } } } print "
ItemClosesNum BidsHigh Bid
$category{$key}\: $title$closetime[4]/$closetime[3]$#bids\$$lastbid[2]
\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 "\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 "\n"; } } print "
User NameReal NameEMailCity ST ZIPPassword
$newname$add1$email$add3$password
\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 "\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 "\n"; } } print "
User NameReal NameEMailCity ST ZIPPassword
$newname$add1$email$add3$password
\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 ""; print "

ADMIN: EDIT User

"; print ""; print ""; print ""; print "
This form will allow you to change a users street address and/or password.
"; print "
User Name:
Required for verification
"; print "
Current Password:
Required for verification
"; print "
New Password:
Leave blank if unchanged
"; print "
New Password Again:
Leave blank if unchanged
"; print "
Contact Information:
Leave blank if unchanged
"; print "Full Name:
......$add1
"; print "Street Address:
......$add2
"; print "City, State, ZIP:
......$add3
"; print "
"; } } #------------------------------------------------------# # Add-on Sub: Administration Utility # Bad Password Sub #------------------------------------------------------# sub badpassword { print "

Incorrect Password!!

"; } #------------------------------------------------------# # Add-on Sub: Edit Item # This edits an auction item #------------------------------------------------------# sub editem { if ($ARGV[3] eq $adminpass) { open THEFILE, "$basepath$ARGV[0]/$ARGV[1].dat"; ($title, $reserve, $inc, $desc, $image, @bids) = ; $title =~ s/\"//g; # quotes cause problems for a text input field close THEFILE; chomp($title, $reserve, $inc, $desc, $image, @bids); @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); print <<"EOF";
Edit An Item
Title/Item Name:
No HTML
Category:
Select One
Image URL:
Optional, should be no larger than 200x200
Description:
May include HTML - This should include the condition of the item, payment and shipping information, and any other information the buyer should know.
Please note that by placing an item up for bid you are making a contract between you and the buyer. Once you place an item, you may not retract it and you must sell it for the highest bid. In other words, if you don't want to sell it, don't place it up for bid!
Offered By:$firstbid[0]
Current High Bid:\$
Auction Reserve Price:
You are not obligated to sell below this price. Leave blank if none.
\$
Bid Increment:\$
EOF } else { print "Incorrect Administration Password!\n"; } } #------------------------------------------------------# # Add-on Sub: Process Modified Auction # This modifies an auction #------------------------------------------------------# sub changeitem { &opps('NEWCAT') unless ($form{NEWCAT}); &oops('TITLE') unless ($form{'TITLE'} && (length($form{'TITLE'}) < 51)); $form{'TITLE'} =~ s/\/\>\;/g; &oops('ITEM') unless ($form{'ITEM'}); $form{'ITEM'} =~ s/\W//g; &oops('TITLE') unless ($form{'TITLE'}); &oops('RESERVE') unless ($form{'RESERVE'}); &oops('DESC') unless ($form{'DESC'}); &oops('BID') unless ($form{'BID'} =~ /^(\d+\.?\d*|\.\d+)$/); &oops('INC') unless (($form{'INC'} =~ /^(\d+\.?\d*|\.\d+)$/) && ($form{'INC'} >= .01)); &oops('ITEM') unless (open(THEFILE, "$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat")); ($title, $reserve, $inc, $desc, $image, @bids) = ; close THEFILE; chomp($title, $reserve, $inc, $desc, $image, @bids); @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); $form{'TITLE'} = $title if !($form{'TITLE'}); $form{'RESERVE'} = $reserve if !($form{'RESERVE'}); $form{'INC'} = $inc if !($form{'INC'}); $form{'DESC'} = $desc if !($form{'DESC'}); $form{'IMAGE'} = $image if !($form{'IMAGE'}); $form{'BID'} = $bid if !($form{'BID'}); &oops('ITEM') unless (open NEWITEM, ">$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat"); print NEWITEM "$form{'TITLE'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'DESC'}\n$form{'IMAGE'}\n"; if ($#bids eq 0) { print NEWITEM "$firstbid[0]\[\]$firstbid[1]\[\]$form{'BID'}\[\]$firstbid[3]\[\]$firstbid[4]\[\]$firstbid[5]\[\]$firstbid[6]"; $message = "This item had no bidding history all items were updated!"; } else { foreach $bad (@bids) { @thebid = split(/\[\]/,$bad); $bidtime = localtime($thebid[3]); print NEWITEM "$thebid[0]\[\]$thebid[1]\[\]$thebid[2]\[\]$thebid[3]\[\]$thebid[4]\[\]$thebid[5]\[\]$thebid[6]\n"; $message = "This item has a bidding history that was not changed!"; } } close NEWITEM; if ($form{CATEGORY} ne $form{NEWCAT}) { &movefile("$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat", "$basepath$form{'NEWCAT'}/$form{'ITEM'}.dat"); } print "
\n"; print "$form{'TITLE'} has been successfully changed.
\n"; print $message; print "
\n"; } #------------------------------------------------------# # End Admin Add-On #------------------------------------------------------# 1; ############################################## # Sub: Automate Close Auctions 1.1 # This allows admin to close all items that # have passed their closing time, w/o having # to go to each item seperately sub autoclose { 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 (time > $file) { if (-T "$basepath$key/$file") { open THEFILE, "$basepath$key/$file"; ($title, $reserve, $inc, $desc, $image, @bids) = ; chomp($title, $reserve, $inc, $desc, $image, @bids); @firstbid = split(/\[\]/,$bids[0]); @lastbid = split(/\[\]/,$bids[$#bids]); $nowtime = localtime(time); $closetime = localtime($file); foreach $bid (@bids) { @thebid = split(/\[\]/,$bid); $bidtime = localtime($thebid[3]); } close THEFILE; if ($key ne $closedir) { if ($closedir) { umask(000); # UNIX file permission junk mkdir("$basepath$closedir", 0777) unless (-d "$basepath$closedir"); print "Please notify the site admin that this item cannot be copied to the closed directory even though it is closed.\n" unless &movefile("$basepath$key/$file", "$basepath$closedir/$key$file"); # print "

$category{$key}\: $title closed


"; $numauct = $file; $numauct =~ s/\.dat//; #makes it just the number, rather than number.dat } else { print "Please notify the site admin that this item cannot be removed even though it is closed.\n" unless unlink("$basepath$key/$file"); } if ($lastbid[2] >= $reserve) { &sendemail($lastbid[1], "Auction Winner: $title", "Seller <$firstbid[1]>", $mailserver, "Congratulations! You are the winner of auction number $numauct.\nYour winning bid was \$$lastbid[2].\n\nPlease contact the seller to make arrangements for payment and shipping:\n\n$firstbid[4]\n$firstbid[5]\n$firstbid[6]\n$firstbid[1]\n\nThanks for using EveryAuction!"); $reservemsg = " "; } else { if ($firstbid[2] ne $lastbid[2]) { &sendemail($lastbid[1], "Auction Close: $title", "Seller <$firstbid[1]>", $mailserver, "Congratulations! You were the high bidder on auction number $numauct.\nYour bid was \$$lastbid[2].\n\nUnfortunately, your bid did not meet the seller\'s reserve price...\n\nYou may still wish to contact the seller to negotiate a fair price:\n\n$firstbid[4]\n$firstbid[5]\n$firstbid[6]\n$firstbid[1]\n\nThanks for using EveryAuction!"); $reservemsg = "YOUR RESERVE PRICE WAS NOT MET! Feel free to repost your auction by following this link: http://$scripturl$ENV{'SCRIPT_NAME'}\?1\&1\&v"; } else { $reservemsg = "Sorry, no bids were placed on your auction. Feel free to repost your auction by following this link: http://$scripturl$ENV{'SCRIPT_NAME'}\?1\&1\&v"; } } &sendemail($firstbid[1], "Auction Close: $title", "Winner <$lastbid[1]>", $mailserver, "Auction Number $numauct Is Now Closed.\nThe high bid was \$$lastbid[2] (Your reserve was: \$$reserve).\n\n$reservemsg\n\nPlease contact the high bidder to make any necessary arrangements:\n\n$lastbid[4]\n$lastbid[5]\n$lastbid[6]\n$lastbid[1]\n\nThanks for using EveryAuction!"); } } } } } }