#!/usr/bin/perl
#
# perfbrowse.perl -- CGI browser for PERFORCE
#
# $Id: //guest/matthew_rees/perfbrowse/perfbrowse.pl#3 $
# Updated by Jeff Marshall at Paragon Software, Inc.
# (jam@paragon-software.com)
#
# Revised by Matthew Rees (matthew@marc.com) 6/14/1999
# - Add FORMS capability
# - Add a nice way to browse the repository
# - Many other miscellaneous changes
# - Tested with Perforce server version 99.1
# Set these according to your system:
$ENV{P4PORT} = "1666";
$ENV{P4CLIENT} = "perfbrowse";
# When using authentication on the web server, REMOTE_USER is set and could
# be used here. But it wouldn't work for any users that use a password!
#$ENV{P4USER} = $ENV{REMOTE_USER};
$ENV{P4USER} = "p4admin";
# The PATH environment variable needs to be able to pick up the p4 command
$ENV{PATH} .= ":/usr/local/bin";
# Set TOPPAGE to something other than this script if you want to use a custom
# static top-level page (link to this is included at the bottom of every page)
# Suggestion: run 'perfbrowse.pl > index.html' and edit to create your top page
#$TOPPAGE = "$myname";
$TOPPAGE = "/index.html";
# These icons are used for the depot browser
# (They may be left undefined, but it looks much better you find icons!)
$UPDIR_ICON = "/icons/hand.up.gif";
$DIR_ICON = "/icons/folder.gif";
# The name of this script
$myname = $ENV{SCRIPT_NAME} || "cgi/perfbrowse.pl";
$BLUE = qq();
$RED = qq();
$END = qq();
$ADD = $BLUE;
$ADDEND = $END;
$DEL = "$RED";
$DELEND = "$END";
$MAXCONTEXT = 30;
$NCONTEXT = 10;
$PRINTEDHEADER = 0;
&ReadParse(\%INPUT);
################################
#
# No arguments.
#
# Put up a basic index page
#
################################
if (! defined $INPUT{'cmd'}) {
print &header("Perforce Web Interface");
print "