17 nov 2018

This commit is contained in:
Kevin Adametz 2018-11-17 02:03:59 +01:00
parent 0c9a118281
commit 765d6a2f6b
52 changed files with 3200 additions and 229 deletions

View file

@ -66,7 +66,7 @@ class HomeController extends Controller
abort(404);
}
public function checkLogin($identify, $token)
public function checkLogin($identify, $token, $show = false)
{
if($identify){
//user find by $identify
@ -96,14 +96,27 @@ class HomeController extends Controller
$sf_guard_user->token = null;
$sf_guard_user->token_at = null;
$sf_guard_user->save();
if(!Auth::check()){
$user->last_login = now();
$user->save();
Auth::login($user);
}
if(Auth::check()){
return redirect(route('drafts'));
if(!$show){
return redirect(route('home'));
}
if($show == 'drafts'){
return redirect(route('drafts'));
}
if(strpos($show, 'drafts_edit_booking_') !== false){
$booking_id = str_replace('drafts_edit_booking_', '', $show);
return redirect(route('booking_detail', [$booking_id]));
}
}
}
return abort(404);
}