예제 #1
0
 public function saveRoleAction(Request $request)
 {
     $data = $request->request->all();
     if ($request->getSession()->get('userId')) {
         $user = new User();
         $user->load($data['user']);
         $user->setRoleId($data['role']);
         $user->save();
     }
     return new Response();
 }
예제 #2
0
 public function saveAction(Request $request)
 {
     $user = new User();
     $user->load($request->getSession()->get('userId'));
     $data = $request->request->all();
     $user->setName($data['name']);
     $user->setSecondName($data['second_name']);
     $user->setPhoto($data['photo']);
     $user->setEmail($data['email']);
     $user->save();
     return new Response();
 }
 /**
  * Save reset password.
  *
  * @param Request $request
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function saveResetAction(Request $request)
 {
     $data = $request->request->all();
     $user = new User();
     $user->loadByHash($data['hash']);
     if ($user->getId() && $data['password']) {
         $user->setPassword(md5($data['password']));
         $user->save();
     }
     return $this->redirectToRoute('lance_authorization');
 }