From: Thomas Heck Date: Tue, 7 Aug 2012 11:41:27 +0000 (+0200) Subject: Administrationsoberflaeche: aktive User anzeigen X-Git-Tag: release-3.0.0beta1~297^2~10 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=021186829cbe21aa951a0f561ff16daa63f836ea;p=kivitendo-erp.git Administrationsoberflaeche: aktive User anzeigen implementiert #1853 --- diff --git a/SL/Auth.pm b/SL/Auth.pm index 6652aed4b..4c50ddf0b 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -424,15 +424,30 @@ sub read_all_users { my $self = shift; my $dbh = $self->dbconnect(); - my $query = qq|SELECT u.id, u.login, cfg.cfg_key, cfg.cfg_value - FROM auth.user_config cfg - LEFT JOIN auth."user" u ON (cfg.user_id = u.id)|; + my $query = qq|SELECT u.id, u.login, cfg.cfg_key, cfg.cfg_value, s.mtime AS last_action + + FROM auth."user" AS u + + LEFT JOIN auth.user_config AS cfg + ON (cfg.user_id = u.id) + + LEFT JOIN auth.session_content AS sc_login + ON (sc_login.sess_key = 'login' AND sc_login.sess_value = ('--- ' \|\| u.login \|\| '\n')) + + LEFT JOIN auth.session AS s + ON (s.id = sc_login.session_id) + |; my $sth = prepare_execute_query($main::form, $dbh, $query); my %users; while (my $ref = $sth->fetchrow_hashref()) { - $users{$ref->{login}} ||= { 'login' => $ref->{login}, 'id' => $ref->{id} }; + + $users{$ref->{login}} ||= { + 'login' => $ref->{login}, + 'id' => $ref->{id}, + 'last_action' => $ref->{last_action}, + }; $users{$ref->{login}}->{$ref->{cfg_key}} = $ref->{cfg_value} if (($ref->{cfg_key} ne 'login') && ($ref->{cfg_key} ne 'id')); } diff --git a/locale/de/all b/locale/de/all index 224cdfac5..ace39bea5 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1051,6 +1051,7 @@ $self->{texts} = { 'Language missing!' => 'Sprache fehlt!', 'Language saved!' => 'Sprache gespeichert!', 'Languages' => 'Sprachen', + 'Last Action' => 'Letzte Aktivität', 'Last Article Number' => 'Letzte Artikelnummer', 'Last Cost' => 'Einkaufspreis', 'Last Credit Note Number' => 'Letzte Gutschriftnummer', @@ -2281,6 +2282,7 @@ $self->{texts} = { 'not configured' => 'nicht konfiguriert', 'not delivered' => 'nicht geliefert', 'not executed' => 'nicht ausgeführt', + 'not logged in' => 'nicht eingeloggt', 'not transferred in yet' => 'noch nicht eingelagert', 'not transferred out yet' => 'noch nicht ausgelagert', 'not yet executed' => 'Noch nicht ausgeführt', diff --git a/templates/webpages/admin/list_users.html b/templates/webpages/admin/list_users.html index 2c625da60..c1789a645 100644 --- a/templates/webpages/admin/list_users.html +++ b/templates/webpages/admin/list_users.html @@ -16,6 +16,7 @@ [% 'Language' | $T8 %] [% 'Dataset' | $T8 %] [% 'Host' | $T8 %] + [% 'Last Action' | $T8 %] @@ -29,6 +30,12 @@  [% HTML.escape(row.countrycode) %]  [% HTML.escape(row.dbname) %]  [% IF row.dbhost %][% HTML.escape(row.dbhost) %][% ELSE %]localhost[% END %] +   + [% IF( row.last_action ) %] + [% HTML.escape(row.last_action) %] + [% ELSE %] + [% 'not logged in' | $T8 %] + [% END %] [% END %]