#!/usr/local/bin/perl # index.cgi # Display icons for defined PPTP tunnels require './pptp-client-lib.pl'; $vers = &get_pppd_version(\$out); &ui_print_header(undef, $text{'index_title'}, undef, "intro", 1, 1, 0, undef, undef, undef, $vers ? &text('index_version', $vers) : undef); # Create the PPTP options file if non-existent. This ensures that it can be # used in the peer scripts, even if it is empty if (!-r $config{'pptp_options'} && $config{'pptp_options'}) { &open_tempfile(OPTS, ">>$config{'pptp_options'}"); &close_tempfile(OPTS); } if (!&has_command($config{'pptp'})) { # The PPTP command is not installed print "
",&text('index_epptp', "$config{'pptp'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"
\n"; } elsif (!$vers) { # The PPP daemon is not installed print "
",&text('index_epppd', "pppd"),"
\n"; } else { # Show icons @tunnels = &list_tunnels(); %tunnels = map { $_->{'name'}, 1 } @tunnels; print &ui_subheading($text{'index_header'}); if (@tunnels) { @links = map { "edit.cgi?tunnel=$_->{'name'}" } @tunnels; @titles = map { $_->{'name'} } @tunnels; @icons = map { "images/tunnel.gif" } @tunnels; &icons_table(\@links, \@titles, \@icons); } else { print "$text{'index_none'}
\n"; } print "$text{'index_add'}
\n"; print &ui_hr(); print "