#! /srvtools/http/bin/perl
#############################################################################
#
#   Copyright 1995 by the Northeast Parallel Architectures Center at 
#   Syracuse University and Global Business Network, Inc.
#  
#   File:          Address.pl
#
#   Author:        Paul Coddington (paulc@npac.syr.edu)
#
#   Created:       11/02/95
#
#   Input:         VOID
#   Output:        HTML text
#          
#   Description:   Adds address information for WeBBoard.
#
#############################################################################

require "npac-lib";		# Some useful routines
require "CheckPasswd.pl"; 

sub Address {
   local($subdir) = @_;
   local($admin, $address);
   local($thischeckfile, $dir1, $dir2, $dir);

   $admin = &GetAddress($subdir, "administrator");

   # See if there is a passwd file at this level.
   if ($subdir) {
      $thischeckfile = "$webboardhome/$subdir/$checkfile";
   }
   else {
      $thischeckfile = "$webboardhome/$checkfile";
   }
   # If not, list the forums at a higher level.
   if (-e $thischeckfile) {
     $dir = $subdir;
   }
   else {
	($dir1, $dir2) = split(/\//, $subdir);
      $dir = $dir1;
   }

   # $_ = &GetFile("HTML/Address.html", $webboardhome);
   # s/"\$admin"/$admin/;
   # s/"\$version"/$version/;
   
   $message = &GetFile("HTML/Address.html", $webboardhome);

   # Put in the right parameters for the address information and the
   # navigation bar.
   $message =~ s/\$admin/$admin/g;
   $message =~ s/\$homepage/$homepage/g;
   $message =~ s/\$userguide/$userguide/g;
   $message =~ s/\$intro/$intro/g;
   $message =~ s/\$help/$help/g;
   $message =~ s/\$search/$search/g;
   $message =~ s/\$request/$request/g;
   $message =~ s/\$version/$version/g;
   $message =~ s/\$subdir/$dir/g;
   $message =~ s/\$action/$action/g;
   $message =~ s/\$webteam/$webteam/g;
   $message =~ s/\$test/$test/g;
   $message =~ s/\$gif/$gif/g;
   if ($user) {
      $message =~ s/\$user/$user/g;
   }
   else {
      $message =~ s/\$user/guest/g;
   }
   print "$message";
}
1;

