#!/usr/bin/perl my $cwd="."; use lib "."; ################################################################ # TITLE: Jump # # VERSION: 1.0 # # CREATED ON: April 20, 2002 # # LAST UPDATED: April 20, 2002 # # E-MAIL: support@cgibiz.com # # WEB SITE: http://www.cgibiz.com/ # ################################################################ # (C) 2002 ARVYDAS STRAUSAS. ALL RIGHTS RESERVED. # ################################################################ # Copyright Notice # # ---------------- # # This script can be freely used, distributed and modified, # # however you may not remove any of these header notices. By # # using this code you agree to indemnify author from any # # liability that might arise from it's use. # ################################################################ use strict; use integer; use cg; require "jump.ini"; my $url = $ENV{"QUERY_STRING"}; $url = cg::url($url ? $url : substr($ENV{"PATH_INFO"}, 1)); my $referer = cg::url($ENV{"HTTP_REFERER"}); my $frame = "http://".$ENV{"HTTP_HOST"}.$ENV{"SCRIPT_NAME"}; $frame =~ s/jump\.(.*)$/frame\.$1/os; if(!$referer) { $referer = $ENV{"HTTP_HOST"}; } if($ini::top_frame || $ini::bottom_frame) { cg::content_type("text/html"); cg::print("http://$url".($ini::top_frame ? "" : "")."".($ini::bottom_frame ? "" : "").""); } else { cg::header("Status", 302); cg::location("http://$url"); } open(LOG, ">>$cwd/jump.log") or cg::error("$cwd/jump.log"); print(LOG "$cg::now\t$referer\t$url\n"); close(LOG);