Fix to display more accurate heading

This commit is contained in:
Ilia Ross
2024-10-20 16:16:38 +03:00
parent 21e110cc8a
commit eb2cd4e142
2 changed files with 13 additions and 2 deletions

View File

@ -233,7 +233,8 @@ usave_efromroot=You cannot move the home directory from /
usave_etoroot=You cannot move the home directory to /
logins_title=Recorded Logins
logins_head=Recorded logins for $1
logins_head=All recorded logins for user $1
logins_head_limit=The last $2 recorded logins for user $1
logins_from=Login From
logins_tty=TTY
logins_in=Login At

View File

@ -42,7 +42,17 @@ foreach $l (&list_last_logins($u, $config{'last_count'})) {
# Show the table
if ($u) {
print &ui_subheading(&text('logins_head', &html_escape($u)));
my $last_login_max = $config{'last_count'};
# Sanity check
if (defined($last_login_max) && $last_login_max <= 0) {
undef($last_login_max);
}
my $last_login_label =
$last_login_max ? 'logins_head_limit' : 'logins_head';
print &ui_subheading(
&text($last_login_label,
&html_escape($u),
&html_escape($last_login_max)));
}
print &ui_columns_table(
[ $u ? ( ) : ( $text{'user'} ), $text{'logins_from'},