public function updateProperty($propertyId, $userId, $value)
 {
     $user = $this->userRepo->find($userId);
     $property = $this->userPropRepo->findOneBy(array('user' => $user, 'id' => $propertyId));
     $property->setValue($value);
     $this->em->persist($property);
     $this->em->flush();
 }
예제 #2
0
 public function resetPassword($userId, $email, $password, $secretCode)
 {
     $user = $this->userRepo->findOneBy(array('id' => $userId, 'email' => $email, 'secretKey' => $secretCode));
     if ($user === null) {
         return false;
     }
     $encoder = $this->securityencoder->getEncoder($user);
     $user->setPassword($encoder->encodePassword($password, $user->getSalt()));
     $user->setSecretKey("");
     $this->em->persist($user);
     $this->em->flush();
     return true;
 }