diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Alert.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 9 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 3 |
5 files changed, 12 insertions, 13 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index c988b23c1..0e34ea64b 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -81,7 +81,7 @@ sub index : Path : Args(0) { $c->stash->{alerts} = \%alert_counts; - my $contacts = $c->model('DB::Contact')->summary_count( $c->cobrand->contact_restriction ); + my $contacts = $c->model('DB::Contact')->summary_count(); my %contact_counts = map { $_->confirmed => $_->get_column('confirmed_count') } $contacts->all; @@ -770,7 +770,7 @@ sub update_edit : Path('update_edit') : Args(1) { # If we're hiding an update, see if it marked as fixed and unfix if so if ( $new_state eq 'hidden' && $update->mark_fixed ) { - if ( $update->problem->state eq 'fixed' ) { + if ( $update->problem->state =~ /^fixed/ ) { $update->problem->state('confirmed'); $update->problem->update; } diff --git a/perllib/FixMyStreet/App/Controller/Alert.pm b/perllib/FixMyStreet/App/Controller/Alert.pm index ff92a7d2d..40dde455e 100644 --- a/perllib/FixMyStreet/App/Controller/Alert.pm +++ b/perllib/FixMyStreet/App/Controller/Alert.pm @@ -27,8 +27,6 @@ Show the alerts page sub index : Path('') : Args(0) { my ( $self, $c ) = @_; - $c->stash->{cobrand_form_elements} = $c->cobrand->form_elements('alerts'); - unless ( $c->req->referer && $c->req->referer =~ /fixmystreet\.com/ ) { $c->forward( 'add_recent_photos', [10] ); } @@ -149,7 +147,6 @@ sub updates : Path('updates') : Args(0) { $c->stash->{email} = $c->req->param('rznvy'); $c->stash->{problem_id} = $c->req->param('id'); - $c->stash->{cobrand_form_elements} = $c->cobrand->form_elements('alerts'); } =head2 confirm @@ -508,8 +505,6 @@ sub setup_request : Private { $c->stash->{rznvy} ||= $c->user->email; } - $c->stash->{cobrand_form_elements} = $c->cobrand->form_elements('alerts'); - return 1; } diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm index 6596615c6..166f9d58e 100644 --- a/perllib/FixMyStreet/App/Controller/Report.pm +++ b/perllib/FixMyStreet/App/Controller/Report.pm @@ -100,10 +100,6 @@ sub format_problem_for_display : Private { $c->stash->{banner} = $c->cobrand->generate_problem_banner($problem); - $c->stash->{cobrand_alert_fields} = $c->cobrand->form_elements('/alerts'); - $c->stash->{cobrand_update_fields} = - $c->cobrand->form_elements('/updateForm'); - ( $c->stash->{short_latitude}, $c->stash->{short_longitude} ) = map { Utils::truncate_coordinate($_) } ( $problem->latitude, $problem->longitude ); diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index e982d6a4c..1e5825460 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -654,13 +654,15 @@ sub process_user : Private { $report->user( $user ); $report->name( $user->name ); $c->stash->{field_errors}->{name} = _('You have successfully signed in; please check and confirm your details are accurate:'); + $c->log->info($user->id . ' logged in during problem creation'); return 1; } # set the user's name, phone, and password $report->user->name( Utils::trim_text( $params{name} ) ) if $params{name}; $report->user->phone( Utils::trim_text( $params{phone} ) ); - $report->user->password( Utils::trim_text( $params{password_register} ) ); + $report->user->password( Utils::trim_text( $params{password_register} ) ) + if $params{password_register}; $report->name( Utils::trim_text( $params{name} ) ); return 1; @@ -957,10 +959,12 @@ sub save_user_and_report : Private { $report->user->phone( undef ); $report->user->password( '', 1 ); $report->user->insert(); + $c->log->info($report->user->id . ' created for this report'); } elsif ( $c->user && $report->user->id == $c->user->id ) { $report->user->update(); $report->confirm; + $c->log->info($report->user->id . ' is logged in for this report'); } else { # User exists and we are not logged in as them. @@ -971,6 +975,7 @@ sub save_user_and_report : Private { password => $report->user->password, }; $report->user->discard_changes(); + $c->log->info($report->user->id . ' exists, but is not logged in for this report'); } # If there was a photo add that too @@ -1050,6 +1055,7 @@ sub redirect_or_confirm_creation : Private { # Subscribe problem reporter to email updates $c->forward( 'create_reporter_alert' ); my $report_uri = $c->uri_for( '/report', $report->id ); + $c->log->info($report->user->id . ' was logged in, redirecting to /report/' . $report->id); $c->res->redirect($report_uri); $c->detach; } @@ -1071,6 +1077,7 @@ sub redirect_or_confirm_creation : Private { # tell user that they've been sent an email $c->stash->{template} = 'email_sent.html'; $c->stash->{email_type} = 'problem'; + $c->log->info($report->user->id . ' created ' . $report->id . ', email sent, ' . ($data->{password} ? 'password set' : 'password not set')); } sub create_reporter_alert : Private { diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index c67ca4d1f..29933e2f6 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -134,7 +134,8 @@ sub process_user : Private { $update->user->name( Utils::trim_text( $params{name} ) ) if $params{name}; - $update->user->password( Utils::trim_text( $params{password_register} ) ); + $update->user->password( Utils::trim_text( $params{password_register} ) ) + if $params{password_register}; return 1; } |