Changeset 2644077
- Timestamp:
- 12/14/2021 06:10:07 PM (4 years ago)
- Location:
- temple-lock/trunk
- Files:
-
- 7 edited
-
.git/FETCH_HEAD (modified) (1 diff)
-
.git/ORIG_HEAD (modified) (1 diff)
-
.git/index (modified) (previous)
-
.git/logs/HEAD (modified) (1 diff)
-
.git/logs/refs/heads/master (modified) (1 diff)
-
.git/refs/heads/master (modified) (1 diff)
-
includes/Base/ContentLock.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
temple-lock/trunk/.git/FETCH_HEAD
r2642798 r2644077 1 0b530117af665ae3f51d017c34e058023bde618abranch 'master' of bitbucket.org:iclicksee/temple-wordpress1 14e45e400b5ce17366c99d9ded76a49222c87ecc branch 'master' of bitbucket.org:iclicksee/temple-wordpress 2 2 e703fbb0eeb84681556060bfaa7de05ed607248c not-for-merge branch 'nick_rubitva' of bitbucket.org:iclicksee/temple-wordpress 3 3 68841ee4e122983de330b94bc5c69dc249d4e6bb not-for-merge branch 'temple-wp-updates' of bitbucket.org:iclicksee/temple-wordpress -
temple-lock/trunk/.git/ORIG_HEAD
r2642798 r2644077 1 a4f2aecac0c8d3f7cd774717a92d51d97b5f5344 1 0b530117af665ae3f51d017c34e058023bde618a -
temple-lock/trunk/.git/logs/HEAD
r2642798 r2644077 9 9 5ebaab32419a3558484470f8db66f36b082a2dc4 a4f2aecac0c8d3f7cd774717a92d51d97b5f5344 Sean Facer <facer.sean@gmail.com> 1639229222 +0000 pull: Fast-forward 10 10 a4f2aecac0c8d3f7cd774717a92d51d97b5f5344 0b530117af665ae3f51d017c34e058023bde618a Sean Facer <facer.sean@gmail.com> 1639229783 +0000 pull: Fast-forward 11 0b530117af665ae3f51d017c34e058023bde618a 14e45e400b5ce17366c99d9ded76a49222c87ecc Sean Facer <facer.sean@gmail.com> 1639505381 +0000 pull: Fast-forward -
temple-lock/trunk/.git/logs/refs/heads/master
r2642798 r2644077 9 9 5ebaab32419a3558484470f8db66f36b082a2dc4 a4f2aecac0c8d3f7cd774717a92d51d97b5f5344 Sean Facer <facer.sean@gmail.com> 1639229222 +0000 pull: Fast-forward 10 10 a4f2aecac0c8d3f7cd774717a92d51d97b5f5344 0b530117af665ae3f51d017c34e058023bde618a Sean Facer <facer.sean@gmail.com> 1639229783 +0000 pull: Fast-forward 11 0b530117af665ae3f51d017c34e058023bde618a 14e45e400b5ce17366c99d9ded76a49222c87ecc Sean Facer <facer.sean@gmail.com> 1639505381 +0000 pull: Fast-forward -
temple-lock/trunk/.git/refs/heads/master
r2642798 r2644077 1 0b530117af665ae3f51d017c34e058023bde618a 1 14e45e400b5ce17366c99d9ded76a49222c87ecc -
temple-lock/trunk/includes/Base/ContentLock.php
r2642796 r2644077 32 32 function checkAuthToken() 33 33 { 34 session_start(); 35 if (isset($_GET['oauthToken'])) { 34 if( ! session_id() ) { 35 session_start(); 36 } 37 if (isset($_GET['oauthToken']) && !isset($_SESSION['RALLY_USER_ID'])) { 36 38 $_SESSION['OAUTH_TOKEN'] = sanitize_text_field($_GET['oauthToken']); 37 39 } 38 session_write_close();39 40 } 40 41 … … 154 155 public function frontend_content_lock($content) 155 156 { 157 156 158 /** Not Working - need to get and set Rally ID, also need to get which COIN they are using and update the lock text where 157 159 * it says $COIN (check if $_SESSION['COIN'] and display) … … 159 161 global $wp; 160 162 global $post; 163 161 164 if ($post->ID) { 165 166 $number_of_coins = get_post_meta($post->ID, 'number_of_coins_required', true); 162 167 163 168 $media_id_meta = get_post_meta($post->ID, 'hide_content_checkbox_check', true); 164 169 if ($media_id_meta == 'yes') { 165 166 170 if (!isset($_SESSION['COIN'])) { 167 171 $defaultCoin = get_option('_temple_lock_user_default_coin', true); 168 172 $_SESSION['COIN'] = $defaultCoin; 169 173 } 170 $number_of_coins = get_post_meta($post->ID, 'number_of_coins_required', true); 171 if (isset($_SESSION['OAUTH_TOKEN'])) { 174 if (!isset($_SESSION['RALLY_USER_ID']) && isset($_SESSION['OAUTH_TOKEN']) ) { 172 175 $params = [ 173 176 "code" => sanitize_text_field($_SESSION['OAUTH_TOKEN']) … … 188 191 if (wp_remote_retrieve_response_code($response) == 200) { 189 192 $apiBody = json_decode(wp_remote_retrieve_body($response), true); 190 $_SESSION['RALLY_USER_ID'] = $apiBody['rnbUserId']; 193 if (!isset($_SESSION['RALLY_USER_ID']) && isset($apiBody['rnbUserId'])){ 194 $_SESSION['RALLY_USER_ID'] = $apiBody['rnbUserId']; 195 } 191 196 } 192 197 } … … 194 199 if (isset($_SESSION['RALLY_USER_ID'])) { 195 200 196 $response = wp_remote_post(TEMPLE_API_URL . 'api/balance/' . $_SESSION['RALLY_USER_ID'] . '/' . $_SESSION['COIN'], [201 $response = wp_remote_post(TEMPLE_API_URL . 'api/balance/'.$_SESSION['RALLY_USER_ID'].'/' . strtoupper($_SESSION['COIN']), [ 197 202 'method' => 'GET', 198 203 'headers' => [ … … 206 211 'data_format' => 'body' 207 212 ]); 213 208 214 if (wp_remote_retrieve_response_code($response) == 200) { 209 215 $responseBody = json_decode(wp_remote_retrieve_body($response), true);
Note: See TracChangeset
for help on using the changeset viewer.