Revision 02118682
Von Thomas Heck vor mehr als 12 Jahren hinzugefügt
SL/Auth.pm | ||
---|---|---|
424 | 424 |
my $self = shift; |
425 | 425 |
|
426 | 426 |
my $dbh = $self->dbconnect(); |
427 |
my $query = qq|SELECT u.id, u.login, cfg.cfg_key, cfg.cfg_value |
|
428 |
FROM auth.user_config cfg |
|
429 |
LEFT JOIN auth."user" u ON (cfg.user_id = u.id)|; |
|
427 |
my $query = qq|SELECT u.id, u.login, cfg.cfg_key, cfg.cfg_value, s.mtime AS last_action |
|
428 |
|
|
429 |
FROM auth."user" AS u |
|
430 |
|
|
431 |
LEFT JOIN auth.user_config AS cfg |
|
432 |
ON (cfg.user_id = u.id) |
|
433 |
|
|
434 |
LEFT JOIN auth.session_content AS sc_login |
|
435 |
ON (sc_login.sess_key = 'login' AND sc_login.sess_value = ('--- ' \|\| u.login \|\| '\n')) |
|
436 |
|
|
437 |
LEFT JOIN auth.session AS s |
|
438 |
ON (s.id = sc_login.session_id) |
|
439 |
|; |
|
430 | 440 |
my $sth = prepare_execute_query($main::form, $dbh, $query); |
431 | 441 |
|
432 | 442 |
my %users; |
433 | 443 |
|
434 | 444 |
while (my $ref = $sth->fetchrow_hashref()) { |
435 |
$users{$ref->{login}} ||= { 'login' => $ref->{login}, 'id' => $ref->{id} }; |
|
445 |
|
|
446 |
$users{$ref->{login}} ||= { |
|
447 |
'login' => $ref->{login}, |
|
448 |
'id' => $ref->{id}, |
|
449 |
'last_action' => $ref->{last_action}, |
|
450 |
}; |
|
436 | 451 |
$users{$ref->{login}}->{$ref->{cfg_key}} = $ref->{cfg_value} if (($ref->{cfg_key} ne 'login') && ($ref->{cfg_key} ne 'id')); |
437 | 452 |
} |
438 | 453 |
|
Auch abrufbar als: Unified diff
Administrationsoberflaeche: aktive User anzeigen
implementiert #1853