Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add logic for tester preferred contact address

  • Loading branch information...
commit 9817b59f9000cab2a0d1b6f25f441b0d7e0e4566 1 parent 005f5c9
@barbie authored
Showing with 11 additions and 1 deletion.
  1. +2 −0  Changes
  2. +9 −1 templates/cgi-bin/cpanmail.cgi
View
2  Changes
@@ -1,6 +1,8 @@
Revision history for CPAN-Testers-WWW-Statistics
================================================
+ - add logic for tester preferred contact address.
+
1.13 2014-06-11
- added new distributions pages.
- added new distribution versions page.
View
10 templates/cgi-bin/cpanmail.cgi
@@ -107,7 +107,15 @@ sub retrieve_from_db {
$tvars{id} = $rows[0]->{id};
$tvars{guid} = $rows[0]->{guid};
$tvars{subject} = sprintf "%s %s-%s %s %s", uc $rows[0]->{state}, $rows[0]->{dist}, $rows[0]->{version}, $rows[0]->{perl}, $rows[0]->{osname};
- $tvars{from} = $rows[0]->{tester};
+
+ # find testers preferred contact address
+ $sql = 'SELECT tp.* FROM testers.address ta '
+ . 'LEFT JOIN testers.profile tp ON tp.testerid=ta.testerid '
+ . 'WHERE ta.address=? ORDER BY tp.testerid DESC';
+ @mails = $dbh->get_query('hash',$sql,$rows[0]->{tester});
+
+ $tvars{from} = $mails[0]->{contact} if(@mails);
+ $tvars{from} ||= $rows[0]->{tester}; # just in case
return 1;
}
Please sign in to comment.
Something went wrong with that request. Please try again.