コード例 #1
0
ファイル: ProfileController.php プロジェクト: ebuzz/SAPE_CAR
 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);
 }
コード例 #2
0
ファイル: view.html.php プロジェクト: joshjim27/jobsglobal
 /**
  *	Method to add a toolbar
  */
 protected function addToolbar()
 {
     $state = $this->get('State');
     $canDo = ProfileHelper::getActions();
     $user = JFactory::getUser();
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     JToolBarHelper::title(JText::_('COM_PROFILE'));
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_profile');
     }
 }
コード例 #3
0
ファイル: TestController.php プロジェクト: ebuzz/SAPE_CAR
 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.'));
     }
 }
コード例 #4
0
ファイル: controller.php プロジェクト: joshjim27/jobsglobal
 /**
  * Checks whether a user can see this view.
  *
  * @param   string	$view	The view name.
  *
  * @return  boolean
  * @since   1.6
  */
 protected function canView($view)
 {
     $canDo = ProfileHelper::getActions();
     return $canDo->get('core.admin');
 }