#!/usr/local/bin/perl # edit_conf.cgi # Display PPTP server options require './pptp-server-lib.pl'; $access{'conf'} || &error($text{'conf_ecannot'}); &ui_print_header(undef, $text{'conf_title'}, "", "conf"); # Show actual options $conf = &get_config(); print "
\n"; print "\n"; print "\n"; print "
$text{'conf_header'}
\n"; # Maximum PPP speed $speed = &find_conf("speed", $conf); print "\n", $speed, $text{'conf_baud'}; # Listen address $listen = &find_conf("listen", $conf); print "\n", $listen; # PPP options file $option = &find_conf("option", $conf); $mode = $option eq $options_pptp ? 1 : $option ? 2 : 0; print "\n", $mode == 2 ? $option : "", &file_chooser_button("option"); # Local IP ranges &ip_table("localip"); # Remote IP ranges &ip_table("remoteip"); # IPX networks $ipxnets = &find_conf("ipxnets", $conf); ($from, $to) = split(/-/, $ipxnets); print "\n"; print "
$text{'conf_speed'} \n"; printf " %s\n", $speed ? "" : "checked", $text{'default'}; printf "\n", $speed ? "checked" : ""; printf " %s$text{'conf_listen'} \n"; printf " %s\n", $listen ? "" : "checked", $text{'conf_all'}; printf "\n", $listen ? "checked" : ""; printf "
$text{'conf_option'} \n"; printf " %s\n", $mode == 0 ? "checked" : "", $text{'conf_mode0'}; printf " %s\n", $mode == 1 ? "checked" : "", $text{'conf_mode1'}; printf " %s\n", $mode == 2 ? "checked" : "", $text{'conf_mode2'}; printf " %s
$text{'conf_ipxnets'} \n"; printf " %s\n", $ipxnets ? "" : "checked", $text{'conf_all'}; printf "\n", $ipxnets ? "checked" : ""; printf "%s \n", $text{'conf_from'}, $from; printf "%s \n", $text{'conf_to'}, $from; print "
\n"; print "
\n"; &ui_print_footer("", $text{'index_return'}); sub ip_table { local @ips = split(/,/, &find_conf($_[0], $conf)); print " ",$text{'conf_'.$_[0]}, " \n"; print "\n"; print "\n"; if ($_[0] eq "localip") { print "$text{'conf_ipdesc'}\n"; } print "\n"; }