コード例 #1
0
 public function testPassAction($id)
 {
     $em = $this->getDoctrine()->getManager();
     $user = $em->getRepository('UserBundle:User')->find($id);
     //        dump($user);
     if (!$user) {
         die("n'existe pas");
     }
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($user);
     $pwd = $encoder->encodePassword("toto", $user->getSalt());
     dump($pwd);
     dump($user);
     //        if ($user) {
     //            $encoder = $this->container->get('security.encoder_factory')->getEncoder($user);
     //            if ($encoder->encodePassword($password, $user->getSalt()) === $user->getPassword()) {
     //                return $user;
     //            }
     //        }
     die;
 }
 /**
  * Update a User from the submitted data by ID.<br/>
  * @ApiDoc(
  *   resource = true,
  *   description = "Updates a user from the submitted data by ID.",
  *   statusCodes = {
  *     200 = "Returned when successful",
  *     400 = "Returned when the form has errors"
  *   }
コード例 #2
0
     }
     $view = FOSView::create();
     $view->setData($entity)->setStatusCode(200);
     return $view;
 }
 /**
  * Return an Modality by ID.
  * @ApiDoc(
  *   resource = true,
  *   description = "Return an Modality by ID",
  *   statusCodes = {
  *     200 = "Returned when successful",
  *     404 = "Returned when the user is not found"
  *   }
  * )
  * @Get("/modality/{id}")
  * @param $id
  * @return View
  */
 public function getModalityAction($id)