[Mageia-sysadm] [336] Fix greeting in password reset key mail, by sending cn to stash

root at mageia.org root at mageia.org
Sat Jan 22 10:38:25 CET 2011


Revision: 336
Author:   buchan
Date:     2011-01-22 10:38:25 +0100 (Sat, 22 Jan 2011)
Log Message:
-----------
Fix greeting in password reset key mail, by sending cn to stash
Also add some more error error checking on the search

Modified Paths:
--------------
    identity/CatDap/trunk/lib/CatDap/Controller/forgot_password.pm

Modified: identity/CatDap/trunk/lib/CatDap/Controller/forgot_password.pm
===================================================================
--- identity/CatDap/trunk/lib/CatDap/Controller/forgot_password.pm	2011-01-22 08:52:05 UTC (rev 335)
+++ identity/CatDap/trunk/lib/CatDap/Controller/forgot_password.pm	2011-01-22 09:38:25 UTC (rev 336)
@@ -56,7 +56,10 @@
 	$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 @@
 			'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");
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20110122/297c6dcb/attachment-0001.html>


More information about the Mageia-sysadm mailing list