Ejemplo n.º 1
0
 public function showProfile()
 {
     if (!Auth::user()->isAdmin()) {
         $data = ProfileHelper::getUserLastProfileData(Auth::user());
     }
     $data['user'] = User::find(Auth::id());
     $data['title'] = 'Editar mi perfil';
     return View::make('userProfile', $data);
 }
Ejemplo n.º 2
0
 public function doSearch($testName)
 {
     $userEmail = Input::get('email');
     $user = User::where("email", "=", $userEmail)->first();
     if ($user != null) {
         if (!$user->isAdmin()) {
             $data['title'] = $testName;
             Session::put('athleteEmail', $user->email);
             $data['profileData'] = ProfileHelper::getUserLastProfileData($user);
             $data['profileData']['user'] = $user;
             $data['questions'] = $this->getQuestions($testName);
             return View::make('test', $data);
         } else {
             $data['title'] = $testName;
             return Redirect::to('test/' . $testName)->with(array('message' => 'Debes de ingresar el correo de un deportista.'));
         }
     } else {
         $data['title'] = $testName;
         return Redirect::to('test/' . $testName)->with(array('message' => 'El correo que ingresó no existe.'));
     }
 }