#!e:/perl/bin/perl.exe # ########################################################## # Cookies Script...My Anthro TECH # Written by Widgetz, Jerry, LINKS User ########################################################## ########################################################## # REQUIRED LIBRARIES # ########################################################## require "f:/www/wn/docs/cgi-bin/admin/links.cfg"; require "$db_lib_path/db_utils.pl"; require "$db_lib_path/links.def"; #$build_use_templates ? require "f:/www/wn/docs/cgi-bin/admin/site_html_templates.pl" ; #require "f:/www/wn/docs/cgi-bin/admin/site_html.pl"; require "f:/www/wn/docs/cgi-bin/cookie.lib"; ########################################################## # CONFIGURATION SECTION # ########################################################## # Body Configurations $body = 'body bgcolor="ffffff"'; # Font Size and Style $font = 'font face="Verdana" size="2"'; #Insert File Paths $insert_file = "f:/www/wn/docs/"; #Header File $head_file = "header.txt"; #Footer File $foot_file = "footer.txt"; ########################################################## # BEGIN SCRIPT # ########################################################## @referers = ('.whiskynet.de','www.whiskynet.de'); &check_url; &GetCookies('cookie'); print "Content-type: text/html\n\n"; print qq|WhiskyNet - Meine Bookmarks|; print qq||; print &header_file; foreach (split(/,/, $Cookies{'cookie'})) { print &site_html_cookie_link(&get_record($_)); } print &footer_file; sub header_file { # --------------------------------------------- # Displays header file. open (INC, "$insert_file/$head_file") or return "Can't find include file: $head_file{$_}"; return join ("", ); } sub footer_file { # --------------------------------------------- # Displays the footer file. open (INC, "$insert_file/$foot_file") or return "Can't find include file: $foot_file{$_}"; return join ("", ); } sub check_url { #-------------------------------------------------------------------- # Localize the check_referer flag which determines if user is valid. local($check_referer) = 0; # If a referring URL was specified, for each valid referer, make sure # that a valid referring URL was passed to FormMail. if ($ENV{'HTTP_REFERER'}) { foreach $referer (@referers) { if ($ENV{'HTTP_REFERER'} =~ m|https?://([^/]*)$referer|i) { $check_referer = 1; last; } } } else { $check_referer = 1; } # If the HTTP_REFERER was invalid, send back an error. # if ($check_referer != 1) { &cgi_error; } } sub cgi_error { #--------------------------------------------------------- # Displays Error Message for Add, Delete, and Modify Forms print "$html_title: Bad Domain Referrer"; print ""; print header_file; print "
"; print ""; print "
<$font_title>$html_title: Bad Domain Referrer"; print "

<$font>This script cannot run from the following location:"; print "

$ENV{'HTTP_REFERER'}
"; print "
"; print footer_file; print ""; }