• R/O
  • HTTP
  • SSH
  • HTTPS

magic3: Commit

Cloud computing platform


Commit MetaInfo

Révision5f8cf3b0fe42591296867e04e340d33ef8c3bf8d (tree)
l'heure2017-11-10 14:11:04
Auteurnaoki hirata <naoki@magi...>
Commiternaoki hirata

Message de Log

Eコマース機能更新。

Change Summary

Modification

--- a/include/wp/plugins/woocommerce/includes/class-wc-session-handler.php
+++ b/include/wp/plugins/woocommerce/includes/class-wc-session-handler.php
@@ -18,19 +18,19 @@ if ( ! defined( 'ABSPATH' ) ) {
1818 class WC_Session_Handler extends WC_Session {
1919
2020 /** @var string cookie name */
21- private $_cookie;
21+// private $_cookie;
2222
2323 /** @var string session due to expire timestamp */
24- private $_session_expiring;
24+// private $_session_expiring;
2525
2626 /** @var string session expiration timestamp */
27- private $_session_expiration;
27+// private $_session_expiration;
2828
2929 /** $var bool Bool based on whether a cookie exists **/
30- private $_has_cookie = false;
30+// private $_has_cookie = false;
3131
3232 /** @var string Custom session table name */
33- private $_table;
33+// private $_table;
3434
3535 /**
3636 * Constructor for the session class.
@@ -38,10 +38,10 @@ class WC_Session_Handler extends WC_Session {
3838 public function __construct() {
3939 // global $wpdb;
4040
41- $this->_cookie = apply_filters( 'woocommerce_cookie', 'wp_woocommerce_session_' . COOKIEHASH );
41+// $this->_cookie = apply_filters( 'woocommerce_cookie', 'wp_woocommerce_session_' . COOKIEHASH );
4242 // $this->_table = $wpdb->prefix . 'woocommerce_sessions';
4343
44- if ( $cookie = $this->get_session_cookie() ) {
44+/* if ( $cookie = $this->get_session_cookie() ) {
4545 $this->_customer_id = $cookie[0];
4646 $this->_session_expiration = $cookie[1];
4747 $this->_session_expiring = $cookie[2];
@@ -55,7 +55,7 @@ class WC_Session_Handler extends WC_Session {
5555 } else {
5656 $this->set_session_expiration();
5757 $this->_customer_id = $this->generate_customer_id();
58- }
58+ }*/
5959
6060 // セッションからデータ読み込み
6161 //$this->_data = $this->get_session_data();
@@ -64,13 +64,13 @@ class WC_Session_Handler extends WC_Session {
6464 $this->_data = isset($sessionObj) ? $sessionObj : array();
6565
6666 // Actions
67- add_action( 'woocommerce_set_cart_cookies', array( $this, 'set_customer_session_cookie' ), 10 );
68- add_action( 'woocommerce_cleanup_sessions', array( $this, 'cleanup_sessions' ), 10 );
67+// add_action( 'woocommerce_set_cart_cookies', array( $this, 'set_customer_session_cookie' ), 10 );
68+// add_action( 'woocommerce_cleanup_sessions', array( $this, 'cleanup_sessions' ), 10 );
6969 // add_action( 'shutdown', array( $this, 'save_data' ), 20 );
70- add_action( 'wp_logout', array( $this, 'destroy_session' ) );
70+/* add_action( 'wp_logout', array( $this, 'destroy_session' ) );
7171 if ( ! is_user_logged_in() ) {
7272 add_filter( 'nonce_user_logged_out', array( $this, 'nonce_user_logged_out' ) );
73- }
73+ }*/
7474 }
7575
7676 /**
@@ -82,7 +82,7 @@ class WC_Session_Handler extends WC_Session {
8282 *
8383 * @param bool $set
8484 */
85- public function set_customer_session_cookie( $set ) {
85+/* public function set_customer_session_cookie( $set ) {
8686 if ( $set ) {
8787 // Set/renew our cookie
8888 $to_hash = $this->_customer_id . '|' . $this->_session_expiration;
@@ -93,24 +93,24 @@ class WC_Session_Handler extends WC_Session {
9393 // Set the cookie
9494 wc_setcookie( $this->_cookie, $cookie_value, $this->_session_expiration, apply_filters( 'wc_session_use_secure_cookie', false ) );
9595 }
96- }
96+ }*/
9797
9898 /**
9999 * Return true if the current user has an active session, i.e. a cookie to retrieve values.
100100 *
101101 * @return bool
102102 */
103- public function has_session() {
103+/* public function has_session() {
104104 return isset( $_COOKIE[ $this->_cookie ] ) || $this->_has_cookie || is_user_logged_in();
105- }
105+ }*/
106106
107107 /**
108108 * Set session expiration.
109109 */
110- public function set_session_expiration() {
110+/* public function set_session_expiration() {
111111 $this->_session_expiring = time() + intval( apply_filters( 'wc_session_expiring', 60 * 60 * 47 ) ); // 47 Hours.
112112 $this->_session_expiration = time() + intval( apply_filters( 'wc_session_expiration', 60 * 60 * 48 ) ); // 48 Hours.
113- }
113+ }*/
114114
115115 /**
116116 * Generate a unique customer ID for guests, or return user ID if logged in.
@@ -119,7 +119,7 @@ class WC_Session_Handler extends WC_Session {
119119 *
120120 * @return int|string
121121 */
122- public function generate_customer_id() {
122+/* public function generate_customer_id() {
123123 if ( is_user_logged_in() ) {
124124 return get_current_user_id();
125125 } else {
@@ -127,14 +127,14 @@ class WC_Session_Handler extends WC_Session {
127127 $hasher = new PasswordHash( 8, false );
128128 return md5( $hasher->get_random_bytes( 32 ) );
129129 }
130- }
130+ }*/
131131
132132 /**
133133 * Get session cookie.
134134 *
135135 * @return bool|array
136136 */
137- public function get_session_cookie() {
137+/* public function get_session_cookie() {
138138 if ( empty( $_COOKIE[ $this->_cookie ] ) || ! is_string( $_COOKIE[ $this->_cookie ] ) ) {
139139 return false;
140140 }
@@ -150,7 +150,7 @@ class WC_Session_Handler extends WC_Session {
150150 }
151151
152152 return array( $customer_id, $session_expiration, $session_expiring, $cookie_hash );
153- }
153+ }*/
154154
155155 /**
156156 * Get session data.
@@ -203,7 +203,7 @@ class WC_Session_Handler extends WC_Session {
203203 /**
204204 * Destroy all session data.
205205 */
206- public function destroy_session() {
206+/* public function destroy_session() {
207207 // Clear cookie
208208 wc_setcookie( $this->_cookie, '', time() - YEAR_IN_SECONDS, apply_filters( 'wc_session_use_secure_cookie', false ) );
209209
@@ -216,7 +216,7 @@ class WC_Session_Handler extends WC_Session {
216216 $this->_data = array();
217217 $this->_dirty = false;
218218 $this->_customer_id = $this->generate_customer_id();
219- }
219+ }*/
220220
221221 /**
222222 * When a user is logged out, ensure they have a unique nonce by using the customer/session ID.
@@ -225,14 +225,14 @@ class WC_Session_Handler extends WC_Session {
225225 *
226226 * @return string
227227 */
228- public function nonce_user_logged_out( $uid ) {
228+/* public function nonce_user_logged_out( $uid ) {
229229 return $this->has_session() && $this->_customer_id ? $this->_customer_id : $uid;
230- }
230+ }*/
231231
232232 /**
233233 * Cleanup sessions.
234234 */
235- public function cleanup_sessions() {
235+/* public function cleanup_sessions() {
236236 global $wpdb;
237237
238238 if ( ! defined( 'WP_SETUP_CONFIG' ) && ! defined( 'WP_INSTALLING' ) ) {
@@ -243,7 +243,7 @@ class WC_Session_Handler extends WC_Session {
243243 // Invalidate cache
244244 WC_Cache_Helper::incr_cache_prefix( WC_SESSION_CACHE_GROUP );
245245 }
246- }
246+ }*/
247247
248248 /**
249249 * Returns the session.
@@ -252,7 +252,7 @@ class WC_Session_Handler extends WC_Session {
252252 * @param mixed $default
253253 * @return string|array
254254 */
255- public function get_session( $customer_id, $default = false ) {
255+/* public function get_session( $customer_id, $default = false ) {
256256 global $wpdb;
257257
258258 if ( defined( 'WP_SETUP_CONFIG' ) ) {
@@ -273,14 +273,14 @@ class WC_Session_Handler extends WC_Session {
273273 }
274274
275275 return maybe_unserialize( $value );
276- }
276+ }*/
277277
278278 /**
279279 * Delete the session from the cache and database.
280280 *
281281 * @param int $customer_id
282282 */
283- public function delete_session( $customer_id ) {
283+/* public function delete_session( $customer_id ) {
284284 global $wpdb;
285285
286286 // wp_cache_delete( $this->get_cache_prefix() . $customer_id, WC_SESSION_CACHE_GROUP );
@@ -292,14 +292,14 @@ class WC_Session_Handler extends WC_Session {
292292 )
293293 );
294294 }
295-
295+*/
296296 /**
297297 * Update the session expiry timestamp.
298298 *
299299 * @param string $customer_id
300300 * @param int $timestamp
301301 */
302- public function update_session_timestamp( $customer_id, $timestamp ) {
302+/* public function update_session_timestamp( $customer_id, $timestamp ) {
303303 global $wpdb;
304304
305305 $wpdb->update(
@@ -314,7 +314,7 @@ class WC_Session_Handler extends WC_Session {
314314 '%d'
315315 )
316316 );
317- }
317+ }*/
318318 /**
319319 * セッションオブジェクト取得(Magic3追加)
320320 *
Afficher sur ancien navigateur de dépôt.