#!/usr/bin/perl use strict; use DBI; use lib qw ( ../lib ); use Kyngdoms; ################################################# # # Admin Center # By Keith Robinson # The Kyngdoms # # Version: 0.001Beta # Last Modified 22 October 2005 # Copyright (c) The Kyngdoms 2005 # # http://www.thekyngdoms.com # email: keith@thekyngdoms.com # ################################################# ################################################################################ #Configuration of the script ################################################################################ my %vals = db_data; # Where is all comment data kept my $download_data = "../lib/dlmonitor"; # The url location of admin.pl my $admin_cgi = "http://www.thekyngdoms.com/cgi-bin/admin.pl"; #The username you plan to use when administirring the script my $username = "$vals{user}"; #The password you plan to use when administirring the script my $password = "$vals{password}"; #The location of the style sheets from the web domain root my $css = "/monkey/admin.css"; #The location of your company logo my $logo = "/images/thekyngdomslogo2b.gif"; #The url you want to point your company logo to my $logolink = "/index.shtml"; #The location of your top of page banner my $bannerimage = "/images/kyngdomsheaderrpgnow.gif"; ################################################################################ # Main script - Don't change anything below this line ################################################################################ #################################### # temp globals #################################### # this should be set in the admin center and grabbed from the db my $admin_title = "The Kyngdoms"; my ($line, $filename, $no_downloads, $tmp, $dfile, $stat1found); ##################################### ## ## get login page and evaluate login ## my $temp; my $lastaction; if ($ENV{'QUERY_STRING'} ne "") { $temp = $ENV{'QUERY_STRING'}; } else { read(STDIN, $temp, $ENV{'CONTENT_LENGTH'}); } my @pairs=split(/&/,$temp); my ($key, $content); my %fields; foreach my $item(@pairs) { ($key,$content)=split (/=/,$item,2); $content=~tr/+/ /; $content=~ s/%(..)/pack("c",hex($1))/ge; $fields{$key}=$content; } $fields{'comment'}=~s/\cM//g; $fields{'comment'}=~s/\n\n/
/g;
$fields{'comment'}=~s/\n/
/g;
if (substr($fields{'pass'}, 0, 2) eq "_-"){$password = "_-" . crypt ($password, "comments");}
if ($fields{'usern'} eq "") {&passwordpage;}
if ($fields{'pass'} eq "") {&passwordpage;}
if ($fields{'usern'} ne $username) {&wrongpass;}
if ($fields{'pass'} ne $password) {&wrongpass;}
if ($fields{'usern'} eq "") {&passwordpage;}
if ($fields{'usern'} eq $username)
{
if ($fields{'pass'} eq $password)
{
if ($fields{'fct'} eq "") {&start;}
if ($fields{'fct'} eq "addnewrelease") {&addnewrelease;}
if ($fields{'fct'} eq "modifyreldb") {&modifyreldb;}
if ($fields{'fct'} eq "updatentry") {&updatentry;}
if ($fields{'fct'} eq "viewprodrecord") {&viewprodrecord;}
if ($fields{'fct'} eq "view_stats") {&view_stats;}
if ($fields{'fct'} eq "reset_i") {&reset_i;}
if ($fields{'fct'} eq "reset") {&reset_all;}
if ($fields{'fct'} eq "modifyprodrec") {&modifyprodrec;}
if ($fields{'fct'} eq "updateprodrec") {&updateprodrec;}
if ($fields{'fct'} eq "newprodrecord") {&newprodrecord;}
if ($fields{'fct'} eq "addnewprodrec") {&addnewprodrec;}
if ($fields{'fct'} eq "deleteprodrec") {&deleteprodrec;}
}
}
exit;
###########################################################
##
## generate the log in page
##
sub start {
print "Content-type: text/html\n\n";
if ($fields{'login'} eq "login") { $password = "_-" . crypt ($password, "comments"); }
&print_top;
print "
| $lastaction | \n"; print "
| Product Options | ||||||||||
| Product Data | Hits | Select | ||||||||
| ID | Name | Price | SKU | Status | lulu | dtrpg | enworld | rpgnow | Total Hits | |
| $kyngprod_id | $kyngprod_name | \$$kyngprod_price | $kyngprod_sku | $kyngprod_status | $kyngprod_lulu_hits | $kyngprod_dtrpg_hits | $kyngprod_enworld_hits | $kyngprod_rpgnow_hits | $totalrpgnowdtrgluluhits | |