#!/usr/bin/perl # index.cgi # Display ADSL configuration options # XXX new-style ADSL config in redhat 7.2 and above! # XXX effects start/stop and bootup as well require './adsl-client-lib.pl'; $vers = &get_pppoe_version(\$out); &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, 0, &help_search_link("pppoe", "man", "doc", "google"), undef, undef, $vers ? &text('index_version', $vers) : undef); if (!$vers) { # Not installed print "<p>",&text('index_eadsl', "<tt>$config{'pppoe_cmd'}</tt>", "@{[&get_webprefix()]}/config.cgi?$module_name"),"<p>\n"; } elsif (!($conf = &get_config())) { # Missing config file if ($config{'conf_style'} == 0) { # Just give up print "<p>", &text('index_econfig', "<tt>$config{'pppoe_conf'}</tt>", "@{[&get_webprefix()]}/config.cgi?$module_name"),"<p>\n"; } else { # On redhat systems, the file needs to be created by this # module :-( print "<p>",&text('index_esetup', "<tt>$config{'pppoe_conf'}</tt>"),"<p>\n"; print "<center><form action=setup.cgi>\n"; print "<input type=submit value='$text{'index_setup'}'>\n"; print "</form></center>\n"; } } elsif (&find("TYPE", $conf) =~ /modem/i) { # For a modem on a redhat system $config{'pppoe_conf'} =~ /^(.*)\//; print "<p>",&text('index_emodem', "<tt>$1</tt>", "@{[&get_webprefix()]}/config.cgi?$module_name"),"<p>\n"; } else { # Show configuration form $conf = &get_config(); print "$text{'index_desc'}<p>\n"; print "<form action=save.cgi method=post>\n"; print "<table border width=100%>\n"; print "<tr $tb> <td><b>$text{'index_header'}</b></td> </tr>\n"; print "<tr $cb> <td><table width=100%>\n"; # Show network interface field &foreign_require("net", "net-lib.pl"); $eth = &find("ETH", $conf); print "<tr> <td><b>",&hlink($text{'index_eth'}, "eth"),"</b></td>\n"; @ifcs = &net::active_interfaces(1); print "<td><select name=eth>\n"; $found = !$eth; foreach $i (@ifcs) { next if ($i->{'fullname'} !~ /^eth(\d+)$/); printf "<option value='%s' %s>%s\n", $i->{'name'}, $eth eq $i->{'name'} ? "selected" : "", $i->{'name'}, "</option>"; $found++ if ($eth eq $i->{'name'}); } printf "<option value='' %s>%s\n", $found ? "" : "selected", $text{'index_other'}, "</option>"; print "</select>\n"; printf "<input name=other size=6 value='%s'></td>\n", $found ? "" : $eth; # Show on-demand field $demand = &find("DEMAND", $conf); print "<td><b>",&hlink($text{'index_demand'},"demand"),"</b></td>\n"; printf "<td nowrap><input type=radio name=demand value=yes %s> %s\n", $demand !~ /^\d+$/i ? "" : "checked", $text{'index_timeout'}; printf "<input name=timeout value='%s' size=4>\n", $demand !~ /^\d+$/i ? "" : $demand; printf "<input type=radio name=demand value=no %s> %s</td> </tr>\n", $demand !~ /^\d+$/i ? "checked" : "", $text{'no'}; # Show username field $user = &find("USER", $conf); print "<tr> <td><b>",&hlink($text{'index_user'},"user"),"</b></td>\n"; printf "<td><input name=user size=20 value='%s'></td>\n", $user; # Show password field (from pap-secrets) ($sec) = grep { $_->{'client'} eq $user } &list_secrets(); print "<td><b>",&hlink($text{'index_sec'},"sec"),"</b></td>\n"; printf "<td><input type=password name=sec size=20 value='%s'></td> </tr>\n", $sec->{'secret'}; # Show DNS config buttons $dns = &find("USEPEERDNS", $conf) || &find("PEERDNS", $conf); print "<tr> <td><b>",&hlink($text{'index_dns'}, "dns"),"</b></td>\n"; printf "<td><input type=radio name=dns value=yes %s> %s\n", $dns =~ /yes/i ? "checked" : "", $text{'yes'}; printf "<input type=radio name=dns value=no %s> %s</td>\n", $dns =~ /yes/i ? "" : "checked", $text{'no'}; # Show connect timeout field $connect = &find("CONNECT_TIMEOUT", $conf); print "<td><b>",&hlink($text{'index_connect'},"connect"),"</b></td>\n"; printf "<td nowrap><input type=radio name=connect_def value=1 %s> %s\n", $connect == 0 ? "checked" : "", $text{'index_forever'}; printf "<input type=radio name=connect_def value=0 %s>\n", $connect == 0 ? "" : "checked"; printf "<input name=connect size=4 value='%s'> %s</td> </tr>\n", $connect == 0 ? "" : $connect, $text{'index_secs'}; # Show MSS field $mss = &find("CLAMPMSS", $conf); print "<tr> <td><b>",&hlink($text{'index_mss'},"mss"),"</b></td>\n"; printf "<td nowrap><input type=radio name=mss value=yes %s> %s\n", $mss =~ /no/i ? "" : "checked", $text{'index_psize'}; printf "<input name=psize value='%s' size=5> %s\n", $mss =~ /no/i ? "" : $mss, $text{'index_bytes'}; printf "<input type=radio name=mss value=no %s> %s</td>\n", $mss =~ /no/i ? "checked" : "", $text{'no'}; # Show firewall menu $fw = &find("FIREWALL", $conf); $fw ||= "NONE"; if ($fw ne "NONE") { print "<td><b>",&hlink($text{'index_fw'},"fw"),"</b></td>\n"; print "<td><select name=fw>\n"; foreach $f ('NONE', 'STANDALONE', 'MASQUERADE') { printf "<option value=%s %s>%s\n", $f, lc($f) eq lc($fw) ? "selected" : "", $text{'index_fw_'.lc($f)}, "</option>"; } print "</select></td> </tr>\n"; } else { print "</tr>\n"; } print "</table></td></tr></table>\n"; print "<input type=submit value='$text{'index_save'}'></form>\n"; # Show connected/disconnect buttons print &ui_hr(); print &ui_buttons_start(); local ($dev, $ip) = &get_adsl_ip(); if ($ip) { # Offer to shut down print &ui_buttons_row("stop.cgi", $text{'index_stop'}, &text('index_stopdesc', "<tt>$ip</tt>", "<tt>$config{'stop_cmd'}</tt>")); } elsif ($dev eq "demand") { # Offer to cancel on-demand connection print &ui_buttons_row("stop.cgi", $text{'index_cdemand'}, &text('index_cdemanddesc', "<tt>$config{'stop_cmd'}</tt>")); } elsif ($dev) { # Offer to cancel connect print &ui_buttons_row("stop.cgi", $text{'index_cancel'}, &text('index_canceldesc', "<tt>$config{'stop_cmd'}</tt>")); } else { # Offer to start up print &ui_buttons_row("start.cgi", $text{'index_start'}, &text('index_startdesc', "<tt>$config{'start_cmd'}</tt>")); } # Show boot-time button if ($config{'conf_style'} == 1 && ($onboot = find("ONBOOT", $conf))) { # Offer to turn on/off starting at boot print &ui_buttons_row("rbootup.cgi", $text{'index_boot'}, $text{'index_bootdesc'}, undef, &ui_yesno_radio("onboot", $onboot =~ /yes/i ? 1 : 0)); } elsif (&foreign_check("init")) { # Offer to enable/disable init script &foreign_require("init", "init-lib.pl"); $boot = &init::action_status("adsl"); if ($boot > 0) { print &ui_buttons_row("bootup.cgi", $text{'index_boot'}, $text{'index_bootdesc'}, undef, &ui_yesno_radio("boot", $boot == 2 ? 1 : 0)); } } print &ui_buttons_end(); } &ui_print_footer("/", $text{'index'});
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
help | Folder | 0755 |
|
|
images | Folder | 0755 |
|
|
lang | Folder | 0755 |
|
|
CHANGELOG | File | 118 B | 0644 |
|
adsl-client-lib.pl | File | 1.8 KB | 0755 |
|
backup_config.pl | File | 922 B | 0755 |
|
bootup.cgi | File | 382 B | 0755 |
|
config | File | 153 B | 0644 |
|
config-coherent-linux | File | 175 B | 0644 |
|
config-openmamba-linux | File | 175 B | 0644 |
|
config-redhat-linux-7.2-ALL | File | 175 B | 0644 |
|
config-syno-linux | File | 153 B | 0644 |
|
config-trustix-linux | File | 177 B | 0644 |
|
config.info | File | 382 B | 0644 |
|
config.info.ar | File | 0 B | 0644 |
|
config.info.bg | File | 597 B | 0644 |
|
config.info.ca | File | 426 B | 0644 |
|
config.info.de | File | 376 B | 0644 |
|
config.info.es | File | 420 B | 0644 |
|
config.info.fr | File | 445 B | 0644 |
|
config.info.hr | File | 0 B | 0644 |
|
config.info.it | File | 443 B | 0644 |
|
config.info.ja | File | 404 B | 0644 |
|
config.info.ms | File | 386 B | 0644 |
|
config.info.nl | File | 421 B | 0644 |
|
config.info.no | File | 395 B | 0644 |
|
config.info.pl | File | 416 B | 0644 |
|
config.info.pt_BR | File | 448 B | 0644 |
|
config.info.sv | File | 0 B | 0644 |
|
config.info.tr | File | 408 B | 0644 |
|
config.info.zh_TW | File | 303 B | 0644 |
|
ifcfg-ppp | File | 347 B | 0644 |
|
index.cgi | File | 6.66 KB | 0755 |
|
install_check.pl | File | 421 B | 0755 |
|
log_parser.pl | File | 336 B | 0755 |
|
module.info | File | 147 B | 0644 |
|
module.info.af | File | 0 B | 0644 |
|
module.info.af.auto | File | 94 B | 0644 |
|
module.info.ar | File | 27 B | 0644 |
|
module.info.ar.auto | File | 92 B | 0644 |
|
module.info.be | File | 0 B | 0644 |
|
module.info.be.auto | File | 134 B | 0644 |
|
module.info.bg | File | 26 B | 0644 |
|
module.info.bg.auto | File | 87 B | 0644 |
|
module.info.ca | File | 80 B | 0644 |
|
module.info.ca.auto | File | 13 B | 0644 |
|
module.info.cs | File | 20 B | 0644 |
|
module.info.cs.auto | File | 74 B | 0644 |
|
module.info.da | File | 0 B | 0644 |
|
module.info.da.auto | File | 86 B | 0644 |
|
module.info.de | File | 83 B | 0644 |
|
module.info.de.auto | File | 13 B | 0644 |
|
module.info.el | File | 0 B | 0644 |
|
module.info.el.auto | File | 144 B | 0644 |
|
module.info.es | File | 21 B | 0644 |
|
module.info.es.auto | File | 75 B | 0644 |
|
module.info.eu | File | 0 B | 0644 |
|
module.info.eu.auto | File | 91 B | 0644 |
|
module.info.fa | File | 0 B | 0644 |
|
module.info.fa.auto | File | 118 B | 0644 |
|
module.info.fi | File | 0 B | 0644 |
|
module.info.fi.auto | File | 90 B | 0644 |
|
module.info.fr | File | 0 B | 0644 |
|
module.info.fr.auto | File | 96 B | 0644 |
|
module.info.he | File | 0 B | 0644 |
|
module.info.he.auto | File | 105 B | 0644 |
|
module.info.hr | File | 0 B | 0644 |
|
module.info.hr.auto | File | 92 B | 0644 |
|
module.info.hu | File | 0 B | 0644 |
|
module.info.hu.auto | File | 96 B | 0644 |
|
module.info.it | File | 20 B | 0644 |
|
module.info.it.auto | File | 78 B | 0644 |
|
module.info.ja | File | 32 B | 0644 |
|
module.info.ja.auto | File | 118 B | 0644 |
|
module.info.ko | File | 0 B | 0644 |
|
module.info.ko.auto | File | 132 B | 0644 |
|
module.info.lt | File | 0 B | 0644 |
|
module.info.lt.auto | File | 102 B | 0644 |
|
module.info.lv | File | 0 B | 0644 |
|
module.info.lv.auto | File | 88 B | 0644 |
|
module.info.ms | File | 73 B | 0644 |
|
module.info.ms.auto | File | 13 B | 0644 |
|
module.info.mt | File | 0 B | 0644 |
|
module.info.mt.auto | File | 88 B | 0644 |
|
module.info.nl | File | 20 B | 0644 |
|
module.info.nl.auto | File | 73 B | 0644 |
|
module.info.no | File | 20 B | 0644 |
|
module.info.no.auto | File | 69 B | 0644 |
|
module.info.pl | File | 81 B | 0644 |
|
module.info.pl.auto | File | 13 B | 0644 |
|
module.info.pt | File | 0 B | 0644 |
|
module.info.pt.auto | File | 94 B | 0644 |
|
module.info.pt_BR | File | 24 B | 0644 |
|
module.info.pt_BR.auto | File | 79 B | 0644 |
|
module.info.ro | File | 0 B | 0644 |
|
module.info.ro.auto | File | 94 B | 0644 |
|
module.info.ru | File | 0 B | 0644 |
|
module.info.ru.auto | File | 115 B | 0644 |
|
module.info.sk | File | 0 B | 0644 |
|
module.info.sk.auto | File | 92 B | 0644 |
|
module.info.sl | File | 0 B | 0644 |
|
module.info.sl.auto | File | 90 B | 0644 |
|
module.info.sv | File | 0 B | 0644 |
|
module.info.sv.auto | File | 91 B | 0644 |
|
module.info.th | File | 0 B | 0644 |
|
module.info.th.auto | File | 156 B | 0644 |
|
module.info.tr | File | 24 B | 0644 |
|
module.info.tr.auto | File | 70 B | 0644 |
|
module.info.uk | File | 0 B | 0644 |
|
module.info.uk.auto | File | 142 B | 0644 |
|
module.info.ur | File | 0 B | 0644 |
|
module.info.ur.auto | File | 133 B | 0644 |
|
module.info.vi | File | 0 B | 0644 |
|
module.info.vi.auto | File | 109 B | 0644 |
|
module.info.zh | File | 0 B | 0644 |
|
module.info.zh.auto | File | 92 B | 0644 |
|
module.info.zh_TW | File | 25 B | 0644 |
|
module.info.zh_TW.auto | File | 76 B | 0644 |
|
rbootup.cgi | File | 429 B | 0755 |
|
save.cgi | File | 1.95 KB | 0755 |
|
secrets-lib.pl | File | 1.64 KB | 0755 |
|
setup.cgi | File | 429 B | 0755 |
|
start.cgi | File | 925 B | 0755 |
|
stop.cgi | File | 581 B | 0755 |
|