From 923f05432e5639c025af3a42614f8960a6233777 Mon Sep 17 00:00:00 2001 From: Buchan Milne Date: Sat, 22 Jan 2011 09:38:25 +0000 Subject: Fix greeting in password reset key mail, by sending cn to stash Also add some more error error checking on the search --- lib/CatDap/Controller/forgot_password.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/CatDap/Controller') 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"); -- cgit v1.2.1