From 7bd597e33d96220c97267882a3833c086fa091ce Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Sun, 31 Aug 2008 18:47:06 +0200 Subject: [PATCH] Show first part of email if login name is not present --- PciIds/DBQ.pm | 2 +- PciIds/Html/List.pm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/PciIds/DBQ.pm b/PciIds/DBQ.pm index e3932f1..4eeb33e 100644 --- a/PciIds/DBQ.pm +++ b/PciIds/DBQ.pm @@ -29,7 +29,7 @@ sub new( $ ) { 'rights' => 'SELECT rightId FROM rights WHERE userId = ?', 'newitem' => 'INSERT INTO locations (id, parent) VALUES(?, ?)', 'newhistory' => 'INSERT INTO history (location, owner, discussion, nodename, nodenote) VALUES(?, ?, ?, ?, ?)', - 'history' => 'SELECT history.id, history.discussion, history.time, history.nodename, history.nodenote, history.seen, users.login FROM history LEFT OUTER JOIN users ON history.owner = users.id WHERE history.location = ? ORDER BY history.time', + 'history' => 'SELECT history.id, history.discussion, history.time, history.nodename, history.nodenote, history.seen, users.login, users.email FROM history LEFT OUTER JOIN users ON history.owner = users.id WHERE history.location = ? ORDER BY history.time', 'admindump' => 'SELECT locations.id, locations.name, locations.note, locations.mainhistory, musers.login, main.discussion, history.id, history.discussion, history.nodename, history.nodenote, users.login diff --git a/PciIds/Html/List.pm b/PciIds/Html/List.pm index bcd5525..f4fbdb9 100644 --- a/PciIds/Html/List.pm +++ b/PciIds/Html/List.pm @@ -39,7 +39,7 @@ sub list( $$$$ ) { print "
\n

Discussion

"; $diss = 1; } - my( $id, $text, $time, $name, $note, $seen, $user ) = @{$history}; + my( $id, $text, $time, $name, $note, $seen, $user, $email ) = @{$history}; my $type = $seen ? 'history' : 'unseen-history'; $type = 'main-history' if( defined( $mid ) && ( $id == $mid ) ); print "
\n"; @@ -51,6 +51,7 @@ sub list( $$$$ ) { $text =~ s/\n/
/g; print "

$text\n"; } + ( $user ) = ( $email =~ /^(.*)@/ ) if defined $email && !defined $user; print "

".encode( $user )."\n" if( defined( $user ) ); print "

".encode( $time )."\n"; print "

\n"; -- 2.39.2