aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--db/schema.sql3
-rwxr-xr-xweb-admin/index.cgi7
-rwxr-xr-xweb/confirm.cgi6
3 files changed, 10 insertions, 6 deletions
diff --git a/db/schema.sql b/db/schema.sql
index f76975875..47c71c73f 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -4,7 +4,7 @@
-- Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
-- Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
--
--- $Id: schema.sql,v 1.25 2007-04-30 16:19:19 francis Exp $
+-- $Id: schema.sql,v 1.26 2007-05-03 09:34:20 matthew Exp $
--
-- secret
@@ -138,6 +138,7 @@ create table problem (
-- Metadata
created timestamp not null default ms_current_timestamp(),
+ confirmed timestamp,
state text not null check (
state = 'unconfirmed'
or state = 'confirmed'
diff --git a/web-admin/index.cgi b/web-admin/index.cgi
index 34a551a23..3bc2d26dd 100755
--- a/web-admin/index.cgi
+++ b/web-admin/index.cgi
@@ -7,10 +7,10 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: index.cgi,v 1.33 2007-05-02 17:02:14 matthew Exp $
+# $Id: index.cgi,v 1.34 2007-05-03 09:34:23 matthew Exp $
#
-my $rcsid = ''; $rcsid .= '$Id: index.cgi,v 1.33 2007-05-02 17:02:14 matthew Exp $';
+my $rcsid = ''; $rcsid .= '$Id: index.cgi,v 1.34 2007-05-03 09:34:23 matthew Exp $';
use strict;
@@ -177,7 +177,7 @@ sub do_councils_list ($) {
@councils_ids = sort { canonicalise_council($councils->{$a}->{name}) cmp canonicalise_council($councils->{$b}->{name}) } @councils_ids;
my $bci_info = dbh()->selectall_hashref("
select area_id, count(*) as c, count(case when deleted then 1 else null end) as deleted,
- count(case when confirmed then 1 else null end) as confirmed
+ count(case when confirmed then 1 else null end) as confirmed
from contacts group by area_id", 'area_id');
my $list_part = sub {
@@ -440,5 +440,6 @@ sub main {
} else {
do_summary($q);
}
+ dbh()->rollback();
}
Page::do_fastcgi(\&main);
diff --git a/web/confirm.cgi b/web/confirm.cgi
index cc0e21a04..09022ed7d 100755
--- a/web/confirm.cgi
+++ b/web/confirm.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: confirm.cgi,v 1.13 2007-05-01 16:24:40 matthew Exp $
+# $Id: confirm.cgi,v 1.14 2007-05-03 09:34:22 matthew Exp $
use strict;
require 5.8.0;
@@ -66,7 +66,8 @@ EOF
$out .= $q->p(sprintf(_('You could also <a href="%s">subscribe to the RSS feed</a> of updates by other local people on this problem, or %s if you wish to receive updates by email.'), "/rss/$problem_id", $signup));
$out .= '</form>';
} elsif ($type eq 'problem') {
- dbh()->do("update problem set state='confirmed' where id=? and state='unconfirmed'", {}, $id);
+ dbh()->do("update problem set state='confirmed',confirmed=ms_current_timestamp()
+ where id=? and state='unconfirmed'", {}, $id);
my ($email, $council) = dbh()->selectrow_array("select email, council from problem where id=?", {}, $id);
my $salt = unpack('h*', random_bytes(8));
my $secret = scalar(dbh()->selectrow_array('select secret from secret'));
@@ -99,6 +100,7 @@ EOF
print Page::header($q, _('Confirmation'));
print $out;
print Page::footer();
+ dbh()->rollback();
}
Page::do_fastcgi(\&main);