aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CatDap/Controller/forgot_password.pm
diff options
context:
space:
mode:
authorBuchan Milne <buchan@mageia.org>2011-01-22 09:38:25 +0000
committerBuchan Milne <buchan@mageia.org>2011-01-22 09:38:25 +0000
commit923f05432e5639c025af3a42614f8960a6233777 (patch)
tree6e89be42ea8d7d41e00836fd9094897ce686c0fd /lib/CatDap/Controller/forgot_password.pm
parentf137198a5d995c872f9d753e306b39f75b10dd45 (diff)
downloadidentity-923f05432e5639c025af3a42614f8960a6233777.tar
identity-923f05432e5639c025af3a42614f8960a6233777.tar.gz
identity-923f05432e5639c025af3a42614f8960a6233777.tar.bz2
identity-923f05432e5639c025af3a42614f8960a6233777.tar.xz
identity-923f05432e5639c025af3a42614f8960a6233777.zip
Fix greeting in password reset key mail, by sending cn to stash Also add some more error error checking on the search
Diffstat (limited to 'lib/CatDap/Controller/forgot_password.pm')
-rw-r--r--lib/CatDap/Controller/forgot_password.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CatDap/Controller/forgot_password.pm b/lib/CatDap/Controller/forgot_password.pm
index 07589a3..47d81b4 100644
--- a/lib/CatDap/Controller/forgot_password.pm
+++ b/lib/CatDap/Controller/forgot_password.pm
@@ -56,7 +56,10 @@ sub check : Local {
$emailfilter =~ s/\%s/$email/g,
$c->log->debug("Searching for email $email with filter $emailfilter");
my $mesg = $c->model('Proxy')->search($emailfilter);
- if (!$mesg->entries()) {
+
+ $c->log->info(printf("Search failed: %s"),$mesg->error) if ($mesg->code);
+ my @entries = $mesg->entries;
+ if (@entries != 1) {
push @errors,$c->loc(
'This email address is not bound to an account'
);
@@ -86,6 +89,7 @@ sub check : Local {
'template' => 'forgot_password.tt',
},
url => $c->uri_for('/forgot_password/confirm') . "?secret=$secret",
+ cn => @entries[0]->cn,
);
$c->log->info("Sending forgot password mail to email address $email");