| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/home/SERVERWEB/webmin-2.105/iscsi-target/ |
Upload File : |
#!/usr/bin/perl
# Display an allowed target and IP list
use strict;
use warnings;
no warnings 'redefine';
no warnings 'uninitialized';
require './iscsi-target-lib.pl';
our (%text, %in);
&ReadParse();
my $allow = &get_allow_config($in{'mode'});
my $conf = &get_iscsi_config();
my @targets = &find($conf, "Target");
if ($in{'new'}) {
&ui_print_header(undef, $text{$in{'mode'}.'_title1'}, "");
$a = { 'addrs' => [ ] };
}
else {
&ui_print_header(undef, $text{$in{'mode'}.'_title2'}, "");
$a = $allow->[$in{'idx'}];
$a || &error($text{'allow_egone'});
}
print &ui_form_start("save_allow.cgi", "post");
print &ui_hidden("mode", $in{'mode'});
print &ui_hidden("new", $in{'new'});
print &ui_hidden("idx", $in{'idx'});
print &ui_table_start($text{$in{'mode'}.'_header'}, undef, 2);
# Target name
print &ui_table_row($text{'allow_target'},
&ui_select("name", $a->{'name'},
[ [ "ALL", "<".$text{'allow_all1'}.">" ],
map { $_->{'value'} } @targets ],
1, 0, !$in{'new'}));
# Allowed IPs (can be v6 or networks)
my $all = $a->{'addrs'}->[0] eq 'ALL' ? 1 : 0;
print &ui_table_row($text{$in{'mode'}.'_ips'},
&ui_radio("addrs_def", $all,
[ [ 1, $text{'allow_all2'} ],
[ 0, $text{'allow_below'} ] ])."<br>\n".
&ui_textarea("addrs", $all ? "" : join("\n", @{$a->{'addrs'}}), 5, 60));
print &ui_table_end();
if ($in{'new'}) {
print &ui_form_end([ [ undef, $text{'create'} ] ]);
}
else {
print &ui_form_end([ [ undef, $text{'save'} ],
[ 'delete', $text{'delete'} ] ]);
}
&ui_print_footer("list_allow.cgi?mode=$in{'mode'}", $text{'allow_return'});