aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App')
-rw-r--r--perllib/FixMyStreet/App/Controller/Auth.pm3
-rw-r--r--perllib/FixMyStreet/App/Controller/Moderate.pm28
2 files changed, 17 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm
index a6a6378da..0b156ddd3 100644
--- a/perllib/FixMyStreet/App/Controller/Auth.pm
+++ b/perllib/FixMyStreet/App/Controller/Auth.pm
@@ -216,7 +216,8 @@ sub token : Path('/M') : Args(1) {
$c->stash->{token_not_found} = 1, return
if $data->{old_email} && (!$c->user_exists || $c->user->email ne $data->{old_email});
- $c->detach( '/auth/process_login', [ $data, 'email' ] );
+ my $type = $data->{login_type} || 'email';
+ $c->detach( '/auth/process_login', [ $data, $type ] );
}
sub process_login : Private {
diff --git a/perllib/FixMyStreet/App/Controller/Moderate.pm b/perllib/FixMyStreet/App/Controller/Moderate.pm
index e2ab16b6b..1313b5071 100644
--- a/perllib/FixMyStreet/App/Controller/Moderate.pm
+++ b/perllib/FixMyStreet/App/Controller/Moderate.pm
@@ -106,19 +106,21 @@ sub report_moderate_audit : Private {
reason => (sprintf '%s (%s)', $reason, $types_csv),
});
- my $token = $c->model("DB::Token")->create({
- scope => 'moderation',
- data => { id => $problem->id }
- });
-
- $c->send_email( 'problem-moderated.txt', {
- to => [ [ $problem->user->email, $problem->name ] ],
- types => $types_csv,
- user => $problem->user,
- problem => $problem,
- report_uri => $c->stash->{report_uri},
- report_complain_uri => $c->stash->{cobrand_base} . '/contact?m=' . $token->token,
- });
+ if ($problem->user->email_verified) {
+ my $token = $c->model("DB::Token")->create({
+ scope => 'moderation',
+ data => { id => $problem->id }
+ });
+
+ $c->send_email( 'problem-moderated.txt', {
+ to => [ [ $problem->user->email, $problem->name ] ],
+ types => $types_csv,
+ user => $problem->user,
+ problem => $problem,
+ report_uri => $c->stash->{report_uri},
+ report_complain_uri => $c->stash->{cobrand_base} . '/contact?m=' . $token->token,
+ });
+ }
}
sub report_moderate_hide : Private {