mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Show logged out users, and update columns in the UI
This commit is contained in:
@@ -338,13 +338,18 @@ unix_header=Unix user authentication settings
|
||||
unix_utable=Allowed Unix users
|
||||
|
||||
sessions_title=Current Login Sessions
|
||||
sessions_desc=Current Webmin session logins are listed below. To cancel an existing session and force the user to login again, click on its session ID.
|
||||
sessions_id=Session ID
|
||||
sessions_user=Webmin user
|
||||
sessions_login=Logged in at
|
||||
sessions_host=IP address
|
||||
sessions_lview=View logs..
|
||||
sessions_actions=Actions..
|
||||
sessions_logouts=Also show logged-out sessions..
|
||||
sessions_state=State
|
||||
sessions_this=This login
|
||||
sessions_in=Logged in
|
||||
sessions_out=Logged out
|
||||
sessions_kill=Disconnect..
|
||||
|
||||
hide_title=Hide Unused Modules
|
||||
hide_desc=The following modules will be removed from the module access list for $1 as their corresponding servers are not installed on your system ..
|
||||
|
||||
@@ -8,6 +8,7 @@ require './acl-lib.pl';
|
||||
our (%in, %text, %config, %access, %sessiondb);
|
||||
$access{'sessions'} || &error($text{'sessions_ecannot'});
|
||||
&ui_print_header(undef, $text{'sessions_title'}, "");
|
||||
&ReadParse();
|
||||
|
||||
my %miniserv;
|
||||
&get_miniserv_config(\%miniserv);
|
||||
@@ -21,11 +22,11 @@ foreach my $u (&list_users()) {
|
||||
|
||||
my $haslog = &foreign_available("webminlog");
|
||||
|
||||
print "<b>$text{'sessions_desc'}</b><p>\n";
|
||||
print &ui_columns_start([ $text{'sessions_id'},
|
||||
$text{'sessions_state'},
|
||||
$text{'sessions_user'},
|
||||
$text{'sessions_host'},
|
||||
$haslog ? ( $text{'sessions_login'} ) : ( ),
|
||||
$text{'sessions_login'},
|
||||
$text{'sessions_actions'},
|
||||
], 100);
|
||||
foreach my $k (sort { my @a = split(/\s+/, $sessiondb{$a});
|
||||
@@ -33,16 +34,26 @@ foreach my $k (sort { my @a = split(/\s+/, $sessiondb{$a});
|
||||
keys %sessiondb) {
|
||||
next if ($k =~ /^1111111/);
|
||||
my ($user, $ltime, $lip) = split(/\s+/, $sessiondb{$k});
|
||||
next if ($user =~ /^\!/ && !$in{'logouts'});
|
||||
next if ($miniserv{'logouttime'} &&
|
||||
$time_now - $ltime > $miniserv{'logouttime'}*60);
|
||||
my @cols;
|
||||
my $candel = 0;
|
||||
if ($k eq $main::session_id ||
|
||||
$k eq &hash_session_id($main::session_id)) {
|
||||
# Cannot self-terminate
|
||||
push(@cols, "<b>$k</b>");
|
||||
push(@cols, "<b><tt>$k</tt></b>");
|
||||
push(@cols, $text{'sessions_this'});
|
||||
}
|
||||
elsif ($user =~ s/^\!//) {
|
||||
# Already logged out
|
||||
push(@cols, "<tt>$k</tt>");
|
||||
push(@cols, $text{'sessions_out'});
|
||||
}
|
||||
else {
|
||||
push(@cols, ui_link("delete_session.cgi?id=$k", $k));
|
||||
push(@cols, "<tt>$k</tt>");
|
||||
push(@cols, $text{'sessions_in'});
|
||||
$candel = 1;
|
||||
}
|
||||
if ($hasuser{$user}) {
|
||||
push(@cols, ui_link("edit_user.cgi?user=$user", $user));
|
||||
@@ -55,12 +66,21 @@ foreach my $k (sort { my @a = split(/\s+/, $sessiondb{$a});
|
||||
}
|
||||
push(@cols, $lip);
|
||||
push(@cols, &make_date($ltime));
|
||||
my @links;
|
||||
if ($haslog) {
|
||||
push(@cols, ui_link("../webminlog/search.cgi?uall=1&mall=1&tall=1&wall=1&fall=1&sid=$k", $text{'sessions_lview'}));
|
||||
push(@links, ui_link("../webminlog/search.cgi?uall=1&mall=1&tall=1&wall=1&fall=1&sid=$k", $text{'sessions_lview'}));
|
||||
}
|
||||
if ($candel) {
|
||||
push(@links, ui_link("delete_session.cgi?id=$k", $text{'sessions_kill'}));
|
||||
}
|
||||
push(@cols, ui_links_row(\@links));
|
||||
print &ui_columns_row(\@cols);
|
||||
}
|
||||
print &ui_columns_end();
|
||||
if (!$in{'logouts'}) {
|
||||
print &ui_link("list_sessions.cgi?logouts=1",
|
||||
$text{'sessions_logouts'}),"<p>\n";
|
||||
}
|
||||
|
||||
&ui_print_footer("", $text{'index_return'});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user