mirror of
https://github.com/webmin/webmin.git
synced 2026-02-17 04:02:15 +00:00
@@ -75,13 +75,10 @@ if ($r == 0) {
|
||||
|
||||
if ($access{'stop'} && &is_mysql_local()) {
|
||||
print &ui_hr();
|
||||
print "<form action=start.cgi>\n";
|
||||
print "<table width=100%><tr><td>\n";
|
||||
print "<input type=submit ",
|
||||
"value=\"$text{'index_start'}\"></td>\n";
|
||||
print "<td>",&text('index_startmsg',
|
||||
"<tt>$config{'start_cmd'}</tt>"),"</td> </tr></table>\n";
|
||||
print "</form>\n";
|
||||
print &ui_buttons_start();
|
||||
print &ui_buttons_row("start.cgi",
|
||||
$text{'index_start'}, &text('index_startmsg',"<tt>$config{'start_cmd'}</tt>"));
|
||||
print &ui_buttons_end();
|
||||
}
|
||||
}
|
||||
elsif ($r == -1) {
|
||||
|
||||
@@ -15,45 +15,26 @@ else {
|
||||
$st = $stunnels[$in{'idx'}];
|
||||
}
|
||||
|
||||
print "<form action=save_stunnel.cgi>\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_header1'}</b></td> </tr>\n";
|
||||
print "<tr $cb> <td><table width=100%>\n";
|
||||
|
||||
print "<tr> <td><b>$text{'edit_name'}</b></td>\n";
|
||||
printf "<td><input name=name size=15 value='%s'></td>\n",
|
||||
$st->{'name'};
|
||||
|
||||
print "<td><b>$text{'edit_port'}</b></td>\n";
|
||||
printf "<td><input name=port size=6 value='%s'></td> </tr>\n",
|
||||
$st->{'port'};
|
||||
|
||||
print "<tr> <td><b>$text{'edit_active'}</b></td>\n";
|
||||
printf "<td><input type=radio name=active value=1 %s> %s\n",
|
||||
$st->{'active'} ? "checked" : "", $text{'yes'};
|
||||
printf "<input type=radio name=active value=0 %s> %s</td>\n",
|
||||
$st->{'active'} ? "" : "checked", $text{'no'};
|
||||
|
||||
if (!$in{'new'}) {
|
||||
print "<td><b>$text{'edit_type'}</b></td>\n";
|
||||
print "<td><tt>$st->{'type'}</tt></td>\n";
|
||||
}
|
||||
elsif ($has_inetd && $has_xinetd) {
|
||||
print "<td><b>$text{'edit_type'}</b></td>\n";
|
||||
print "<td><select name=type>\n";
|
||||
print "<option selected>xinetd</option>\n";
|
||||
print "<option>inetd</option>\n";
|
||||
print "</select></td>\n";
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table></td></tr></table><br>\n";
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td><b>$text{'edit_header2'}</b></td> </tr>\n";
|
||||
print "<tr $cb> <td><table width=100%>\n";
|
||||
print &ui_form_start("save_stunnel.cgi", "post");
|
||||
print &ui_hidden("new",$in{'new'});
|
||||
print &ui_hidden("idx",$in{'idx'});
|
||||
print &ui_table_start($text{'edit_header1'}, "width=80%", 4);
|
||||
print &ui_columns_row([
|
||||
"<b>$text{'edit_name'}</b> ",
|
||||
&ui_textbox("name", $text{'edit_name'}, 15),
|
||||
" <b>$text{'edit_port'}</b> ",
|
||||
&ui_textbox("port", $st->{'port'}, 6)
|
||||
]);
|
||||
print &ui_columns_row([
|
||||
"<b>$text{'edit_active'}</b>",
|
||||
&ui_oneradio("active","1", $text{'yes'}, ($st->{'active'} ? 1 : 0) ).
|
||||
" ".&ui_oneradio("active","0", $text{'no'}, ($st->{'active'} ? 0 : 1) ),
|
||||
"<b>$text{'edit_type'}</b>",
|
||||
( !$in{'new'} ? "<tt>$st->{'type'}</tt>" :
|
||||
( $has_inetd && $has_xinetd ? &ui_select("type", undef,[["xinetd","xinetd","selected"],["inetd","inetd",""]]) : "") )
|
||||
]);
|
||||
print ui_table_end();
|
||||
print "<br>";
|
||||
|
||||
if ($in{'new'}) {
|
||||
$ptymode = 'l';
|
||||
@@ -108,89 +89,72 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
printf "<tr> <td><input type=radio name=mode value=0 %s> %s</td>\n",
|
||||
$ptymode eq 'l' ? 'checked' : '', $text{'edit_mode0'};
|
||||
printf "<td nowrap><b>%s</b> <input name=cmd0 size=15 value='%s'>\n",
|
||||
$text{'edit_cmd'}, $ptymode eq 'l' ? $cmd : '';
|
||||
printf "<b>%s</b> <input name=args0 size=20 value='%s'></td> </tr>\n",
|
||||
$text{'edit_args'}, $ptymode eq 'l' ? $args : '';
|
||||
print &ui_table_start($text{'edit_header2'}, "width=80%", 5);
|
||||
print &ui_columns_row([
|
||||
&ui_oneradio("mode","0", $text{'edit_mode0'}, ($ptymode eq 'l' ? 1 : 0) ),
|
||||
"<b>$text{'edit_cmd'}</b>", &ui_textbox("cmd0", ( $ptymode eq 'l' ? $cmd : "" ), 20),
|
||||
"<b>$text{'edit_args'}</b>", &ui_textbox("args0", ( $ptymode eq 'l' ? $args : "" ), 20)
|
||||
]);
|
||||
print &ui_columns_row([
|
||||
&ui_oneradio("mode","1", $text{'edit_mode1'}, ($ptymode eq 'L' ? 1 : 0) ),
|
||||
"<b>$text{'edit_cmd'}</b>", &ui_textbox("cmd1", ( $ptymode eq 'L' ? $cmd : "" ), 20),
|
||||
"<b>$text{'edit_args'}</b>", &ui_textbox("args1", ( $ptymode eq 'L' ? $args : "" ), 20)
|
||||
]);
|
||||
print &ui_columns_row([
|
||||
&ui_oneradio("mode","2", $text{'edit_mode2'}, ($rport ? 1 : 0) ),
|
||||
"<b>$text{'edit_rhost'}</b>", &ui_textbox("rhost", ( !$rport ? "" : ( $rhost ? $rhost : "localhost" ) ), 20),
|
||||
"<b>$text{'edit_rport'}</b>", &ui_textbox("rport", $rport, 6)
|
||||
]);
|
||||
print ui_table_end();
|
||||
print "<br>";
|
||||
|
||||
printf "<tr> <td><input type=radio name=mode value=1 %s> %s</td>\n",
|
||||
$ptymode eq 'L' ? 'checked' : '', $text{'edit_mode1'};
|
||||
printf "<td nowrap><b>%s</b> <input name=cmd1 size=15 value='%s'>\n",
|
||||
$text{'edit_cmd'}, $ptymode eq 'L' ? $cmd : '';
|
||||
printf "<b>%s</b> <input name=args1 size=20 value='%s'></td> </tr>\n",
|
||||
$text{'edit_args'}, $ptymode eq 'L' ? $args : '';
|
||||
|
||||
printf "<tr> <td><input type=radio name=mode value=2 %s> %s</td>\n",
|
||||
$rport ? 'checked' : '', $text{'edit_mode2'};
|
||||
printf "<td nowrap><b>%s</b> <input name=rhost size=20 value='%s'>\n",
|
||||
$text{'edit_rhost'}, !$rport ? '' : $rhost ? $rhost : 'localhost';
|
||||
printf "<b>%s</b> <input name=rport size=6 value='%s'></td> </tr>\n",
|
||||
$text{'edit_rport'}, $rport;
|
||||
|
||||
print "</table></td></tr></table><br>\n";
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td><b>$text{'edit_header3'}</b></td> </tr>\n";
|
||||
print "<tr $cb> <td><table width=100%>\n";
|
||||
|
||||
print "<tr> <td><b>$text{'edit_pem'}</b></td> <td nowrap>\n";
|
||||
$haspem = $config{'pem_path'} && -r $config{'pem_path'};
|
||||
print &ui_table_start($text{'edit_header3'}, "width=80%", 2);
|
||||
if ($in{'new'}) {
|
||||
printf "<input type=radio name=pmode value=0 %s> %s\n",
|
||||
"", $text{'edit_pem0'};
|
||||
printf "<input type=radio name=pmode value=1 %s> %s\n",
|
||||
$haspem ? "" : "checked", $text{'edit_pem1'};
|
||||
printf "<input type=radio name=pmode value=2 %s> %s\n",
|
||||
$haspem ? "checked" : "", $text{'edit_pem2'};
|
||||
printf "<input name=pem size=25 value='%s'> %s</td> </tr>\n",
|
||||
$haspem ? $config{'pem_path'} : "", &file_chooser_button("pem");
|
||||
}
|
||||
else {
|
||||
local $pmode = $pem eq $webmin_pem ? 1 :
|
||||
$pem ? 2 : 0;
|
||||
printf "<input type=radio name=pmode value=0 %s> %s\n",
|
||||
$pmode == 0 ? "checked" : "", $text{'edit_pem0'};
|
||||
printf "<input type=radio name=pmode value=1 %s> %s\n",
|
||||
$pmode == 1 ? "checked" : "", $text{'edit_pem1'};
|
||||
printf "<input type=radio name=pmode value=2 %s> %s\n",
|
||||
$pmode == 2 ? "checked" : "", $text{'edit_pem2'};
|
||||
printf "<input name=pem size=25 value='%s'> %s</td> </tr>\n",
|
||||
$pmode == 2 ? $pem : "", &file_chooser_button("pem");
|
||||
}
|
||||
print &ui_columns_row([
|
||||
"<b>$text{'edit_pem'}</b>",
|
||||
&ui_oneradio("pmode","0", $text{'edit_pem0'})." ".
|
||||
&ui_oneradio("pmode","1", $text{'edit_pem1'}, ( $haspem ? 0 : 1) )." ".
|
||||
&ui_oneradio("pmode","2", $text{'edit_pem2'}, ( $haspem ? 1 : 0) )." ".
|
||||
&ui_filebox("pem", ( $haspem ? $config{'pem_path'} : "" ), 25)
|
||||
]);
|
||||
} else {
|
||||
local $pmode = $pem eq $webmin_pem ? 1 : $pem ? 2 : 0;
|
||||
print &ui_columns_row([
|
||||
"<b>$text{'edit_pem'}</b>",
|
||||
&ui_oneradio("pmode","0", $text{'edit_pem0'}, ( $pmode == 0 ? 1 : 0 ) )." ".
|
||||
&ui_oneradio("pmode","1", $text{'edit_pem1'}, ( $pmode == 1 ? 1 : 0 ) )." ".
|
||||
&ui_oneradio("pmode","2", $text{'edit_pem2'}, ( $pmode == 2 ? 1 : 0) )." ".
|
||||
&ui_filebox("pem", ( $pmode == 2 ? $pem : "" ), 25)
|
||||
]);
|
||||
}
|
||||
print &ui_columns_row([
|
||||
"<b>$text{'edit_tcpw'}</b>",
|
||||
&ui_oneradio("tcpw_def","1", $text{'edit_auto'}, ( $tcpw ? 0 : 1 ) )." ".
|
||||
&ui_oneradio("tcpw_def","0", undef, ( $tcpw ? 1 : 0 ) )." ".
|
||||
&ui_textbox("tcpw", $tcpw, 25)
|
||||
]);
|
||||
print &ui_columns_row([
|
||||
"<b>$text{'edit_cmode'}</b>",
|
||||
&ui_oneradio("cmode","0", $text{'edit_cmode0'}, ( $cmode ? 0 : 1 ) )." ".
|
||||
&ui_oneradio("cmode","1", $text{'edit_cmode1'}, ( $cmode ? 1 : 0 ) )
|
||||
]);
|
||||
print &ui_columns_row([
|
||||
"<b>$text{'edit_iface'}</b>",
|
||||
&ui_oneradio("iface_def","1", $text{'edit_auto'}, ( $iface ? 0 : 1 ) )." ".
|
||||
&ui_oneradio("iface_def","0", undef, ( $iface ? 1 : 0 ) )." ".
|
||||
&ui_textbox("iface", $iface, 25)
|
||||
]);
|
||||
print ui_table_end();
|
||||
|
||||
print "<tr> <td><b>$text{'edit_tcpw'}</b></td> <td>\n";
|
||||
printf "<input type=radio name=tcpw_def value=1 %s> %s\n",
|
||||
$tcpw ? "" : "checked", $text{'edit_auto'};
|
||||
printf "<input type=radio name=tcpw_def value=0 %s>\n",
|
||||
$tcpw ? "checked" : "";
|
||||
printf "<input name=tcpw size=15 value='%s'></td> </tr>\n", $tcpw;
|
||||
|
||||
print "<tr> <td><b>$text{'edit_cmode'}</b></td> <td>\n";
|
||||
printf "<input type=radio name=cmode value=0 %s> %s\n",
|
||||
$cmode ? "" : "checked", $text{'edit_cmode0'};
|
||||
printf "<input type=radio name=cmode value=1 %s> %s</td> </tr>\n",
|
||||
$cmode ? "checked" : "", $text{'edit_cmode1'};
|
||||
|
||||
print "<tr> <td><b>$text{'edit_iface'}</b></td> <td>\n";
|
||||
printf "<input type=radio name=iface_def value=1 %s> %s\n",
|
||||
$iface ? "" : "checked", $text{'edit_auto'};
|
||||
printf "<input type=radio name=iface_def value=0 %s>\n",
|
||||
$iface ? "checked" : "";
|
||||
printf "<input name=iface size=25 value='%s'></td> </tr>\n", $iface;
|
||||
|
||||
print "</table></td></tr></table>\n";
|
||||
print "<input type=hidden name=args value='$st->{'args'}'>\n";
|
||||
print "<table width=100%><tr>\n";
|
||||
print &ui_hidden("args",$st->{'args'});
|
||||
print "<br>";
|
||||
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";
|
||||
print &ui_submit($text{'create'});
|
||||
} else {
|
||||
print &ui_submit($text{'save'})." ".&ui_submit($text{'delete'},"delete");
|
||||
}
|
||||
print &ui_form_end();
|
||||
|
||||
&ui_print_footer("", $text{'index_return'});
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ $ver = &get_stunnel_version(\$out);
|
||||
# }
|
||||
|
||||
# List all tunnels currently setup in inetd
|
||||
$hasconfig = 1;
|
||||
@tunnels = &list_stunnels();
|
||||
@links = ( &select_all_link("d"),
|
||||
&select_invert_link("d"),
|
||||
@@ -118,22 +119,24 @@ if (@tunnels) {
|
||||
else {
|
||||
print "<b>$text{'index_none'}</b><p>\n";
|
||||
print &ui_links_row([ $links[2] ]);
|
||||
$hasconfig = 0;
|
||||
}
|
||||
|
||||
print &ui_hr();
|
||||
print "<table width=100%><tr>\n";
|
||||
print "<form action=apply.cgi>\n";
|
||||
print "<td><input type=submit value='$text{'index_apply'}'></td>\n";
|
||||
if ($has_inetd && $has_xinetd) {
|
||||
print "<td>$text{'index_applymsg1'}</td>\n";
|
||||
}
|
||||
elsif ($has_inetd) {
|
||||
print "<td>$text{'index_applymsg2'}</td>\n";
|
||||
}
|
||||
else {
|
||||
print "<td>$text{'index_applymsg3'}</td>\n";
|
||||
}
|
||||
print "</form></tr></table>\n";
|
||||
if ( $hasconfig ) {
|
||||
my $xmsg = "";
|
||||
if ($has_inetd && $has_xinetd) {
|
||||
$xmsg .= $text{'index_applymsg1'};
|
||||
} elsif ($has_inetd) {
|
||||
$xmsg .= $text{'index_applymsg2'};
|
||||
} else {
|
||||
$xmsg .= $text{'index_applymsg3'};
|
||||
}
|
||||
print &ui_hr();
|
||||
print &ui_buttons_start();
|
||||
print &ui_buttons_row("apply.cgi",
|
||||
$text{'index_apply'}, $xmsg);
|
||||
print &ui_buttons_end();
|
||||
}
|
||||
|
||||
&ui_print_footer("/", $text{'index'});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user