HEX
Server: Apache/2.4.61 (Ubuntu)
System: Linux hosting106 7.0.12-1-pve #1 SMP PREEMPT_DYNAMIC PMX 7.0.12-1 (2026-06-09T21:07Z) x86_64
User: clinicadentalargarate.com (1193)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/webmin/nftables/acl_security.pl
use strict;
use warnings;
no warnings 'redefine';
no warnings 'uninitialized';

require 'nftables-lib.pl';
our (%in, %text);

# acl_security_form(&options)
# Output HTML for editing security options for the nftables module
sub acl_security_form
{
my ($o) = @_;

my $mode =
      $o->{'tables'} eq '*' ? 1
    : $o->{'tables'} =~ /^\!/ ? 2
    : 0;
my @selected = split(/\s+/, $o->{'tables'} || '');
shift(@selected) if ($mode == 2 && @selected && $selected[0] eq '!');
my @table_opts = acl_table_options();

print ui_table_row(
	$text{'acl_tables'},
	ui_radio(
		"tables_def",
		$mode,
		[ [1, $text{'acl_tables_all'}],
		  [0, $text{'acl_tables_sel'}],
		  [2, $text{'acl_tables_nsel'}] ]
	    ).
	    "<br>\n".
	    ui_select("tables", \@selected, \@table_opts, 6, 1),
	3
);

foreach my $a (
	qw(view active create setup chains sets rules raw delete
	   apply bootup import clear quick manual)
    )
{
	print ui_table_row($text{'acl_'.$a}, ui_yesno_radio($a, $o->{$a}));
	}
}

# acl_security_save(&options)
# Parse the form for security options for the nftables module
sub acl_security_save
{
if ($in{'tables_def'} == 1) {
	$_[0]->{'tables'} = '*';
	}
elsif ($in{'tables_def'} == 2) {
	$_[0]->{'tables'} = join(" ", "!", split(/\0/, $in{'tables'}));
	}
else {
	$_[0]->{'tables'} = join(" ", split(/\0/, $in{'tables'}));
	}
foreach my $a (
	qw(view active create setup chains sets rules raw delete
	   apply bootup import clear quick manual)
    )
{
	$_[0]->{$a} = $in{$a} || 0;
	}
}

# acl_table_options()
# Returns saved and active table choices for the ACL editor
sub acl_table_options
{
my %seen;
my @opts;
foreach my $t (get_nftables_save()) {
	push(@opts, [table_acl_name($t), nft_table_spec($t)]);
	$seen{table_acl_name($t)} = 1;
	}
my ($active, $err) = get_active_nftables_save();
if (!$err) {
	foreach my $t (@$active) {
		next if ($seen{table_acl_name($t)}++);
		push(
			@opts,
			[ table_acl_name($t),
			  nft_table_spec($t)." ($text{'active_title'})" ]
		);
		}
	}
return sort { $a->[1] cmp $b->[1] } @opts;
}