aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm4
-rw-r--r--perllib/FixMyStreet/App/Controller/Tokens.pm17
-rw-r--r--templates/web/zurich/tokens/confirm_problem.html15
3 files changed, 35 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 496dbe9ac..3a6986134 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -995,8 +995,10 @@ sub save_user_and_report : Private {
$c->log->info($report->user->id . ' created for this report');
}
elsif ( $c->user && $report->user->id == $c->user->id ) {
+ # Logged in and matches, so instantly confirm (except Zurich, with no confirmation)
$report->user->update();
- $report->confirm;
+ $report->confirm
+ unless $c->cobrand->moniker eq 'zurich';
$c->log->info($report->user->id . ' is logged in for this report');
}
else {
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(
diff --git a/templates/web/zurich/tokens/confirm_problem.html b/templates/web/zurich/tokens/confirm_problem.html
new file mode 100644
index 000000000..d61cf3ffa
--- /dev/null
+++ b/templates/web/zurich/tokens/confirm_problem.html
@@ -0,0 +1,15 @@
+[% INCLUDE 'header.html', title = loc('Confirmation') %]
+
+<h1>[% loc('Confirmation') %]</h1>
+
+[%
+ loc('You have successfully confirmed your email address.');
+ tprintf(
+ loc( 'You can <a href="%s%s">view the problem on this site</a>.' ),
+ c.cobrand.base_url_for_report( problem ),
+ problem.url
+ );
+%]
+</p>
+
+[% INCLUDE 'footer.html' %]