mirror of
https://github.com/webmin/webmin.git
synced 2026-02-07 16:02:14 +00:00
Compare commits
13 Commits
dev/patch-
...
dev/preser
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77e809166c | ||
|
|
82f5284ffc | ||
|
|
4b66ac0be5 | ||
|
|
e69fb75c8e | ||
|
|
ff8781c112 | ||
|
|
0dd75db8d8 | ||
|
|
05d01aeef3 | ||
|
|
11f2bc20eb | ||
|
|
52c3178b92 | ||
|
|
e3dec2222d | ||
|
|
05752faec0 | ||
|
|
1cf3813fb6 | ||
|
|
1216ae709b |
@@ -17,7 +17,6 @@ $access{'defaults'} || &error($text{'trusted_ecannot'});
|
|||||||
my $conf = &get_config();
|
my $conf = &get_config();
|
||||||
my $options = &find("options", $conf);
|
my $options = &find("options", $conf);
|
||||||
my $mems = $options->{'members'};
|
my $mems = $options->{'members'};
|
||||||
my @dlv = &find("dnssec-lookaside", $mems);
|
|
||||||
my $tkeys = &find("trusted-keys", $conf);
|
my $tkeys = &find("trusted-keys", $conf);
|
||||||
$tkeys ||= { 'members' => [ ] };
|
$tkeys ||= { 'members' => [ ] };
|
||||||
|
|
||||||
@@ -38,33 +37,6 @@ if (&supports_dnssec_client() == 2) {
|
|||||||
$text{'default'}, undef);
|
$text{'default'}, undef);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Trusted DLVs (obsolete)
|
|
||||||
if (@dlv) {
|
|
||||||
my @dtable = ( );
|
|
||||||
my $i = 0;
|
|
||||||
foreach my $d (@dlv, { 'values' => [ '.' ] }) {
|
|
||||||
my $dlv = $d->{'values'}->[0];
|
|
||||||
$dlv = "" if ($dlv eq ".");
|
|
||||||
push(@dtable, [
|
|
||||||
&ui_opt_textbox("anchor_$i", $d->{'values'}->[2],
|
|
||||||
30, $text{'trusted_none'}),
|
|
||||||
&ui_opt_textbox("dlv_$i", $dlv, 20,
|
|
||||||
$text{'trusted_root'}) ]);
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
print &ui_table_row($text{'trusted_dlvs'},
|
|
||||||
&ui_radio("dlv_auto",
|
|
||||||
@dlv == 0 ? 2 :
|
|
||||||
@dlv == 1 && $dlv[0]->{'values'}->[0] eq 'auto' ? 1 : 0,
|
|
||||||
[ [ 1, $text{'trusted_dlvs1'} ],
|
|
||||||
[ 2, $text{'trusted_dlvs2'} ],
|
|
||||||
[ 0, $text{'trusted_dlvs0'} ] ])."<br>\n".
|
|
||||||
&ui_columns_table([ $text{'trusted_anchor'},
|
|
||||||
$text{'trusted_dlv'} ],
|
|
||||||
undef,
|
|
||||||
\@dtable), 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
# Trusted keys
|
# Trusted keys
|
||||||
if (@{$tkeys->{'members'}}) {
|
if (@{$tkeys->{'members'}}) {
|
||||||
my @ktable = ( );
|
my @ktable = ( );
|
||||||
|
|||||||
@@ -24,46 +24,6 @@ if (&supports_dnssec_client() == 2) {
|
|||||||
&save_choice("dnssec-validation", $options, 1);
|
&save_choice("dnssec-validation", $options, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Save DLV zones
|
|
||||||
if (defined($in{'dlv_auto'})) {
|
|
||||||
my @dlvs = ( );
|
|
||||||
if ($in{'dlv_auto'} == 1) {
|
|
||||||
# Automatic mode
|
|
||||||
push(@dlvs, { 'name' => 'dnssec-lookaside',
|
|
||||||
'values' => [ 'auto' ] });
|
|
||||||
}
|
|
||||||
elsif ($in{'dlv_auto'} == 0) {
|
|
||||||
# Listed zones
|
|
||||||
my $dlv;
|
|
||||||
for(my $i=0; defined($in{"anchor_$i"}); $i++) {
|
|
||||||
if (!$in{"anchor_${i}_def"}) {
|
|
||||||
$in{"anchor_$i"} =~ /^[a-z0-9\.\-\_]+$/ ||
|
|
||||||
&error(&text('trusted_eanchor', $i+1));
|
|
||||||
$in{"anchor_$i"} .= "."
|
|
||||||
if ($in{"anchor_$i"} !~ /\.$/);
|
|
||||||
if ($in{"dlv_${i}_def"}) {
|
|
||||||
$dlv = ".";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$in{"dlv_$i"} =~ /^[a-z0-9\.\-\_]+$/ ||
|
|
||||||
&error(&text('trusted_edlv', $i+1));
|
|
||||||
$dlv = $in{"dlv_$i"};
|
|
||||||
$dlv .= "." if ($dlv !~ /\.$/);
|
|
||||||
}
|
|
||||||
push(@dlvs, { 'name' => 'dnssec-lookaside',
|
|
||||||
'values' => [
|
|
||||||
$dlv, "trust-anchor",
|
|
||||||
$in{"anchor_$i"} ] });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elsif ($in{'dlv_auto'} == 2) {
|
|
||||||
# None
|
|
||||||
@dlvs = ( );
|
|
||||||
}
|
|
||||||
&save_directive($options, "dnssec-lookaside", \@dlvs, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
# Save trusted keys
|
# Save trusted keys
|
||||||
if (defined($in{'zone_0'})) {
|
if (defined($in{'zone_0'})) {
|
||||||
my @keys = ( );
|
my @keys = ( );
|
||||||
|
|||||||
@@ -391,6 +391,17 @@ foreach my $m (@{$section->{'members'}}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# delete_section(&conf, §ion)
|
||||||
|
# Remove a section and all it's members from the config file
|
||||||
|
sub delete_section
|
||||||
|
{
|
||||||
|
my ($conf, $section) = @_;
|
||||||
|
my $lref = &read_file_lines($section->{'file'});
|
||||||
|
my $len = $section->{'eline'} - $section->{'line'} + 1;
|
||||||
|
splice(@$lref, $section->{'line'}, $len);
|
||||||
|
&renumber($conf, $section->{'line'}, $section->{'file'}, -$len);
|
||||||
|
}
|
||||||
|
|
||||||
# renumber(&conf, line, file, offset)
|
# renumber(&conf, line, file, offset)
|
||||||
sub renumber
|
sub renumber
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -512,6 +512,7 @@ mail_forward=Forward
|
|||||||
mail_rfc=From line
|
mail_rfc=From line
|
||||||
mail_move=Move to:
|
mail_move=Move to:
|
||||||
mail_eexists=Message no longer exists!
|
mail_eexists=Message no longer exists!
|
||||||
|
mail_qfile=Mail queue file
|
||||||
|
|
||||||
view_title=Read Email
|
view_title=Read Email
|
||||||
view_desc=Message $1 in $2
|
view_desc=Message $1 in $2
|
||||||
|
|||||||
@@ -1504,6 +1504,7 @@ $mail->{'headers'} = \@headers;
|
|||||||
foreach $h (@headers) {
|
foreach $h (@headers) {
|
||||||
$mail->{'header'}->{lc($h->[0])} = $h->[1];
|
$mail->{'header'}->{lc($h->[0])} = $h->[1];
|
||||||
}
|
}
|
||||||
|
$mail->{'file'} = $file;
|
||||||
return $mail;
|
return $mail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,10 @@ if ($in{'headers'}) {
|
|||||||
}
|
}
|
||||||
foreach $h (@{$mail->{'headers'}}) {
|
foreach $h (@{$mail->{'headers'}}) {
|
||||||
print &ui_table_row($h->[0],
|
print &ui_table_row($h->[0],
|
||||||
&html_escape(&decode_mimewords($h->[1])));
|
&html_escape(&decode_mimewords($h->[1])), 1, [ "nowrap" ]);
|
||||||
}
|
}
|
||||||
|
print &ui_table_row($text{'mail_qfile'},
|
||||||
|
"<tt>".&html_escape($mail->{'file'})."</tt>");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Just show the most useful headers
|
# Just show the most useful headers
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ if ($in{'headers'}) {
|
|||||||
}
|
}
|
||||||
foreach $h (@{$mail->{'headers'}}) {
|
foreach $h (@{$mail->{'headers'}}) {
|
||||||
print &ui_table_row($h->[0],
|
print &ui_table_row($h->[0],
|
||||||
&html_escape(&decode_mimewords($h->[1])));
|
&html_escape(&decode_mimewords($h->[1])), 1, [ "nowrap" ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ if (&foreign_installed("package-updates") && $config{'collect_pkgs'}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# CPU and drive temps
|
# CPU and drive temps
|
||||||
if (!$config{'collect_notemp'} && defined(&proc::get_current_cpu_data)) {
|
if (!$config{'collect_notemp2'} && defined(&proc::get_current_cpu_data)) {
|
||||||
my ($cpu, $fans) = &proc::get_current_cpu_data();
|
my ($cpu, $fans) = &proc::get_current_cpu_data();
|
||||||
$info->{'cputemps'} = $cpu if (ref($cpu) && @{$cpu} >= 1);
|
$info->{'cputemps'} = $cpu if (ref($cpu) && @{$cpu} >= 1);
|
||||||
$info->{'cpufans'} = $fans if (ref($fans) && @{$fans} >= 1);
|
$info->{'cpufans'} = $fans if (ref($fans) && @{$fans} >= 1);
|
||||||
|
|||||||
@@ -10676,6 +10676,16 @@ elsif (defined($main::open_tempfiles{$_[0]})) {
|
|||||||
# Closing a file
|
# Closing a file
|
||||||
my $noerror = $main::open_tempfiles_noerror{$_[0]};
|
my $noerror = $main::open_tempfiles_noerror{$_[0]};
|
||||||
&webmin_debug_log("CLOSE", $_[0]) if ($gconfig{'debug_what_write'});
|
&webmin_debug_log("CLOSE", $_[0]) if ($gconfig{'debug_what_write'});
|
||||||
|
my $getfacl = &has_command("getfacl");
|
||||||
|
my $setfacl = &has_command("setfacl");
|
||||||
|
my $file_acls;
|
||||||
|
if ($getfacl && $setfacl) {
|
||||||
|
# Set original ACLs
|
||||||
|
my $qaclfile = quotemeta($_[0]);
|
||||||
|
$file_acls = &backquote_command(
|
||||||
|
"$getfacl --absolute-names $qaclfile 2>/dev/null");
|
||||||
|
}
|
||||||
|
# Get status info for a file
|
||||||
my @st = stat($_[0]);
|
my @st = stat($_[0]);
|
||||||
if (&is_selinux_enabled() && &has_command("chcon")) {
|
if (&is_selinux_enabled() && &has_command("chcon")) {
|
||||||
# Set original security context
|
# Set original security context
|
||||||
@@ -10697,6 +10707,12 @@ elsif (defined($main::open_tempfiles{$_[0]})) {
|
|||||||
chmod($st[2], $_[0]);
|
chmod($st[2], $_[0]);
|
||||||
chown($st[4], $st[5], $_[0]);
|
chown($st[4], $st[5], $_[0]);
|
||||||
}
|
}
|
||||||
|
if ($file_acls) {
|
||||||
|
# Set original ACLs
|
||||||
|
open(my $pipe, '|-', "$setfacl --restore=-");
|
||||||
|
print($pipe $file_acls);
|
||||||
|
close($pipe);
|
||||||
|
}
|
||||||
&reset_file_attributes($_[0], \@old_attributes);
|
&reset_file_attributes($_[0], \@old_attributes);
|
||||||
delete($main::open_tempfiles{$_[0]});
|
delete($main::open_tempfiles{$_[0]});
|
||||||
delete($main::open_tempfiles_noerror{$_[0]});
|
delete($main::open_tempfiles_noerror{$_[0]});
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ else {
|
|||||||
|
|
||||||
# Save collection options
|
# Save collection options
|
||||||
$system_status::config{'collect_pkgs'} = $in{'pkgs'};
|
$system_status::config{'collect_pkgs'} = $in{'pkgs'};
|
||||||
|
$system_status::config{'collect_notemp2'} = !$in{'temp2'};
|
||||||
$system_status::config{'collect_notemp'} = !$in{'temp'};
|
$system_status::config{'collect_notemp'} = !$in{'temp'};
|
||||||
$system_status::config{'collect_units'} = $in{'units'};
|
$system_status::config{'collect_units'} = $in{'units'};
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ print &ui_table_row($text{'status_interval'},
|
|||||||
print &ui_table_row($text{'status_pkgs'},
|
print &ui_table_row($text{'status_pkgs'},
|
||||||
&ui_yesno_radio("pkgs", $system_status::config{'collect_pkgs'}));
|
&ui_yesno_radio("pkgs", $system_status::config{'collect_pkgs'}));
|
||||||
|
|
||||||
|
# Collect CPU temerature?
|
||||||
|
print &ui_table_row($text{'status_temp2'},
|
||||||
|
&ui_yesno_radio("temp2", !$system_status::config{'collect_notemp2'}));
|
||||||
|
|
||||||
# Collect drive temps?
|
# Collect drive temps?
|
||||||
print &ui_table_row($text{'status_temp'},
|
print &ui_table_row($text{'status_temp'},
|
||||||
&ui_yesno_radio("temp", !$system_status::config{'collect_notemp'}));
|
&ui_yesno_radio("temp", !$system_status::config{'collect_notemp'}));
|
||||||
|
|||||||
@@ -1061,6 +1061,7 @@ status_interval0=Every
|
|||||||
status_mins=minutes
|
status_mins=minutes
|
||||||
status_pkgs=Collect available package updates?
|
status_pkgs=Collect available package updates?
|
||||||
status_temp=Collect drive temperatures?
|
status_temp=Collect drive temperatures?
|
||||||
|
status_temp2=Collect CPU temperatures and fans speed?
|
||||||
status_units=Units for temperatures
|
status_units=Units for temperatures
|
||||||
status_celsius=Celsius
|
status_celsius=Celsius
|
||||||
status_fahrenheit=Fahrenheit
|
status_fahrenheit=Fahrenheit
|
||||||
|
|||||||
Reference in New Issue
Block a user