You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.5 KiB

#!/usr/bin/perl
#
# $Id: downloads.pl,v 1.3 2006/01/23 21:39:30 ddoughty Exp $
#
# Source File: downloads.pl
# Get config
require 'sitecfg.pl';
require 'testlib.pl';
&app_initialize;
print "Content-Type: text/html\n\n";
if (&get_session($FORM{'tid'})) {
&LanguageSupportInit();
&log_entry($SESSION{'clid'}, $SESSION{'uid'}, "4", "Promo Downloads");
print "<HTML>\n";
print "<BODY>\n";
if ($SESSION{'uac'} ne 'gadmin') {
print "<CENTER>\n";
print "You do not have privileges to make Database Structure Changes.\n";
print "</CENTER>\n";
} else {
@dlrecs = &get_data("downloads.dat");
$bFirst=1;
$downloads = "<UL>Materials Available for Download:\n";
if ($#dlrecs eq 0) {
$download = "<LI>No downloads are currently available.\n";
} else {
foreach $dlrec (@dlrecs) {
$msg = "";
if ($bFirst) {
$bFirst = 0;
} else {
chop ($dlrec);
@flds = split(/&/, $dlrec);
$dlfile = join($pathsep, $pubroot, "downloads/$flds[2]");
open (TMPFILE, "<$dlfile") or $msg="nya";
if ($msg eq 'nya') {
$download = "<LI>$flds[1] (Coming Soon)\n";
} else {
binmode(TMPFILE);
$fsize = (stat(TMPFILE))[7];
close TMPFILE;
$download = "<LI><A HREF=\"\.\./downloads/$flds[2]\">$flds[1] ($fsize bytes)</A>\n";
}
$downloads = join('', $downloads , $download);
}
}
}
$downloads = join('', $downloads , "</UL>\n");
$SYSTEM{'downloads'} = $downloads;
@dlrecs = ();
$downloads = "";
$download = "";
&show_template("download");
}
print "</BODY>\n";
print "</HTML>\n";
}