From 09ab8c15ee26663bb02a012c4a73f2630b5d59d8 Mon Sep 17 00:00:00 2001 From: www Date: Wed, 18 Feb 2015 01:23:17 +0100 Subject: [PATCH] modified: .bash_history modified: SRC/app/Http/Middleware/RedirectIfNotAdmin.php --- .bash_history | 2 ++ SRC/app/Http/Middleware/RedirectIfNotAdmin.php | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/.bash_history b/.bash_history index af6040f..df555c9 100755 --- a/.bash_history +++ b/.bash_history @@ -80,3 +80,5 @@ exit cd .. ls nano loadCSVAugustin2014.py +git pull +exit diff --git a/SRC/app/Http/Middleware/RedirectIfNotAdmin.php b/SRC/app/Http/Middleware/RedirectIfNotAdmin.php index 6854a90..dffb351 100644 --- a/SRC/app/Http/Middleware/RedirectIfNotAdmin.php +++ b/SRC/app/Http/Middleware/RedirectIfNotAdmin.php @@ -35,6 +35,15 @@ class RedirectIfNotAdmin { */ public function handle($request, Closure $next) { + //Retour d'un admin loguer comme un referent + if($this->auth->check() AND Session::has('admin')) + { + Auth::logout(); + Auth::loginUsingId(Session::get('admin')); + Session::forget('admin'); + } + + //verification de l'identité de l'admin if (!$this->auth->check() OR Auth::user()->droits == 0) { return new RedirectResponse(url('/login'));