From eb2cd4e14221cc2ac41dabdbd233e2dd4c6140c7 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sun, 20 Oct 2024 16:16:38 +0300 Subject: [PATCH] Fix to display more accurate heading --- useradmin/lang/en | 3 ++- useradmin/list_logins.cgi | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/useradmin/lang/en b/useradmin/lang/en index 050b15aa4..9a1d11500 100644 --- a/useradmin/lang/en +++ b/useradmin/lang/en @@ -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 diff --git a/useradmin/list_logins.cgi b/useradmin/list_logins.cgi index b6e6585e3..9c6eaf651 100755 --- a/useradmin/list_logins.cgi +++ b/useradmin/list_logins.cgi @@ -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'},