#!/usr/bin/perl
use CGI::Carp "fatalsToBrowser"; # Output errors to browser
use CGI qw(:standard); # Saves loads of work
$CGI::POST_MAX=1024 * 150; # limit post data
$CGI::DISABLE_UPLOADS = 1; # Disable uploads
$CGI::HEADERS_ONCE = 1; # Kill redundant headers
eval {
($0 =~ m,(.*)/[^/]+,) and unshift (@INC, "$1");
($0 =~ m,(.*)\\[^\\]+,) and unshift (@INC, "$1");
require "ikon.lib"; # Require ikonboard ()
require "data/progs.cgi"; # Require prog names
require "data/boardinfo.cgi";# Require board info
require "data/styles.cgi"; # Require styles info
};
if ($@) {
print header(); print start_html(-title=>"Ikonboard Error!");
print "Could not find these files: $@\nIf you are running NT you may need to enter the full path in each require statement in each script";
print end_html; exit;
}
$|++; # Unbuffer the output
#################--- Begin the program ---###################
$thisprog = "welcome.cgi";
$query = new CGI;
$action = $query -> param('action');
$inmembername = cookie("loggedname");
#For the cookie fix
&getmember("$inmembername");
if ($userregistered eq "no"){
$inmembername = "guest";
}
if ($inmembername eq "") {
$inmembername = "guest";
}
print "Content-type: text/html\n\n";
if ($action eq "logreg") {
if ($inmembername eq "guest") {
print qq~log-in | register~;
}
else {
print "";
}
}
else {
substr($inmembername, 0, 1) =~ tr/a-z/A-Z/; #to uppercase the first letter
print "$inmembername";
}
exit;