Guest User

Untitled

a guest
Jun 14th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. $email = $request->getParameter('email');
  2. $user = Doctrine_Core::getTable('User')->getUser($email);
  3. if($user)
  4. {
  5. $validchars = array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','f','g','h','j','k','m','n','p','q','r','s','t','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U',"V",'W','X','Y',"Z");
  6. $password = '';
  7. $i = 0;
  8. while ($i < 8) {
  9. $password .= $validchars[rand(0, count($validchars) - 1)];
  10.  
  11. $i++;
  12. }
  13.  
  14. $user->password = md5($password);
  15.  
  16. $user->save();
  17.  
  18. $external_user = Doctrine_Core::getTable('UserSource')->saveExternalPasswords($user, $password);
Add Comment
Please, Sign In to add comment