X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=mason%2Fmain;fp=mason%2Fmain;h=ec7c6536abc0158f524c84bcae49484c4778b5fd;hb=42a6560ca0aa3325296f3ea72096232cdc056cb5;hp=8a2533f3dec18ece1ce9ec8efc8139ad5f29bf60;hpb=e4d5c2aa7fa9dc49cbdece5472dcb155d5833ea9;p=nj-awaymsg.git diff --git a/mason/main b/mason/main index 8a2533f..ec7c653 100755 --- a/mason/main +++ b/mason/main @@ -1,5 +1,6 @@ <%init> use AwayMsg; +db_connect(); Email "out of office" setup @@ -10,11 +11,13 @@ use AwayMsg; <%perl> my %row; -my $sth = $dbh->prepare("SELECT emailaddr, textid, expires" - " FROM schema - " RIGHT JOIN addresses USING (emailaddr)". - " JOIN texts USING (textid)", - " ORDER BY emailaddr"); +my $sth = $dbh->prepare(< @@ -24,12 +27,23 @@ my $sth = $dbh->prepare("SELECT emailaddr, textid, expires" -% while ($row= $sth->fetchrow_hashref()) { +% while (my $row= $sth->fetchrow_hashref()) { + % if (defined $row->{'textid'}) { % my $expiry = expires2timet($row->{'expires'}); % if ($expiry > time) { +% } else { + +% } - + + +% } + +% } +
Which message? Expiry date
<% $row->{'emailaddr'} |h %>activeexpired<% $row->{'textid'} |h %> <% $row->{'expires'} |h %> +% } else { +inactive