Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

change activation token generator

  • Loading branch information...
commit cbac73dc310883e9ff6d57ede7d1db32d647faca 1 parent 387ea29
@bladeofsteel authored
Showing with 3 additions and 11 deletions.
  1. +3 −11 src/ZfcUser/Service/User.php
View
14 src/ZfcUser/Service/User.php
@@ -12,7 +12,8 @@
ZfcUser\Model\UserMapperInterface,
ZfcUser\Model\UserMetaMapperInterface,
ZfcUser\Module as ZfcUser,
- ZfcBase\EventManager\EventProvider;
+ ZfcBase\EventManager\EventProvider,
+ ZfcBase\Util;
class User extends EventProvider
{
@@ -142,7 +143,7 @@ public function sendConfirmation(UserModel $user)
$template = ZfcUser::getOption('email_activation_body');
$renderer = $this->getLocator()->get('Zend\View\Renderer\PhpRenderer');
- $viewParams = array('code' => $this->generateActivationCode($user->getEmail()),
+ $viewParams = array('code' => Util\String::getRandomBytes(16),
'user' => $user->getUserId());
$body = $renderer->render($template, $viewParams);
@@ -156,15 +157,6 @@ public function sendConfirmation(UserModel $user)
}
/**
- * @param $email
- * @return string
- */
- public function generateActivationCode($email)
- {
- return sha1($email);
- }
-
- /**
* Get a user entity by their username
*
* @param string $username
Please sign in to comment.
Something went wrong with that request. Please try again.