aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-01-20 11:17:30 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-01-20 11:17:30 +0000
commit3b05a634896ee38caf375f7c587ec32e1fb947da (patch)
tree6c54b153be9914c260b3d4e34420e5ac03c71f7d /perllib/FixMyStreet/App/Controller
parentce98919c502c6e34a5469b0ae75746011fbcb7b3 (diff)
If password field left blank when reporting/updating, ignore that for password setting.
This is so if someone temporarily forgets their password, and uses email confirmation to confirm without setting a new password, their old password isn't lost.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm3
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm3
2 files changed, 4 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index e982d6a4c..5138e3a19 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -660,7 +660,8 @@ sub process_user : Private {
# 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;
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;
}