| ␉␉␉␉␉␉␉ 'email' => Input::get('email'),␊ |
| ␉␉␉␉␉␉␉ 'password' => Hash::make(\Input::get('password'))));␊ |
| ␊ |
| ␊ |
| ␊ |
| ␉␉␉if($user->save())␊ |
| ␉␉␉{␊ |
| ␉␉␉␉$user_id = $user->id;␊ |
| ␊ |
| ␉␉␉␉return Redirect::to('users/group')->with('success', 'You have successfully registered')␊ |
| ␉␉␉␉␉␉␉␉␉␉␉␉ ->with('id', $user_id);␊ |
| ␉␉␉␉return Redirect::route('group', array('user_id' => $user_id));␊ |
| ␊ |
| ␉␉␉}else␊ |
| ␉␉␉{␊ |
| ␉␉␉␉return \Redirect::to('users/create')->with('errors', 'Something terrible happened');␊ |
| ␉␉␉␉return \Redirect::to('create')->with('errors', 'Something terrible happened');␊ |
| ␉␉␉}␊ |
| ␉␉␉␊ |
| ␉␉}␊ |
| ␉}␊ |
| ␊ |
| ␉/**␊ |
| ␉ * Display the mentor or mentee choice view␊ |
| ␉ * @return Response␊ |
| ␉ * Display the two buttons for choosing between mentor and mentee␊ |
| ␉ * @return View response␊ |
| ␉ */␊ |
| ␉public function chooseGroup()␊ |
| ␉public function chooseGroup($user_id)␊ |
| ␉{␊ |
| ␉␉return View::make('users.group');␊ |
| ␉␉return View::make('users.group')->with('user_id', $user_id);␊ |
| ␉}␊ |
| ␊ |
| ␉/**␊ |
| ␉ * Handles POST to complete user profile␊ |
| ␉ * @param int $id user id␊ |
| ␉ * @return Response ␊ |
| ␉ */␊ |
| ␉public function completeProfile($id)␊ |
| ␉public function completeRegistration()␊ |
| ␉{␊ |
| ␉␉$user = User::find($id);␊ |
| ␊ |
| ␉␉return View::make('users.complete', array('user' => $user));␊ |
| ␉}␊ |
| ␉␉$user_id = \Request::segment(3);␊ |
| ␉␉$group_id = \Request::segment(4);␊ |
| ␊ |
| ␉/**␊ |
| ␉ * Handles POST request to update user profile␊ |
| ␉ * @param $id of the user being updated␊ |
| ␉ * @return Response␊ |
| ␉ */␊ |
| ␉public function saveProfile($id)␊ |
| ␉{␊ |
| ␉␉$user = User::find($id);␊ |
| ␉}␊ |
| ␉␉$user = User::find($user_id);␊ |
| ␊ |
| ␉␉return View::make('users.profile')->with('user', $user)->with('group_id', $group_id);␊ |
| ␊ |
| ␉/**␊ |
| ␉ * Display the view of a single user␊ |
| ␉ * @param $id user id to be displayed␊ |
| ␉ * @return Response ␊ |
| ␉ */␊ |
| ␉public function viewProfile($id)␊ |
| ␉{␊ |
| ␉␉$user = User::find($id);␊ |
| ␊ |
| ␉␉return View::make('users.profile', array('user' => $user));␊ |
| ␉}␊ |
| ␊ |
| ␉␊ |
| ␉/**␊ |
| ␉ * Display view to edit a given user␊ |
| ␉ * @param $id of the user being updated␊ |
| ␉ * @return Response␊ |
| ␉ */␊ |
| ␉public function edit($id)␊ |
| ␉{␊ |
| ␉␉$user = User::find($id);␊ |
| ␉␉return View::make('users.edit', array('user' => $user));␊ |
| ␉}␊ |
| ␊ |
| ␊ |
| ␉/**␊ |
| ␉ * Handle POST request to delete a user␊ |
| ␉ * @param $id of the user to destroy␊ |
| ␉ * @return Response␊ |
| ␉ */␊ |
| ␉public function destroy($id)␊ |
| ␉{␊ |
| ␉␉$user = User::destroy($id);␊ |
| ␊ |
| ␉}␊ |
| }␉␉␉ |