Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $email = $request->getParameter('email');
- $user = Doctrine_Core::getTable('User')->getUser($email);
- if($user)
- {
- $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");
- $password = '';
- $i = 0;
- while ($i < 8) {
- $password .= $validchars[rand(0, count($validchars) - 1)];
- $i++;
- }
- $user->password = md5($password);
- $user->save();
- $external_user = Doctrine_Core::getTable('UserSource')->saveExternalPasswords($user, $password);
Add Comment
Please, Sign In to add comment