#!/usr/local/bin/perl # index.cgi # Display a list of connections require './ppp-client-lib.pl'; &foreign_require("proc", "proc-lib.pl"); # Check if wvdial is installed if (!&has_command($config{'wvdial'}) || ($out = &proc::pty_backquote("$config{'wvdial'} --version")) !~ /WvDial\s+([^: \n\r]+)/i) { &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1); print "
",&text('index_ewvdial', "$config{'wvdial'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"
\n"; if ($out) { print &text('index_ver', "$config{'wvdial'} --version"),"\n"; print "
$out\n"; } } else { # Get the version and show title waitpid(-1, 1); $vers = $1; &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, &help_search_link("wvdial", "man", "doc"), undef, undef, &text('index_version', $vers)); if ($vers < 1.53) { # This version not supported print "
",&text('index_eversion', $vers, 1.53),"
\n"; } elsif (!-r $config{'file'}) { # We need initialization print "
\n"; } else { # Show defined dialers and modems $conf = &get_config(); @links = map { "edit.cgi?idx=".$_->{'index'} } @$conf; @icons = map { "images/modem.gif" } @$conf; @titles = map { &dialer_name($_->{'name'}) } @$conf; print &ui_subheading($text{'index_header'}); if (@links) { &icons_table(\@links, \@titles, \@icons); } else { print "$text{'index_none'}\n"; } print "$text{'index_dadd'}", "
\n"; # Show buttons for connect/disconnect and status local @dials = grep { $_->{'name'} =~ /^Dialer\s+/i } @$conf; print &ui_hr(); print "