/**
  * Show the login form
  *
  * @return mixed
  */
 public function getIndex()
 {
     if ($this->request->ajax()) {
         $this->session->forget('url.intended');
     }
     return View::make('auth.login');
 }
Exemple #2
0
 /**
  * Sets the location property to the drivers returned location object.
  *
  * @param string $ip
  */
 private function setLocation($ip = '')
 {
     // The location session key.
     $key = 'location';
     // Removes location from the session if config option is set
     if ($this->localHostForgetLocation()) {
         $this->session->forget($key);
     }
     // Check if the location has already been set in the current session
     if ($this->session->has($key)) {
         // Set the current driver to the current session location
         $this->location = $this->session->get($key);
     } else {
         $this->setIp($ip);
         $this->location = $this->driver->get($this->ip);
         // The locations object property 'error' will be true if an
         // exception has occurred trying to grab the location
         // from the driver. Let's try retrieving the
         // location from one of our fall-backs
         if ($this->location->error) {
             $this->location = $this->getLocationFromFallback();
         }
         $this->session->set($key, $this->location);
     }
 }
 /**
  * The GET method that runs when a user needs to download a file
  *
  * @return JSON
  */
 public function fileDownload()
 {
     if ($response = $this->session->get('administrator_download_response')) {
         $this->session->forget('administrator_download_response');
         $filename = substr($response['headers']['content-disposition'][0], 22, -1);
         return response()->download($response['file'], $filename, $response['headers']);
     } else {
         return redirect()->back();
     }
 }
 /**
  * {@inheritdoc}
  *
  * @see BaseFacebook::clearPersistentData()
  */
 protected function clearPersistentData($key)
 {
     if (!in_array($key, self::$kSupportedKeys)) {
         self::errorLog('Unsupported key passed to clearPersistentData.');
         return;
     }
     $session_var_name = $this->constructSessionVariableName($key);
     if ($this->laravelSession->has($session_var_name)) {
         $this->laravelSession->forget($session_var_name);
     }
 }
Exemple #5
0
 /**
  * Get all alert from session flash
  * @return void
  */
 public function getExisting()
 {
     // Create message bag
     if (!$this->bag) {
         $this->bag = new MessageBag();
     }
     // Get messges from flash
     $flash = $this->session->get(self::SESSION_KEY);
     // Add Laravel errors
     if ($errors = $this->session->get('errors')) {
         foreach ($errors->all() as $error) {
             $this->bag->add('error', $error);
         }
     }
     if ($flash) {
         foreach ($flash as $type => $alerts) {
             if (is_array($alerts) and count($alerts)) {
                 foreach ($alerts as $alert) {
                     $this->bag->add($type, $alert);
                 }
             }
         }
     }
     foreach (array('success', 'error', 'warning') as $key) {
         if ($message = $this->session->get($key)) {
             // Get type
             $type = $key;
             if (!$type) {
                 $type = 'info';
             }
             // Add the message
             $this->bag->add($type, $message);
             // And remove from flash
             $this->session->forget($key);
         }
     }
 }
Exemple #6
0
 /**
  * Sets the location property to the drivers returned location object.
  *
  * @param string $ip
  */
 private function setLocation($ip = '')
 {
     /*
      * Removes location from the session if config option is set
      */
     if ($this->localHostForgetLocation()) {
         $this->session->forget('location');
     }
     /*
      * Check if the location has already been set in the current session
      */
     if ($this->session->has('location')) {
         /*
          * Set the current driver to the current session location
          */
         $this->location = $this->session->get('location');
     } else {
         /*
          * Set the IP
          */
         $this->setIp($ip);
         /*
          * Set the location
          */
         $this->location = $this->driver->get($this->ip);
         /*
          * The locations object property 'error' will be true if an exception has
          * occurred trying to grab the location from the driver. Let's
          * try retrieving the location from one of our fall-backs
          */
         if ($this->location->error) {
             $this->location = $this->getLocationFromFallback();
         }
         $this->session->set('location', $this->location);
     }
 }
 /**
  * Remove a key from storage.
  *
  * @param string $key The key to remove.
  *
  * @return null
  */
 public function remove($key)
 {
     $this->session->forget($this->storageKey . '.' . $key);
     return null;
 }
 /**
  * Clear all the cart session data
  * @return boolean
  */
 public function clear()
 {
     return $this->session->forget(config('sescart.session_name'));
 }