aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Tokens.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-12-20 13:41:30 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-12-20 13:41:30 +0000
commitaf8c0ffd8aaaa19d84beaf2b1f8a5258574656e0 (patch)
tree66ac684d7d9ab89582d9318cd2090092973e8e20 /perllib/FixMyStreet/App/Controller/Tokens.pm
parentafc6697a91c5302efd92a5ee5c21a2d732e29fff (diff)
Zurich always has email confirmation, and that just sets a flag (as report is already 'public').
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Tokens.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Tokens.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Tokens.pm b/perllib/FixMyStreet/App/Controller/Tokens.pm
index 03dc69b00..33e785e61 100644
--- a/perllib/FixMyStreet/App/Controller/Tokens.pm
+++ b/perllib/FixMyStreet/App/Controller/Tokens.pm
@@ -53,6 +53,23 @@ sub confirm_problem : Path('/P') {
return;
}
+ # For Zurich, email confirmation simply sets a flag, it does not change the
+ # problem state, log in, or anything else
+ if ($c->cobrand->moniker eq 'zurich') {
+ $problem->update( {
+ anonymous => 0,
+ confirmed => \'ms_current_timestamp()',
+ } );
+
+ if ( ref($data) && ( $data->{name} || $data->{password} ) ) {
+ $problem->user->name( $data->{name} ) if $data->{name};
+ $problem->user->phone( $data->{phone} ) if $data->{phone};
+ $problem->user->update;
+ }
+
+ return 1;
+ }
+
# We have a problem - confirm it if needed!
my $old_state = $problem->state;
$problem->update(