From: Andrew DeFaria Date: Wed, 21 Jul 2021 05:19:55 +0000 (-0700) Subject: More fixes X-Git-Url: https://defaria.com/gitweb/?a=commitdiff_plain;h=2911826fd83a57b69c528e4daaf8df30c00b6d2b;p=clearscm.git More fixes . Fixed bug in maps where people pretending to me were getting through . Changed table formatting to be more similar --- diff --git a/maps/bin/detail.cgi b/maps/bin/detail.cgi index 53fc47e..f4885fd 100755 --- a/maps/bin/detail.cgi +++ b/maps/bin/detail.cgi @@ -9,7 +9,7 @@ # Modified: $Date: 2013/06/12 14:05:47 $ # Language: perl # -# (c) Copyright 2000-2006, Andrew@DeFaria.com, all rights reserved. +# (c) Copyright 2000-2021, Andrew@DeFaria.com, all rights reserved. # ################################################################################ use strict; @@ -177,21 +177,42 @@ sub Body($) { th {-class => 'tablebordertopright'}, 'Comment', ]; - for my $sender (ReturnSenders( + my @senders = ReturnSenders( userid => $userid, type => $type, start_at => $next, lines => $lines, date => $date - )) { + ); + + for my $sender (@senders) { my $msgs = ReturnMessages( userid => $userid, sender => $sender, ); + my $leftclass = 'tableleftdata'; + my $dataclass = 'tabledata'; + my $rightclass = 'tablerightdata'; + my $senderclass = 'sender'; + my $subjectclass = 'subject'; + + # Check to see if this is the last line + if ((($next + 1) % $lines) == (@senders % $lines)) { + # We always "bottom" the first column + $leftclass = 'tablebottomleft'; + + # Check to see if there any message lines to display + unless (@$msgs) { + $dataclass = 'tablebottomdata'; + $rightclass = 'tablebottomright'; + $senderclass = 'senderbottom'; + } # unless + } # if + # This is for the purposes of supplying a subject line if the mailto address # is clicked on. It's kludgy because we are simply grabbing the subject line - # of the first email sent where there may be many emails from this sender. + # of the first email sent where there may be many emails from this sender # Still it is often the right subject (or a good enough one) # # A little tricky here because of transliteration. If I test for @@ -245,47 +266,59 @@ sub Body($) { print start_Tr {-valign => 'middle'}; print td { - -class => 'tableborder', + -class => $leftclass, + -align => 'right', + -valign => 'middle', -rowspan => $rowspan, - }, small ($next, + }, $next, checkbox { - -name => "action$next", - -label => '' - }), hidden({ + -name => "action$next", + -label => '', + -valign => 'middle', + }; + + print hidden({ -name => "email$next", - -default => $sender + -default => $sender, }); # Get subject line $heading = "?subject=$heading" if $heading; print td { - -class => 'sender', + -class => $senderclass, }, a { -href => "mailto:$sender$heading", - }, " $sender"; + }, " $sender"; my $listlink = ($list and $sequence) ? "$list:$sequence" : ' '; print td { - -class => 'tabledata', + -class => $dataclass, -align => 'right', }, a { href => "/maps/php/list.php?type=$list&next=" . ($sequence - 1), }, $listlink, td { - -class => 'tabledata', + -class => $dataclass, -align => 'right', }, "$hit_count ", td { - -class => 'tabledata', + -class => $dataclass, }, $rule, td { - -class => 'tablerightdata', + -class => $rightclass, }, $comment; print end_Tr; for my $rec (@$msgs) { + # We increased $next earlier so do not add 1 here + if (($next % $lines) == (@senders % $lines)) { + $dataclass = 'tablebottomdata'; + $rightclass = 'tablebottomright'; + $subjectclass = 'subjectbottom'; + } # if + if ($date eq substr ($rec->{timestamp}, 0, 10)) { $rec->{date} = b font {-color => 'green'}, SQLDatetime2UnixDatetime $rec->{timestamp}; } else { @@ -300,29 +333,18 @@ sub Body($) { print Tr [ td { - -class => 'subject', - -valign => 'middle', - -bgcolor => '#ffffff', + -class => $subjectclass, -colspan => 4, - }, a {-href => "display.cgi?sender=$sender;msg_date=$rec->{timestamp}" + }, a { + -href => "display.cgi?sender=$sender;msg_date=$rec->{timestamp}", }, '    ' . $rec->{subject}, - td {-class => 'tablerightdata', + td {-class => $rightclass, -width => '150', - -valign => 'middle', - -align => 'right'}, span {-class => 'date'}, $rec->{date}, + -align => 'right'}, span {-class => 'date'}, $rec->{date} . ' ', ]; } # for } # for - print - Tr [ - td {-class => 'tableborderbottomleft'}, ' ', - th {-class => 'tableborder'}, ' ', - th {-class => 'tableborder'}, ' ', - th {-class => 'tableborder'}, ' ', - th {-class => 'tableborder'}, ' ', - th {-class => 'tableborderbottomright'}, ' ' - ]; print end_table; print end_form; diff --git a/maps/bin/maps b/maps/bin/maps index 854316b..223cda6 100755 --- a/maps/bin/maps +++ b/maps/bin/maps @@ -120,8 +120,8 @@ sub ProcessMsgs ($$$) { return unless $execute; - while (!eof *$msgfile) { - my ($sender, $sender_long, $reply_to, $subject, $data) = ReadMsg (*$msgfile); + while (!eof $msgfile) { + my ($sender, $sender_long, $reply_to, $subject, $data) = ReadMsg ($msgfile); my ($onlist, $rule, $sequence, $hit_count); @@ -232,6 +232,6 @@ verbose "Starting MAPS...."; my %userOptions = SetContext $userid or die "$userid is not a registered MAPS user\n"; -ProcessMsgs $msgfile, $userOptions{name}, $userOptions{email}; +ProcessMsgs $msgfile, $userOptions{name}, lc $userOptions{email}; exit 0; diff --git a/maps/css/MAPSStyle.css b/maps/css/MAPSStyle.css index f7be5a6..ca8c491 100644 --- a/maps/css/MAPSStyle.css +++ b/maps/css/MAPSStyle.css @@ -294,7 +294,7 @@ img { background: SteelBlue; color: white; font-style: bold; - font-size: 14; + font-size: 14px; text-align: center; -moz-border-radius-topleft: 7px; border-top-left-radius: 7px; @@ -304,7 +304,7 @@ img { background: SteelBlue; color: white; font-style: bold; - font-size: 14; + font-size: 14px; text-align: center; -moz-border-radius-topright: 7px; border-top-right-radius: 7px; @@ -314,7 +314,7 @@ img { background: SteelBlue; color: white; font-style: bold; - font-size: 14; + font-size: 14px; text-align: center; -moz-border-radius-topleft: 7px; border-top-left-radius: 7px; @@ -324,7 +324,7 @@ img { background: SteelBlue; color: white; font-style: bold; - font-size: 14; + font-size: 14px; text-align: center; -moz-border-radius-topright: 7px; border-top-right-radius: 7px; @@ -334,7 +334,7 @@ img { background: SteelBlue; color: white; font-style: bold; - font-size: 14; + font-size: 14px; text-align: center; -moz-border-radius-bottomleft: 7px; border-bottom-left-radius: 7px; @@ -344,7 +344,7 @@ img { background: SteelBlue; color: white; font-style: bold; - font-size: 14; + font-size: 14px; text-align: center; -moz-border-radius-bottomright: 7px; border-bottom-right-radius: 7px; @@ -354,7 +354,7 @@ img { background: SteelBlue; color: white; font-style: bold; - font-size: 14; + font-size: 14px; text-align: center; } @@ -404,39 +404,39 @@ img { .tableleftdata { background: White; - color: Red; + color: black; border-left: solid 3px SteelBlue; border-bottom: 1px dotted #ccc; - font-size: 14; + font-size: 12px; } .tableleftrightdata { background: #c1dffc; border-right: solid 3px SteelBlue; border-left: solid 1px SteelBlue; border-bottom: 1px dotted #ccc; - font-size: 14; + font-size: 12px; } .tablerightleftdata { background: #c1dffc; border-right: solid 1px SteelBlue; border-left: solid 3px SteelBlue; border-bottom: 1px dotted #ccc; - font-size: 14; + font-size: 12px; } .tablerightdata { background: White; border-right: solid 3px SteelBlue; border-left: 1px dotted #ccc; border-bottom: 1px dotted #ccc; - font-size: 14; + font-size: 12px; } .tablebottomleft { background: White; - color: Red; + color: black; border-left: solid 3px SteelBlue; border-right: 1px dotted #ccc; border-bottom: solid 3px SteelBlue; - font-size: 14; + font-size: 14px; -moz-border-radius-bottomleft: 7px; border-bottom-left-radius: 7px; } @@ -445,7 +445,7 @@ img { border-right: solid 3px SteelBlue; border-left: 1px dotted #ccc; border-bottom: solid 3px SteelBlue; - font-size: 14; + font-size: 14px; -moz-border-radius-bottomright: 7px; border-bottom-right-radius: 7px; } @@ -453,14 +453,14 @@ img { background: White; border-left: 1px dotted #ccc; border-bottom: solid 3px SteelBlue; - font-size: 14; + font-size: 14px; } .tablebottomlefttotal { background: #c1dffc; border-left: solid 3px SteelBlue; border-bottom: solid 3px SteelBlue; border-right: 1px dotted #ccc; - font-size: 14; + font-size: 14px; -moz-border-radius-bottomleft: 7px; border-bottom-left-radius: 7px; } @@ -468,7 +468,7 @@ img { background: #c1dffc; border-right: solid 3px SteelBlue; border-bottom: solid 3px SteelBlue; - font-size: 14; + font-size: 14px; -moz-border-radius-bottomright: 7px; border-bottom-right-radius: 7px; } @@ -477,17 +477,18 @@ img { border-bottom: solid 3px SteelBlue; border-top: solid 1px SteelBlue; border-right: 1px dotted #ccc; - font-size: 14; + font-size: 14px; } .tabledata { background: White; border-left: 1px dotted #ccc; border-bottom: 1px dotted #ccc; - font-size: 14; + font-size: 14px; } + .date { background: White; - font-size: 10px; + font-size: 12px; } .dateright { @@ -501,50 +502,68 @@ img { /* Special anchor effects */ .sender { background: White; + border-top: 1px dotted #ccc; + border-left: 1px dotted #ccc; font-family: arial, sans-serif; - font-size: 12px; - font-weight: bold; + font-size: 14px; } - .sender a:link { - color: Red; + color: steelblue; } - -.sender a:visited { - color: #0054e3; -} - .sender a:hover { - color: White; - background: Red; + color: red; + background: white; } -.sender a:active { - color: Yellow; +.senderbottom { + background: White; + border-top: 1px dotted #ccc; + border-left: 1px dotted #ccc; + border-bottom: solid 3px SteelBlue; + font-size: 14px; +} +.senderbottom a:link { + color: steelblue; +} +.senderbottom a:hover { + color: red; + background: white; } .subject { - background: White; - font-family: arial, sans-serif; - font-size: 10px; - font-weight: bold; + background: white; + border-top: 1px dotted #ccc; + border-left: 1px dotted #ccc; + font-family: arial, sans-serif; + font-size: 16px; } - .subject a:link { - color: #0000ee; + color: #b11; } - .subject a:visited { - color: #cc33cc; + color: grey; } - .subject a:hover { - color: White; - background: #0054e3; + color: blue; + background: white; } -.subject a:active { - color: #ff0000; +.subjectbottom { + background: White; + border-top: 1px dotted #ccc; + border-left: 1px dotted #ccc; + border-bottom: solid 3px SteelBlue; + font-size: 16px; +} +.subjectbottom a:link { + color: #b11; +} +.subjectbottom a:visited { + color: grey; +} +.subjectbottom a:hover { + color: blue; + background: white; } /* Menu anchors */ diff --git a/maps/lib/MAPS.pm b/maps/lib/MAPS.pm index c0e3448..3e0b066 100644 --- a/maps/lib/MAPS.pm +++ b/maps/lib/MAPS.pm @@ -629,7 +629,7 @@ sub CountLog(%) { my $condition = "userid='$userid'"; $condition .= " and $additional_condition" if $additional_condition; - return $db->count_distinct('log', 'sender', $condition); + return $db->count('log', $condition); } # CountLog sub Decrypt ($$) { diff --git a/maps/php/MAPS.php b/maps/php/MAPS.php index 589e74d..3816c00 100755 --- a/maps/php/MAPS.php +++ b/maps/php/MAPS.php @@ -405,9 +405,9 @@ function DisplayList($type, $next, $lines) { or DBError("DisplayList: Unable to execute query: ", $statement); for ($i = 0; $i < $lines; $i++) { - $row = mysqli_fetch_array ($result); + $row = mysqli_fetch_array($result); - if (!isset ($row ["sequence"])) { + if (!isset ($row["sequence"])) { break; } // if @@ -433,8 +433,7 @@ function DisplayList($type, $next, $lines) { $rightclass = ($i == $lines || $sequence == $total || $sequence == $last) ? "tablebottomright" : "tablerightdata"; - print "" . $sequence . ""; - print "\n"; + print "" . $sequence . "\n"; print "" . $username . ""; print "@"; print "$domain"; diff --git a/maps/php/list.php b/maps/php/list.php index bc38d99..964f061 100755 --- a/maps/php/list.php +++ b/maps/php/list.php @@ -103,8 +103,7 @@ $this_page = $next / $lines + 1; - - + @@ -114,7 +113,7 @@ $this_page = $next / $lines + 1; - +
SeqMark  Username @ DomainComments