home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet 1996 World Exposition
/
park.org.s3.amazonaws.com.7z
/
park.org.s3.amazonaws.com
/
cgi-bin
/
Japan
/
Theme
/
list.cgi.sav
< prev
next >
Wrap
Text File
|
2017-09-21
|
6KB
|
265 lines
#!/usr/local/bin/perl
$| = 1;
# script for life section of the Theme Kan
# jrh
$CgiPath = '/stage/htdocs/cgi-bin/Japan/Theme';
push(@INC, "$CgiPath");
require 'jcode.pl'; # tends to be in /usr/local/lib/perl
require 'read-form.pl'; # tends to be in your cgi path
require 'meetinit.pl';
$ThisFile = '/stage/htdocs/cgi-bin/Japan/Theme/entry.cgi';
# print "Content-type: text/html\n\n";
$UserName = '';
&read_in_data;
&init_dbm;
&get_cookie;
if ($UserName ne '') {
&check_users;
&print_frames;
}
else {
&Checkin;
}
&close_dbm;
#########################################################################
sub read_in_data {
# read in submitted form data contents into the hash %FormDataHash
&ReadInFormData(\%FormDataHash);
foreach $Key (keys(%FormDataHash)) {
# print "//$Key:$FormDataHash{$Key}//\n";
}
$SecName = $FormDataHash{'section'};
$TypeName = $FormDataHash{'sectype'};
$LangName = $FormDataHash{'language'};
# print "$FormDataHash{'gif'}\n";
# print "$SecName\n";
# print "$TypeName\n";
}
sub init_dbm {
$ListLastPath = "$ThemeDBMPath/$SecName/$TypeName/$ListLast";
$ListUsersPath = "$ThemeDBMPath/$SecName/$TypeName/$ListUsers";
dbmopen(%LastAccessToPage,$ListLastPath,0666);
dbmopen(%UserAccessToPage,$ListUsersPath,0666);
# $Count = 1;
# while ($Count < $PeopleNo) {
# $UserAccessToPage{$Count} = "none";
# $LastAccessToPage{$Count} = 0;
# $Count++;
# }
}
sub get_cookie {
$CookieEnv = $ENV{'HTTP_COOKIE'};
@Cookies = split(/\;/,$CookieEnv);
# print "Cookies! : $CookieEnv\n da";
foreach $Cookie (@Cookies) {
print "Cookie : $Cookie\n";
@CurrentCookie = split(/=/,$Cookie);
$CurrentCookie[0] =~ s/ //;
# print "Cookie0 : A$CurrentCookie[0]B\n\n";
# print "Cookie1 : $CurrentCookie[1]\n\n";
if ($CurrentCookie[0] eq 'NAME') {
$UserName = $CurrentCookie[1];
# print "Cookieif : $UserName";
}
if ($CurrentCookie[0] eq 'LOCATION') {
$Location = $CurrentCookie[1];
}
$UserName = "$UserName\@$Location";
$UserName =~ s/@@/@/;
}
}
sub check_users {
$Accessing = 0;
$ExpireTime = time - 33;
$Last = $LastAccessToPage{'1'};
$LastKey = 1;
$TrueNum = 1;
$Count = 1;
$WhileNo = $PeopleNo + 1;
while ($Count < $WhileNo) {
# print "$UserAccessToPage{$Count} : $Count\n";
if ($UserName eq $UserAccessToPage{$Count}) {
$Accessing = 1;
$LastAccessToPage{$Count} = time;
}
$Count++;
}
$Count = 1;
if ($Accessing ne $TrueNum) {
while ($Count < $WhileNo) {
$ThisLast = $LastAccessToPage{$Count};
if ($ThisLast < $Last) {
$Last = $ThisLast;
$LastKey = $Count;
}
$Count++;
}
$UserAccessToPage{$LastKey} = $UserName;
# print "Replace\n\n";
$LastAccessToPage{$LastKey} = time;
$ColorName{$UserName} = $Colors{$LastKey};
}
$Count = 1;
while ($Count < $WhileNo) {
if ($LastAccessToPage{$Count} > 0) {
if ($LastAccessToPage{$Count} < $ExpireTime) {
# print "$LastAccessToPage{$Count} : $ExpireTime : Clean\n\n";
$CleanKey = $Count;
$UserAccessToPage{$Count} = "none";
$LastAccessToPage{$Count} = 0;
}
}
$Count++;
}
}
sub print_frames {
select(STDOUT);
# tell the server that we're sending data back now
print "Content-type: text/html\n\n";
# now send the server some html stuff
print "<HTML>\n\n";
print "<HEAD>\n\n";
print "<TITLE>Entrance Room</TITLE>\n";
print "</HEAD>\n\n";
print "<META HTTP-EQUIV=REFRESH CONTENT=\"15; URL=list.cgi?section=$SecName§ype=$TypeName&language=$LangName\">";
if ($SecName eq 'linked') {
print "<BODY>\n\n";
}
else {
print "<BODY>\n\n";
# print "<BODY BGCOLOR=\"#ffffff\">\n\n";
}
if ($LangName eq 'japanese') {
$LangSec = "japanese/$SecName";
}
else { # case of 'english'
$LangSec = $SecName;
}
if ($TypeName eq 'park') {
print "<center>
<a href=\"$ThemeURL/$LangSec/index.html\" target=\"_top\">
<img src=\"$ThemeURL/image/back.gif\" border=0><br>";
if ($SecName eq 'linked') {
print "<font size=\"2\">Linked Senses</font></a><BR>";
}
elsif ($SecName eq 'sjapan') {
print "<font size=\"2\">Sensing Japan</font></a><BR>";
}
elsif ($SecName eq 'sware') {
print "<font size=\"2\">Senseware</font></a><BR>";
}
elsif ($SecName eq 'sense') {
print "<font size=\"2\">\"Sense\"</font></a><BR>";
}
elsif ($SecName eq 'library') {
print "<font size=\"2\">Library</font></a><BR>";
}
elsif ($SecName eq 'press') {
print "<font size=\"2\">Media Watch</font></a><BR>";
}
print "<a href=\"$ThemeURL/$LangSec/park/index.html\" target=\"_top\"><font size=\"2\">Waiting Room</font></A><P>";
print "</center>";
}
else {
print "<center>
<a href=\"$ThemeSite$ThemeURL/$LangSec/park/index.html\" target=\"_top\">
<img src=\"$ThemeURL/image/bench.gif\" border=0><br>
<font size=\"2\">Pocket Park</font></a><p>
</center>";
}
foreach $Key (sort(keys(%UserAccessToPage))) {
if ($UserAccessToPage{$Key} ne 'none') {
$UserName = $UserAccessToPage{$Key};
$UserName =~ s#\@#<img src=\"$ThemeURL/image/people.gif\">#;
print "$UserName\n\n";
print "<BR>\n\n";
}
}
print "<P></P>";
print "</BODY>\n\n";
print "</HTML>\n\n";
}
sub Checkin {
select(STDOUT);
# tell the server that we're sending data back now
print "Content-type: text/html\n\n";
# now send the server some html stuff
print "<HTML>\n\n";
print "<HEAD>\n\n";
print "<TITLE>Entrance Room</TITLE>\n";
print "</HEAD>\n\n";
print "<BODY BGCOLOR=\"#ffffff\">\n\n";
print "<CENTER><A HREF=\"$ThemeCgi/checklist.cgi\"><IMG SRC=\"$ThemeURL/image/checkin.gif\" BORDER=0></A></CENTER>";
print "</BODY>\n\n";
print "</HTML>\n\n";
}
sub close_dbm {
dbmclose(%LastAccessToPage);
dbmclose(%UserAccessToPage);
}