Esempio n. 1
0
 /**
  * 后台退出登陆
  *
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function logout()
 {
     Session::remove('admin_id');
     Session::remove('admin_user');
     Session::remove('admin_level');
     return redirect('admin/login');
 }
Esempio n. 2
0
 public function handle($request, Closure $next)
 {
     $uid = Session::get('admin_id');
     $level = Session::get('admin_level');
     if (AdminUser::find($uid ? $uid : 0) and $level == 1) {
         return $next($request);
     } else {
         Session::remove('admin_id');
         Session::remove('admin_user');
         Session::remove('admin_level');
         return redirect('admin/login');
     }
 }
 public function place(Order $orderModel, OrderItem $orderItem)
 {
     if (!Session::has('cart')) {
         return 'false';
     }
     $cart = Session::get('cart');
     if ($cart->getTotal() > 0) {
         $order = $orderModel->create(['user_id' => Auth::user()->id, 'total' => $cart->getTotal()]);
         foreach ($cart->all() as $key => $item) {
             $order->items()->create(['product_id' => $key, 'price' => $item['price'], 'qtd' => $item['qtd']]);
         }
     }
     Session::remove('cart');
     return redirect()->route('store.index');
 }
Esempio n. 4
0
 function postLogin()
 {
     $user = User::where('password', '=', Input::get('password'))->where('username', '=', Input::get('username'))->get()->first();
     if ($user == null) {
         Session::flash('message', 'Sorry, the details you entered could not be validated, please try again or contact support on +61 8 6102 5117');
         return Redirect::to('/admin-login');
     }
     Auth::login($user);
     $cookie = self::newCookie($user);
     if (Session::has('return_url')) {
         $ret = Session::get('return_url');
         Session::remove('return_url');
         return Redirect::to($ret)->withCookie($cookie);
     }
     return Redirect::to('/admin')->withCookie($cookie);
 }
Esempio n. 5
0
 public static function remove()
 {
     return Session::remove(self::$name);
 }
Esempio n. 6
0
 /**
  * @return RedirectResponse
  */
 public function logout()
 {
     Session::remove('exam_attendee_login');
     return redirect()->route('examLogin');
 }
Esempio n. 7
0
 public function logout()
 {
     Session::remove('uid');
     Session::remove('username');
     return redirect('login');
 }
Esempio n. 8
0
 /**
  * Remove a key from storage.
  *
  * @param string $key The key to remove.
  *
  * @return null
  */
 public function remove($key)
 {
     Session::remove($key);
 }
Esempio n. 9
0
 /**
  * Logout from social accounts
  */
 public function logout()
 {
     $this->hybridAuth->logoutAllProviders();
     Session::remove('SocialAuth::profile');
     Session::remove('SocialAuth::provider');
 }