コード例 #1
0
 /**
  * Provides the implementations of the inherited abstract
  * methods.  The implementation uses PHP sessions to maintain
  * a store for authorization codes, user ids, CSRF states, and
  * access tokens.
  */
 protected function setPersistentData($key, $value)
 {
     if (!in_array($key, self::$kSupportedKeys)) {
         self::errorLog('Unsupported key passed to setPersistentData.');
         return;
     }
     $session_var_name = $this->constructSessionVariableName($key);
     Session::put($session_var_name, $value);
 }
コード例 #2
0
 private function loadQuote(Quotation $quote)
 {
     // Find layout
     $layout = Layout::find($quote->quotation_layouts_id);
     $customer = Customer::find($quote->customer_id);
     // Init
     \Laravel\Session::put('quote_id', $quote->id);
     \Laravel\Session::put('quote_email', $customer->email);
     \Laravel\Session::put('quote_layout', $layout);
     \Laravel\Session::put('quote_layout_id', $layout->id);
     \Laravel\Session::put('quote_size', $layout->size_x . 'x' . $layout->size_y);
     \Laravel\Session::put('quote_postcode', $quote->postcode);
     //Customise
     \Laravel\Session::put('quote_customise_swap_window', $quote->quote_customise_swap_window);
     \Laravel\Session::put('quote_customise_swap_wall', $quote->quote_customise_swap_wall);
     \Laravel\Session::put('quote_customise_extra_door', $quote->quote_customise_extra_door);
     \Laravel\Session::put('quote_customise_fanlight', $quote->quote_customise_fanlight);
     \Laravel\Session::put('quote_customise_half_window', $quote->quote_customise_half_window);
     \Laravel\Session::put('quote_customise_picture_window', $quote->quote_customise_picture_window);
     //Decking & floyover
     \Laravel\Session::put('quote_decking_composite_deck_910_910', $quote->quote_decking_composite_deck_910_910);
     \Laravel\Session::put('quote_decking_composite_deck_910_1820', $quote->quote_decking_composite_deck_910_1820);
     \Laravel\Session::put('quote_decking_composite_deck_910_2730', $quote->quote_decking_composite_deck_910_2730);
     \Laravel\Session::put('quote_decking_flyover_roof_910_910', $quote->quote_decking_flyover_roof_910_910);
     \Laravel\Session::put('quote_decking_flyover_roof_910_1820', $quote->quote_decking_flyover_roof_910_1820);
     \Laravel\Session::put('quote_decking_flyover_roof_910_2730', $quote->quote_decking_flyover_roof_910_2730);
     // Electrics
     \Laravel\Session::put('quote_electrics_double_sockets_450', $quote->quote_electrics_double_sockets_450);
     \Laravel\Session::put('quote_electrics_double_sockets_1150', $quote->quote_electrics_double_sockets_1150);
     \Laravel\Session::put('quote_electrics_light_switch', $quote->quote_electrics_light_switch);
     \Laravel\Session::put('quote_electrics_panel_heater', $quote->quote_electrics_panel_heater);
     \Laravel\Session::put('quote_electrics_double_floor_socket', $quote->quote_electrics_double_floor_socket);
     \Laravel\Session::put('quote_electrics_fused_spur_socket', $quote->quote_electrics_fused_spur_socket);
     // Internals
     \Laravel\Session::put('quote_internals_silver_aluminium_venitian_blind_no_screws', $quote->quote_internals_silver_aluminium_venitian_blind_no_screws);
     \Laravel\Session::put('quote_internals_recessed_blinds', $quote->quote_internals_recessed_blinds);
     \Laravel\Session::put('quote_internals_internal_910_partition_wall', $quote->quote_internals_internal_910_partition_wall);
     \Laravel\Session::put('quote_internals_internal_door_dividing_studio', $quote->quote_internals_internal_door_dividing_studio);
     \Laravel\Session::put('quote_internals_internal_wall_corner_post', $quote->quote_internals_internal_wall_corner_post);
     // Other
     \Laravel\Session::put('quote_other_decoupled_floor', $quote->quote_other_decoupled_floor);
     \Laravel\Session::put('quote_other_aquastep_oak_floor', $quote->quote_other_aquastep_oak_floor);
     \Laravel\Session::put('quote_other_walls_to_timber', $quote->quote_other_walls_to_timber);
     \Laravel\Session::put('quote_other_taller_walls', $quote->quote_other_taller_walls);
     \Laravel\Session::put('quote_other_entry_steps', $quote->quote_other_entry_steps);
     \Laravel\Session::put('quote_other_entry_handrail', $quote->quote_other_entry_handrail);
     \Laravel\Session::put('quote_other_skirt', $quote->quote_other_skirt);
 }
コード例 #3
0
ファイル: driver.php プロジェクト: albertpaulp/PrettyBoot
 /**
  * Store a user's token in the session.
  *
  * @param  string  $token
  * @return void
  */
 protected function store($token)
 {
     Session::put($this->token(), $token);
 }
コード例 #4
0
 /**
  * {@inheritdoc}
  * */
 public function set($name, $value)
 {
     Session::put($this->namespace, [$name => $value]);
 }
コード例 #5
0
ファイル: form.php プロジェクト: reith2004/components
 /**
  * Serialize the model's field data to the session.
  */
 private static function serialize_to_session()
 {
     Session::put('serialized_field_data[' . get_called_class() . ']', serialize(static::$field_data));
 }
コード例 #6
0
ファイル: cart.php プロジェクト: TahsinGokalp/L3-Eticaret
 /**
  * Updates the cart session.
  *
  * @access   protected
  * @return   boolean
  */
 protected function update_cart()
 {
     //
     //
     array_set($this->cart_contents, $this->cart_name . '.total_items', 0);
     array_set($this->cart_contents, $this->cart_name . '.cart_total', 0);
     // Loop through the cart items.
     //
     foreach (array_get($this->cart_contents, $this->cart_name) as $rowid => $item) {
         // Make sure the array contains the proper indexes.
         //
         if (!is_array($item) or !isset($item['price']) or !isset($item['qty'])) {
             continue;
         }
         // Calculations...
         //
         $this->cart_contents[$this->cart_name]['cart_total'] += $item['price'] * $item['qty'];
         $this->cart_contents[$this->cart_name]['total_items'] += $item['qty'];
         // Calculate the item subtotal.
         //
         $subtotal = array_get($this->cart_contents, $this->cart_name . '.' . $rowid . '.price') * array_get($this->cart_contents, $this->cart_name . '.' . $rowid . '.qty');
         // Set the subtotal of this item.
         //
         array_set($this->cart_contents, $this->cart_name . '.' . $rowid . '.subtotal', $subtotal);
     }
     // Is our cart empty?
     //
     if (count(array_get($this->cart_contents, $this->cart_name)) <= 2) {
         // If so we delete it from the session.
         //
         $this->destroy();
         // Nothing more to do here...
         //
         return false;
     }
     // Update the cart session data.
     //
     Session::put($this->cart_name, array_get($this->cart_contents, $this->cart_name));
     // Success.
     //
     return true;
 }
コード例 #7
0
ファイル: CloudAuth.php プロジェクト: cloudmanic/php-warchest
 public static function auth($email, $pass)
 {
     // Get user by email.
     if (!($user = Users::get_by_email($email))) {
         return false;
     }
     // Make sure the password is correct.
     if (Hash::check($pass, $user['UsersPassword'])) {
         self::_do_user($user);
         Session::put('AccessToken', Users::get_access_token($user['UsersId']));
         // Get the default AccountId
         \AcctsUsersLu::set_col('AcctsUsersLuUserId', $user['UsersId']);
         \AcctsUsersLu::set_order('AcctsUsersLuAcctId');
         \AcctsUsersLu::set_limit(1);
         $lp = \AcctsUsersLu::get();
         // Make sure we have at least one account.
         if (!isset($lp[0])) {
             return false;
         }
         // Set default account
         Session::put('AccountId', $lp[0]['AcctsUsersLuAcctId']);
         return true;
     }
     return false;
 }