Correctly request an account confirmation when trying to recover the password of a not yet activated account.

This commit is contained in:
Loic d'Anterroches
2010-02-15 22:40:34 +01:00
parent 96e8f4ae3c
commit 52be41186f
3 changed files with 53 additions and 23 deletions

View File

@@ -124,8 +124,14 @@ class IDF_Form_Register extends Pluf_Form
$user->language = $this->request->language_code;
$user->active = false;
$user->create();
$from_email = Pluf::f('from_email');
self::sendVerificationEmail($user);
return $user;
}
public static function sendVerificationEmail($user)
{
Pluf::loadFunction('Pluf_HTTP_URL_urlForView');
$from_email = Pluf::f('from_email');
$cr = new Pluf_Crypt(md5(Pluf::f('secret_key')));
$encrypted = trim($cr->encrypt($user->email.':'.$user->id), '~');
$key = substr(md5(Pluf::f('secret_key').$encrypted), 0, 2).$encrypted;
@@ -144,6 +150,5 @@ class IDF_Form_Register extends Pluf_Form
__('Confirm the creation of your account.'));
$email->addTextMessage($text_email);
$email->sendMail();
return $user;
}
}