Remove size option in Authentic as it's pointless, resize does it all

This commit is contained in:
iliajie
2023-01-21 17:06:31 +02:00
parent 8588c96650
commit ca971b720d
2 changed files with 28 additions and 2 deletions

View File

@@ -56,8 +56,9 @@ $conf_rows_n = int($conf_rows_n);
my $env_cols = $conf_cols_n || $def_cols_n;
my $env_rows = $conf_rows_n || $def_rows_n;
# Set columns and rows environment vars only in fixed mode
if ($conf_cols_n && $conf_rows_n) {
# Set columns and rows environment vars only
# in fixed mode, and only for old themes
if ($conf_cols_n && $conf_rows_n && !$xmlhr) {
$ENV{'COLUMNS'} = $conf_cols_n;
$ENV{'LINES'} = $conf_rows_n;
}

View File

@@ -6,4 +6,29 @@ use WebminCore;
our %access = &get_module_acl();
do "$module_root_directory/websockets-lib-funcs.pl";
# config_pre_load(mod-info-ref, [mod-order-ref])
# Check if some config options are conditional,
# and if not allowed, remove them from listing
sub config_pre_load
{
my ($modconf_info, $modconf_order) = @_;
if ($ENV{'HTTP_X_REQUESTED_WITH'} eq "XMLHttpRequest") {
# Process forbidden keys
my @forbidden_keys;
# Size is not supported in Authentic, because resize works flawlessly and
# making it work would just add addition complexity for no good reason
push(@forbidden_keys, 'size');
# Remove forbidden from display
foreach my $fkey (@forbidden_keys) {
delete($modconf_info->{$fkey});
@{$modconf_order} = grep { $_ ne $fkey } @{$modconf_order}
if ($modconf_order);
}
}
}
1;