コード例 #1
0
 /**
  * Remove item of the cart.
  *
  * @param $id
  * @return \Illuminate\Http\RedirectResponse
  */
 public function destroy($id)
 {
     $cart = $this->getCart();
     $cart->remove($id);
     $this->session->set('cart', $cart);
     return redirect()->route('cart');
 }
コード例 #2
0
 /**
  * @return array
  */
 public function processDataOfBirth()
 {
     // Get the date of birth that the user submitted
     $dob = null;
     if ($this->request->has('dob')) {
         // field name is dob when using input type date
         $dob = $this->request->get('dob');
     } elseif ($this->request->has('dob_year') && $this->request->has('dob_month') && $this->request->has('dob_day')) {
         // field name has _year, _month and _day components if input type select
         $dob = $this->request->get('dob_year') . '-' . $this->request->get('dob_month') . '-' . $this->request->get('dob_day');
     }
     $remember_me = false;
     if ($this->request->get('remember_me') == "on") {
         $this->session->set('remembered_day', $this->request->get('dob_day'));
         $this->session->set('remembered_month', $this->request->get('dob_month'));
         $this->session->set('remembered_year', $this->request->get('dob_year'));
         $this->session->set('remember_me', "on");
         $remember_me = true;
     } else {
         $this->session->remove('remembered_day');
         $this->session->remove('remembered_month');
         $this->session->remove('remembered_year');
         $this->session->remove('remember_me');
     }
     // return in an array for validator
     return ['dob' => $dob, 'remember' => $remember_me];
 }
コード例 #3
0
 /**
  * Handle the event.
  */
 public function handle()
 {
     if (!$this->config->get('app.debug') && !$this->session->get(__CLASS__ . 'warned') && $this->request->path() == 'admin/dashboard' && $this->modules->get('anomaly.module.installer')) {
         $this->session->set(__CLASS__ . 'warned', true);
         $this->messages->error('streams::message.delete_installer');
     }
 }
コード例 #4
0
 /**
  * This is what happens, wenn the detection passes
  *
  * @param $lookup
  *
  * @return mixed
  */
 protected function handleDetectionComplete($lookup)
 {
     debugger()->info('Language detected: ' . $this->detected->slug);
     Cookie::queue($this->keys['cookie'], $this->detected->slug);
     $this->session->set($this->keys['session'], $this->detected->slug);
     $this->config->set('app.locale', $this->detected->slug);
     return $this->detected;
 }
コード例 #5
0
ファイル: SharpAuth.php プロジェクト: dvlpp/sharp
 public function login($login, $password)
 {
     if ($login == $this->config->get("sharp.auth_user") && $password == $this->config->get("sharp.auth_pwd")) {
         $this->session->set("sharp_user", $login);
         return $login;
     }
     $this->logout();
     return false;
 }
コード例 #6
0
 /**
  * Merge a message onto the session.
  *
  * @param $type
  * @param $message
  */
 protected function merge($type, $message)
 {
     $messages = $this->session->get($type, []);
     if (is_array($message)) {
         $messages = array_merge($messages, $message);
     }
     if (is_string($message)) {
         array_push($messages, $message);
     }
     $messages = array_unique($messages);
     $this->session->set($type, $messages);
 }
コード例 #7
0
 /**
  * Retrieve a user by the given credentials.
  *
  * @param  array  $credentials
  * @return \Illuminate\Auth\UserInterface|null
  */
 public function retrieveByCredentials(array $credentials)
 {
     $username = $credentials[$this->params['identifier']];
     $imap = @\imap_open($this->params['datasource'], $username, $credentials['password']);
     if (false !== $imap) {
         $credentials['id'] = $username;
         $user = new $this->model($credentials);
         $this->session->set('user.current', $user);
         return $user;
     }
     return null;
 }
コード例 #8
0
ファイル: SettingController.php プロジェクト: Houbsi/Setting
 public function getModuleSettings(Module $currentModule)
 {
     $this->assetPipeline->requireJs('selectize.js');
     $this->assetPipeline->requireCss('selectize.css');
     $this->assetPipeline->requireCss('selectize-default.css');
     $this->session->set('module', $currentModule->getLowerName());
     $modulesWithSettings = $this->setting->moduleSettings($this->module->enabled());
     $translatableSettings = $this->setting->translatableModuleSettings($currentModule->getLowerName());
     $plainSettings = $this->setting->plainModuleSettings($currentModule->getLowerName());
     $dbSettings = $this->setting->savedModuleSettings($currentModule->getLowerName());
     return view('setting::admin.module-settings', compact('currentModule', 'translatableSettings', 'plainSettings', 'dbSettings', 'modulesWithSettings'));
 }
コード例 #9
0
 public function authorize()
 {
     $authorizationUrl = $this->provider->getAuthorizationUrl();
     $this->session->set($this->getSessionStateName(), $this->provider->getState());
     $this->session->reflash();
     return Redirect::to($authorizationUrl);
 }
コード例 #10
0
 /**
  * @param Store $session
  * @param Request $request
  * @param AccountManager $accounts
  * @return \Illuminate\Http\RedirectResponse
  */
 public function locale(Store $session, Request $request, AccountManager $accounts)
 {
     $account = $accounts->account();
     if ($request->has('locale') && $this->is_account_locale($account, $request->get('locale'))) {
         $session->set('locale', $request->get('locale'));
         return redirect()->to('/' . $request->get('locale'));
     }
     return redirect()->to(store_route('store.home'));
 }
コード例 #11
0
ファイル: Clerk.php プロジェクト: hughgrigg/ching-shop
 /**
  * Ensure the basket is stored with current user_id and noted in the
  * session.
  */
 public function saveBasket()
 {
     if ($this->guard->user() instanceof User && $this->guard->user()->getAuthIdentifier()) {
         $this->basket->user_id = $this->guard->user()->getAuthIdentifier();
     }
     if (!$this->basket->deleted_at) {
         $this->basket->save();
     }
     $this->session->set(self::SESSION_BASKET, $this->basket->id);
 }
コード例 #12
0
 /**
  * @param GatewayInterface $gateway
  * @param Store $session
  * @param Dispatcher $dispatcher
  * @return mixed
  * @throws TransactionFailedException
  */
 public function handle(GatewayInterface $gateway, Store $session, Dispatcher $dispatcher)
 {
     $session->set('params', $this->details());
     $response = $gateway->purchase($this->details())->send();
     if ($response->isRedirect()) {
         // redirect to offsite payment gateway
         $dispatcher->fire(new TransactionRedirect($response->getMessage()));
         return $response->getRedirectUrl();
     } else {
         $dispatcher->fire(new TransactionFailed($response->getMessage(), $response->getTransactionReference()));
         throw new TransactionFailedException($response->getMessage());
     }
 }
コード例 #13
0
 /**
  * @param array $config
  * @param array $databaseConfig
  *
  * @return array
  * @throws InstallException
  */
 public function install(array $config, array $databaseConfig)
 {
     if (isset($config['password_generate'])) {
         $config['password_field'] = str_random();
     }
     date_default_timezone_set($config['timezone']);
     $this->session->set(static::POST_DATA_KEY, $config);
     $this->session->set(static::POST_DATABASE_KEY, $databaseConfig);
     $this->validation = $this->checkPostData($config);
     $databaseConfig = $this->configDBConnection($databaseConfig, 'driver', 'database');
     $this->connection = $this->createDBConnection($databaseConfig);
     foreach ($databaseConfig as $key => $value) {
         $config['db_' . $key] = $value;
     }
     $this->createEnvironmentFile($config);
     $this->databaseDrop();
     $this->initModules();
     $this->databaseMigrate();
     $this->databaseSeed();
     $this->createAdmin($config);
     return $config;
 }
コード例 #14
0
ファイル: SessionHandler.php プロジェクト: mcarral/html
 /**
  * Clear all the messages from the session.
  * Useful once the messages has been rendered.
  */
 public function clean()
 {
     $this->session->set($this->key, null);
 }
コード例 #15
0
 function it_can_put_items_in_the_store_on_a_specific_key(Store $store)
 {
     $notifications = [];
     $store->set('my-key.new', $notifications)->shouldBeCalled();
     $this->put('my-key.new', $notifications);
 }
コード例 #16
0
ファイル: InstallController.php プロジェクト: cocona/core
 /**
  * @param $step
  */
 protected function step($step)
 {
     $this->session->set('cocona.installer.step', $step);
 }
コード例 #17
0
 /**
  * Save network volumes config.
  *
  * @param  array $volumes volumes config
  *
  * @return void
  * @author Dmitry (dio) Levashov
  */
 protected function saveNetVolumes(array $volumes)
 {
     $this->session->set(static::SESSION_NET_VOLUMES, $volumes);
 }
コード例 #18
0
 /**
  * {@inheritdoc}
  */
 public function set($key, $data)
 {
     $this->store->set($key, $data);
     return $this;
 }
コード例 #19
0
ファイル: QueryState.php プロジェクト: GlobalsDD/admin
 /**
  * Save current query parameters in session
  */
 public function save()
 {
     $this->session->set($this->getSessionVarName(), $this->request->query());
 }
コード例 #20
0
ファイル: CheckoutSpec.php プロジェクト: spatie/checkout
 function it_stores_an_orderId(Store $session)
 {
     $session->set($this->sessionParameterName, $this->testOrderId)->shouldBeCalled();
     $this->setCurrentOrderId($this->testOrderId);
 }
コード例 #21
0
 /**
  * @param string $key
  * @param array $notifications
  * @return void
  */
 public function put($key, array $notifications)
 {
     $this->store->set($key, $notifications);
 }
コード例 #22
0
ファイル: GeoIP.php プロジェクト: arslannaseem/notasoft
 /**
  * Save location data in the session.
  *
  * @return void
  */
 function saveLocation()
 {
     $this->session->set('geoip-location', $this->location);
 }
コード例 #23
0
 /**
  * @param Store   $session
  * @param Request $request
  */
 public function handle(Store $session, Request $request)
 {
     $session->set('table::' . $request->url(), $request->getQueryString());
 }
コード例 #24
0
ファイル: Checkout.php プロジェクト: spatie/checkout
 /**
  * Set the current order id.
  *
  * @param $orderId
  */
 public function setCurrentOrderId($orderId)
 {
     $this->session->set($this->sessionVariableName, $orderId);
 }
コード例 #25
0
ファイル: Filter.php プロジェクト: artissant/stock
 /**
  * Update the stored data.
  *
  * @return void
  */
 protected function _updateStore()
 {
     $this->session->set($this->getStoreKey(), ['page' => $this->page ?: null, 'perPage' => $this->perPage ?: null, 'pageName' => $this->pageName, 'perPageName' => $this->perPageName, 'queries' => $this->queries ?: []]);
 }
コード例 #26
0
 /**
  * Clear the collection and return all the alerts.
  *
  * @return array
  */
 public function all()
 {
     $all = $this->prepareAndGet()->all();
     $this->session->set('chromabits.alerts', new Collection());
     return $all;
 }
コード例 #27
0
ファイル: Lock.php プロジェクト: codenamegary/l4-lock
 /**
  * Adds a value to the session using the lock's $sessionKey property
  * as a prefix.
  * 
  * @param string $key
  * @param mixed $value
  * @return codenamegary\Lock\Lock
  */
 protected function putSession($key, $value)
 {
     $this->session->set($this->sessionKey . '.' . $key, $value);
     return $this;
 }
コード例 #28
0
ファイル: EdificeTestCase.php プロジェクト: lionart/edifice
 protected function putErrorInSession($messages)
 {
     $errors = new MessageBag($messages);
     $this->session->set('errors', $errors);
 }
コード例 #29
0
ファイル: _ide_helper.php プロジェクト: satriashp/tour
 /**
  * Sets an attribute.
  *
  * @param string $name
  * @param mixed $value
  * @static 
  */
 public static function set($name, $value)
 {
     return \Illuminate\Session\Store::set($name, $value);
 }
コード例 #30
0
 /**
  * Recent / Providers
  * @param $provider
  * @param $data
  */
 public function setAuthData($provider, $data)
 {
     $this->session->set('__sp_auth.r', $provider);
     $this->session->set('__sp_auth.p.' . $provider, array_merge(['provider' => $provider], $data));
     $this->session->save();
 }