#!/usr/sbin/perl #************************************************************************** #* * #* Copyright (c) 1996 Silicon Graphics, Inc. * #* All Rights Reserved * #* * #* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI * #* * #* The copyright notice above does not evidence any actual of intended * #* publication of such source code, and is an unpublished work by Silicon * #* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is * #* the property of Silicon Graphics, Inc. Any use, duplication or * #* disclosure not specifically authorized by Silicon Graphics is strictly * #* prohibited. * #* * #* RESTRICTED RIGHTS LEGEND: * #* * #* Use, duplication or disclosure by the Government is subject to * #* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in * #* Technical Data and Computer Software clause at DFARS 52.227-7013, * #* and/or in similar or successor clauses in the FAR, DOD or NASA FAR * #* Supplement. Unpublished - rights reserved under the Copyright Laws of * #* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. * #* Shoreline Blvd., Mountain View, CA 94039-7311 * #************************************************************************** # DEMO_init.pl # # Routines to initialize the demos interface 1; # Return true; sub Initialize_Interface { if (&Legal_User) { $ENV{'DISPLAY'} = "$APP_DISPLAY"; # Set the display $ENV{'DISPLAY'} = $in{'XDP'} if ($in{'XDP'}); &Read_Tables; } else { &Print_Illegal_User_Warning; # Exit } } sub Read_Tables { @demo_list = &Generate_Demos_Array; @hardware_categories = &Generate_Hardware_Array; @features_categories = &Generate_Features_Array; @markets_categories = &Generate_Markets_Array; } sub Legal_User { # Get the name of host machine and ip address of this machine $host_name = `/usr/bsd/hostname -s`; chop($host_name); ($NotUsedName, $NotUsedAliases, $NotUsedAddrtype, $NotUsedLength, @Addrs) = gethostbyname($host_name); ($ip1,$ip2,$ip3,$ip4) = unpack('C4',@Addrs[0]); $ipAddress = "$ip1.$ip2.$ip3.$ip4"; # Check to see if the server name is the same return(( "$ENV{'REMOTE_ADDR'}" eq "$WWW_SERVER_IP" || "$ENV{'REMOTE_ADDR'}" eq "$ipAddress" )); } sub Print_DisplayAndLink_Script { print <<_KAWASAKI_KX250_; \n"; print "\n"; print "\n"; print "\t\n"; print "\t\n"; print "\t\t\n"; print "\t\t\n"; print "\t\t\n"; print "\t\n"; print "\n"; print "\n"; &Print_HTTP_Footer; } sub Print_Illegal_User_Warning { &Print_HTTP_Header("Sorry! Foreign Host Access Not Allowed", $HTTP_YES_SCRIPT); print "\n"; print "\n"; print "\n"; &Print_HTTP_Footer; exit 0; }