[ Avaa Bypassed ]




Upload:

Command:

www-data@18.224.70.193: ~ $
#!/usr/bin/perl
# edit.cgi
# Display settings for some dialer

require './ppp-client-lib.pl';
&ReadParse();
$conf = &get_config();
if ($in{'new'}) {
	&ui_print_header(undef, $text{'edit_title1'}, "");
	}
else {
	&ui_print_header(undef, $text{'edit_title2'}, "");
	$dialer = $conf->[$in{'idx'}];
	}
($ddialer) = grep { lc($_->{'name'}) eq 'dialer defaults' } @$conf;
if ($inherits = $dialer->{'values'}->{'inherits'}) {
	($parent) = grep { lc($_->{'name'}) eq lc($inherits) } @$conf;
	}

if (lc($dialer->{'name'}) eq 'dialer defaults') {
	print "$text{'edit_ddesc'}<p>\n";
	}

print "<form action=save.cgi method=post>\n";
print "<input type=hidden name=new value='$in{'new'}'>\n";
print "<input type=hidden name=idx value='$in{'idx'}'>\n";
print "<table border width=100%>\n";
print "<tr $tb> <td><b>$text{'edit_header'}</b></td> </tr>\n";
print "<tr $cb> <td><table width=100%>\n";

print "<tr> <td><b>$text{'edit_name'}</b></td> <td>\n";
if (lc($dialer->{'name'}) eq 'dialer defaults') {
	# Don't allow renaming of the defaults
	print $text{'index_defaults'};
	$defs++;
	}
elsif ($dialer->{'name'} =~ /^Dialer\s+(.*)$/ || $in{'new'}) {
	# Some normal dialer name
	print "<input name=dialer size=20 value='$1'>\n";
	}
else {
	# Some other oddly-named section
	print "<input name=name size=20 value='$dialer->{'name'}'>\n";
	}
print "</td>\n";

print &opt_input("Phone", $text{'edit_phone'}, 20);
print "</tr>\n";

print "<tr>\n";
print &opt_input("Username", $text{'edit_user'}, 20);
print &opt_input("Password", $text{'edit_pass'}, 20, "type=password");
print "</tr>\n";

print "<tr>\n";
print &opt_input("Dial Prefix", $text{'edit_prefix'}, 10);
print &yes_no_input("Stupid Mode", $text{'edit_stupid'}, 0);
print "</tr>\n";

print "<tr> <td><b>$text{'edit_other'}</b></td> <td colspan=3>\n";
for($i=1; $i<=4; $i++) {
	printf "<input name=other_%d size=20 value='%s'>\n",
		$i, $dialer->{'values'}->{'phone'.$i};
	}
print "</td> </tr>\n";

print "<tr> <td><b>$text{'edit_inherits'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=inherits_def value=1 %s> %s\n",
	$inherits ? "" : "checked", $text{'edit_def'};
printf "<input type=radio name=inherits_def value=0 %s> %s\n",
	$inherits ? "checked" : "", $text{'edit_from'};
print "<select name=inherits>\n";
foreach $c (@$conf) {
	next if ($c eq $dialer);
	printf "<option value='%s' %s>%s</option>\n",
		$c->{'name'}, lc($inherits) eq lc($c->{'name'}) ? "selected":"",
		&dialer_name($c->{'name'});
	}
print "</select></td> </tr>\n";

# Modem options
print "<tr> <td colspan=4><hr></td> </tr>\n";

$modem = $dialer->{'values'}->{'modem'};
$dm = &get_default("Modem");
local $found = !$modem || $modem eq "/dev/modem";
print "<tr> <td><b>$text{'edit_serial'}</b></td>\n";
print "<td nowrap><select name=modem>\n";
printf "<option value='' %s>%s %s</option>\n",
	$modem ? "" : "selected",
	$defs ? $text{'edit_none'} : $text{'edit_def'},
	$dm ? "($dm)" : "";
printf "<option value=/dev/modem %s>%s (%s)</option>\n",
	$modem eq "/dev/modem" ? "selected" : "", $text{'edit_modem'},
	"/dev/modem";
foreach $t (sort { "$a$b" =~ /^\/dev\/ttyS(\d+)\/dev\/ttyS(\d+)$/ ? $1 <=> $2 : 0 } glob("/dev/ttyS[0-9]*")) {
	printf "<option value=%s %s>%s</option>\n",
		$t, $modem eq $t ? "selected" : "",
		$t =~ /ttyS(\d+)$/ ? &text('edit_port', $1+1) : $t;
	$found++ if ($modem eq $t);
	}
printf "<option value=* %s>%s</option>\n",
	$found ? "" : "selected", $text{'edit_otherm'};
print "</select>\n";
printf "<input name=otherm size=15 value='%s'></td>\n",
	$found ? "" : $modem;

print &opt_input("Baud", $text{'edit_baud'}, 6);
print "</tr>\n";

print "<tr> <td valign=top><b>$text{'edit_init'}</b></td> <td colspan=3>\n";
for($i=1; $i<=9; $i++) {
	printf "<input name=init_%s size=25 value='%s'>\n",
		$i, $dialer->{'values'}->{"init".$i};
	print "<br>\n" if (($i-1)%3 == 2);
	}
print "</td> </tr>\n";

print "<tr>\n";
print &yes_no_input("Carrier Check", $text{'edit_carrier'}, 1);
print &yes_no_input("Abort on Busy", $text{'edit_busy'}, 0);
print "</tr>\n";

print "<tr>\n";
print &opt_input("Dial Attempts", $text{'edit_dial'}, 4);
print &yes_no_input("Abort on No Dialtone", $text{'edit_dialtone'}, 1);
print "</tr>\n";

# Networking options
print "<tr> <td colspan=4><hr></td> </tr>\n";

print "<tr>\n";
print &yes_no_input("Auto DNS", $text{'edit_dns'}, 1);
print &yes_no_input("Auto Reconnect", $text{'edit_reconnect'}, 1);
print "</tr>\n";

print "<tr>\n";
print &opt_input("Idle Seconds", $text{'edit_idle'}, 6);
print "</tr>\n";

print "</table></td></tr></table>\n";

print "<table width=100%><tr>\n";
if ($in{'new'}) {
	print "<td><input type=submit value='$text{'create'}'></td>\n";
	}
else {
	print "<td><input type=submit value='$text{'save'}'></td>\n";
	print "<td align=right><input type=submit name=delete ",
	      "value='$text{'delete'}'></td>\n";
	}
print "</tr></table></form>\n";

&ui_print_footer("", $text{'index_return'});

# opt_input(name, text, size, inputopts)
sub opt_input
{
local $n = lc($_[0]);
local $v = $dialer->{'values'}->{$n};
local $rv = "<td><b>$_[1]</b></td> <td nowrap>\n";
$rv .= sprintf "<input type=radio name='${n}_def' value=1 %s> %s\n",
		defined($v) ? "" : "checked",
		$defs ? $text{'edit_none'} : $text{'default'};
$rv .= sprintf "<input type=radio name='${n}_def' value=0 %s>\n",
		defined($v) ? "checked" : "";
$rv .= sprintf "<input $_[3] name='${n}' size=$_[2] value='%s'></td>\n", $v;
return $rv;
}

# yes_no_input(name, text, defmode)
sub yes_no_input
{
local $n = lc($_[0]);
local $val = $dialer->{'values'}->{$n};
local $dval = &get_default($_[0]);
local $d = $dval =~ /on|yes|1/i ? $text{'edit_yd'} :
	   $dval =~ /off|no|0/i ? $text{'edit_nd'} :
	   $_[2] ? $text{'edit_yd'} : $text{'edit_nd'};
local $rv = "<td><b>$_[1]</b></td> <td>\n";
$rv .= sprintf "<input type=radio name='$n' value=1 %s> %s\n",
	$val =~ /on|yes|1/i ? "checked" : "", $text{'yes'};
$rv .= sprintf "<input type=radio name='$n' value=0 %s> %s\n",
	$val =~ /off|no|0/i ? "checked" : "", $text{'no'};
$rv .= sprintf "<input type=radio name='$n' value=-1 %s> %s</td>\n",
	$val ? "" : "checked", $d;
return $rv;
}

# get_default(name)
sub get_default
{
return undef if ($defs);
if ($parent) {
	local $pv = $parent->{'values'}->{lc($_[0])};
	return $pv if (defined($pv));
	}
return $ddialer->{'values'}->{lc($_[0])};
}


Filemanager

Name Type Size Permission Actions
images Folder 0755
lang Folder 0755
CHANGELOG File 137 B 0644
backup_config.pl File 585 B 0755
bootup.cgi File 838 B 0755
cgi_args.pl File 186 B 0755
config File 58 B 0644
config.info File 119 B 0644
config.info.ca File 134 B 0644
config.info.de File 127 B 0644
config.info.fa File 151 B 0644
config.info.nl File 145 B 0644
config.info.no File 128 B 0644
connect.cgi File 376 B 0755
disconnect.cgi File 396 B 0755
edit.cgi File 6.15 KB 0755
index.cgi File 4.32 KB 0755
init.cgi File 905 B 0755
install_check.pl File 373 B 0755
log_parser.pl File 760 B 0755
module.info File 201 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 130 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 162 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 217 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 194 B 0644
module.info.ca File 120 B 0644
module.info.ca.auto File 12 B 0644
module.info.cs File 26 B 0644
module.info.cs.auto File 121 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 148 B 0644
module.info.de File 139 B 0644
module.info.de.auto File 12 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 185 B 0644
module.info.es File 0 B 0644
module.info.es.auto File 154 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 134 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 167 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 147 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 157 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 172 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 132 B 0644
module.info.hu File 0 B 0644
module.info.hu.auto File 150 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 143 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 182 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 141 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 164 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 150 B 0644
module.info.ms File 134 B 0644
module.info.ms.auto File 12 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 143 B 0644
module.info.nl File 25 B 0644
module.info.nl.auto File 120 B 0644
module.info.no File 30 B 0644
module.info.no.auto File 105 B 0644
module.info.pl File 0 B 0644
module.info.pl.auto File 147 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 142 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 151 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 145 B 0644
module.info.ru File 0 B 0644
module.info.ru.auto File 198 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 144 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 132 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 137 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 295 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 148 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 235 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 248 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 148 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 137 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 146 B 0644
ppp-client-lib.pl File 8.48 KB 0755
save.cgi File 3.41 KB 0755
start.pl File 200 B 0755
stop.pl File 245 B 0755