#!/usr/local/bin/perl # index.cgi # Display a table of icons for cvs server options require './pserver-lib.pl'; &ReadParse(); if (!$cvs_path) { &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1); print "

",&text('index_ecvs', "$config{'cvs'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"

\n"; &ui_print_footer("/", $text{'index'}); exit; } $ver = &get_cvs_version(\$out); if (!$ver) { &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1); print "

",&text('index_eversion', "$config{'cvs'} -v", "

$out
"),"

\n"; &ui_print_footer("/", $text{'index'}); exit; } # Go direct to one icon, if it is the only one available @avfeatures = grep { $access{$_} } @features; if (@avfeatures == 1 && !$access{'setup'}) { &redirect($featureprog{$avfeatures[0]}); exit; } &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, undef, &help_search_link("cvs", "man", "doc"), undef, undef, &text('index_version', $ver)); if (!-d "$config{'cvsroot'}/CVSROOT") { # No CVS root .. offer to setup print "

",&text('index_eroot', "$gconfig{'webprefix'}/config.cgi?$module_name"),"

\n"; if ($access{'init'}) { print &text('index_initdesc', "$config{'cvsroot'}"),"

\n"; print "

\n"; print "\n"; print "
\n"; } &ui_print_footer("/", $text{'index'}); exit; } # Show configuration icons @icons = map { "images/$_.gif" } @avfeatures; @links = map { $featureprog{$_} } @avfeatures; @titles = map { $text{$_."_title"} } @avfeatures; &icons_table(\@links, \@titles, \@icons, 4); if ($access{'setup'}) { # Check if run from inetd or xinetd print "
\n"; print "\n"; $inet = &check_inetd(); if ($inet && $inet->{'args'} =~ /\s(\/\S+)\s+pserver$/) { $inetdir = $1; } if (!$inet) { print "\n"; print "\n"; print "\n"; print "\n"; } elsif (!$inet->{'active'}) { print "\n"; print "\n"; if ($inetdir) { print "\n"; print "\n"; } else { print "\n"; print "\n"; if ($inetdir) { print "\n"; } else { print "\n"; } print "\n"; } print "
",&text('index_setupdesc', $has_xinetd ? "xinetd" : "inetd"),"
\n"; print "$text{'index_asuser'}\n"; print &ui_user_textbox("user", "root"),"\n"; print "
",&text('index_actdesc2', "$inet->{'type'}", "$inetdir"); } else { print "",&text('index_actdesc', "$inet->{'type'}"); } print "
\n"; print "$text{'index_asuser'}\n"; print &ui_user_textbox("user", $inet->{'user'}),"\n"; print "
",&text('index_deactdesc2', "$inet->{'type'}", "$inetdir"),"",&text('index_deactdesc', "$inet->{'type'}"),"
\n"; if ($inetdir && $inetdir ne $config{'cvsroot'}) { print "

$text{'index_einetroot'}
\n"; } } &ui_print_footer("/", $text{'index'});