예제 #1
0
 public function showWellcome()
 {
     if (Cas::isAuthenticated() == false) {
         Auth::logout();
         return View::make('wellcome');
     }
     if (Auth::check() == true) {
         $sgrUser = new sgrUser(Auth::user());
         return Redirect::to($sgrUser->home());
     }
     return View::make('wellcome');
 }
예제 #2
0
 /**
  * // logout sso | logout SGR 
  */
 public function doLogout()
 {
     if (Cas::isAuthenticated()) {
         Cas::logout();
     } else {
         Auth::logout();
         return View::make('wellcome');
     }
 }
예제 #3
0
});
App::after(function ($request, $response) {
    //
});
/*
|--------------------------------------------------------------------------
| Authentication Filters
|--------------------------------------------------------------------------
|
| The following filters are used to verify that the user of the current
| session is logged into this application. The "basic" filter easily
| integrates HTTP Basic authentication for quick, simple checking.
|
*/
Route::filter('auth', function () {
    if (!Cas::isAuthenticated() || !Auth::check()) {
        if (Request::ajax()) {
            return Response::make('Necesitas iniciar sesión de nuevo. Por favor, recarga la página', 401);
        } else {
            return Redirect::to(route('wellcome'));
        }
    }
});
//Comprueba si la petición se realizó por ajax
Route::filter('ajax_check', function () {
    if (!Request::ajax()) {
        return Redirect::to(route('wellcome'));
    }
});
//Comprobar si el usuario autentivcado tiene privilegios para realizar la acción requerida
Route::filter('capacidad', function ($ruta, $peticion, $capacidad, $redirect) {