diff --git a/mailbox/system_info.pl b/mailbox/system_info.pl index 24301af3..0ab25c0b 100644 --- a/mailbox/system_info.pl +++ b/mailbox/system_info.pl @@ -13,32 +13,50 @@ sub list_system_info my @table; my $table = { 'type' => 'table', 'desc' => $text{'right_header'}, - 'priority' => 10, + 'priority' => 10, 'table' => \@table }; +my $can_type = sub { + my ($type) = @_; + return 1 if (!defined($gconfig{'ui_show'})); + return 1 if ($gconfig{'ui_show'} =~ /\b$type\b/); + return 0; + }; + # Hostname -push(@table, { 'desc' => $text{'right_host'}, - 'value' => &get_display_hostname() }); +if ($can_type->('host')) { + push(@table, { 'desc' => $text{'right_host'}, + 'value' => &get_display_hostname(), + 'type' => 'hostname' }); + } # Operating system -push(@table, { 'desc' => $text{'right_os'}, - 'value' => $gconfig{'os_version'} eq '*' ? - $gconfig{'real_os_type'} : - $gconfig{'real_os_type'}.' '.$gconfig{'real_os_version'} - }); +if ($can_type->('os')) { + push(@table, { 'desc' => $text{'right_os'}, + 'value' => $gconfig{'os_version'} eq '*' ? + $gconfig{'real_os_type'} : + $gconfig{'real_os_type'}.' '.$gconfig{'real_os_version'}, + 'type' => 'os' }); + } # Usermin version -push(@table, { 'desc' => $text{'right_usermin'}, - 'value' => &get_webmin_version() }); +if ($can_type->('ver')) { + push(@table, { 'desc' => $text{'right_usermin'}, + 'value' => &get_webmin_version(), + 'type' => 'version' }); + } # System time -my $tm = localtime(time()); -eval "use DateTime; use DateTime::Locale; use DateTime::TimeZone;"; -if (!$@) { - $tm = make_date(time(), {get => 'complete'}); +if ($can_type->('time')) { + my $tm = localtime(time()); + eval "use DateTime; use DateTime::Locale; use DateTime::TimeZone;"; + if (!$@) { + $tm = make_date(time(), { get => 'complete' }); + } + push(@table, { 'desc' => $text{'right_time'}, + 'value' => $tm, + 'type' => 'time' }); } -push(@table, { 'desc' => $text{'right_time'}, - 'value' => $tm }); return ($table); } diff --git a/mailbox/ulang/de b/mailbox/ulang/de index aca41ff9..71680681 100644 --- a/mailbox/ulang/de +++ b/mailbox/ulang/de @@ -259,5 +259,5 @@ allow_eaddr='$1' ist keine gültige Mail-Adresse right_header=System Information right_host=System Hostname right_os=Betriebssystem -right_usermin=Usermin Version +right_usermin=Usermin version right_time=Systemzeit diff --git a/mailbox/ulang/en b/mailbox/ulang/en index eb747f6d..48689627 100644 --- a/mailbox/ulang/en +++ b/mailbox/ulang/en @@ -287,5 +287,5 @@ allow_eaddr='$1' is not a valid email address right_header=System Information right_host=System hostname right_os=Operating system -right_usermin=Usermin Version +right_usermin=Usermin version right_time=Time on system diff --git a/mailbox/ulang/ms.auto b/mailbox/ulang/ms.auto index 78ff0edd..57a47ee8 100644 --- a/mailbox/ulang/ms.auto +++ b/mailbox/ulang/ms.auto @@ -260,5 +260,5 @@ allow_eaddr='$1' bukan alamat e-mel yang sah right_header=Maklumat sistem right_host=Nama hos sistem right_os=Sistem operasi -right_usermin=Usermin Version +right_usermin=Usermin version right_time=Masa pada sistem