Plugin Directory

Changeset 2367448


Ignore:
Timestamp:
08/23/2020 07:00:30 PM (6 years ago)
Author:
transact
Message:

check for already existing email registrations

Location:
transact
Files:
3 edited
6 copied

Legend:

Unmodified
Added
Removed
  • transact/tags/5.1.4/frontend/controllers/transact-single-post.php

    r2348646 r2367448  
    4040    const DISABLE = 4;
    4141    const INLINE_COMMENTS_OUTPUT = true;
    42    
     42
    4343    /**
    4444     * config controller
     
    332332
    333333            if(!$existing_user) {
     334                $existing_user = get_user_by( 'email', $user_email );
     335            }
     336
     337            if(!$existing_user) {
    334338                $bytes = random_bytes(16);
    335339                $wp_userid = wp_insert_user(
     
    343347                );
    344348
    345                 $accountMeta->connect_xsact_id_meta($wp_userid, $xsact_user_id);
    346349            } else {
    347350                $wp_userid = $existing_user->ID;
    348                
     351
    349352                if ($existing_user->display_name !== $user_display_name) {
    350353                    wp_update_user(
     
    357360                }
    358361            }
     362            $accountMeta->connect_xsact_id_meta($wp_userid, $xsact_user_id);
    359363
    360364            // If we are only checking premium, don't log the user in if they don't have premium
     
    460464                        $raw = apply_filters('the_content', $post_object->post_content);
    461465                        $blocks = parse_blocks( $raw );
    462                    
     466
    463467                        foreach ( $blocks as $block ) {
    464468                            // Dont include preview content in premium output
     
    472476
    473477                }
    474                
     478
    475479                if($button_controller->get_if_article_donation()) {
    476480                    $result_content = $result_content . $button_controller->print_donation_button();
     
    650654        $post_object = get_post($this->post_id);
    651655        $has_premium = $this->post_has_premium($transact, $post_object);
    652        
     656
    653657        if(!$premium && $has_premium) {
    654658            $nonce_field = wp_nonce_field( 'transact_purchase_buttons', 'transact_purchase_buttons_nonce', true, false );
     
    661665                    $count_words = str_word_count(wp_strip_all_tags($content));
    662666                }
    663    
     667
    664668                if($button_controller->get_if_article_donation()) {
    665669                    $content = $content . $button_controller->print_donation_button($count_words);
     
    668672                }
    669673            }
    670    
     674
    671675            $content = '<div id="transact_content">' . $content . '</div>';
    672676        }
     
    863867            return false;
    864868        }
    865         return (isset($premium_from_meta) && $premium_from_meta !== '') || 
     869        return (isset($premium_from_meta) && $premium_from_meta !== '') ||
    866870            ($post_object && strpos($post_object->post_content, 'transact/premium-content') > -1);
    867871
  • transact/tags/5.1.4/readme.txt

    r2348646 r2367448  
    66Requires PHP: 5.6
    77Tested up to: 5.4.2
    8 Stable tag: 5.1.3
     8Stable tag: 5.1.4
    99License: APACHE-2.0
    1010License URI: https://www.apache.org/licenses/LICENSE-2.0
     
    8282
    8383
     84= 5.1.4 =
     85* Check for already exising email registration.
     86
    8487= 5.1.3 =
    8588* improve zero price checks
  • transact/tags/5.1.4/transact-plugin.php

    r2348646 r2367448  
    33 * Plugin Name: transact.io
    44 * Description: Integrates transact.io services into WP
    5  * Version: 5.1.3
     5 * Version: 5.1.4
    66 * Author: transact.io
    77 * Author URI: https://transact.io
  • transact/trunk/frontend/controllers/transact-single-post.php

    r2348646 r2367448  
    4040    const DISABLE = 4;
    4141    const INLINE_COMMENTS_OUTPUT = true;
    42    
     42
    4343    /**
    4444     * config controller
     
    332332
    333333            if(!$existing_user) {
     334                $existing_user = get_user_by( 'email', $user_email );
     335            }
     336
     337            if(!$existing_user) {
    334338                $bytes = random_bytes(16);
    335339                $wp_userid = wp_insert_user(
     
    343347                );
    344348
    345                 $accountMeta->connect_xsact_id_meta($wp_userid, $xsact_user_id);
    346349            } else {
    347350                $wp_userid = $existing_user->ID;
    348                
     351
    349352                if ($existing_user->display_name !== $user_display_name) {
    350353                    wp_update_user(
     
    357360                }
    358361            }
     362            $accountMeta->connect_xsact_id_meta($wp_userid, $xsact_user_id);
    359363
    360364            // If we are only checking premium, don't log the user in if they don't have premium
     
    460464                        $raw = apply_filters('the_content', $post_object->post_content);
    461465                        $blocks = parse_blocks( $raw );
    462                    
     466
    463467                        foreach ( $blocks as $block ) {
    464468                            // Dont include preview content in premium output
     
    472476
    473477                }
    474                
     478
    475479                if($button_controller->get_if_article_donation()) {
    476480                    $result_content = $result_content . $button_controller->print_donation_button();
     
    650654        $post_object = get_post($this->post_id);
    651655        $has_premium = $this->post_has_premium($transact, $post_object);
    652        
     656
    653657        if(!$premium && $has_premium) {
    654658            $nonce_field = wp_nonce_field( 'transact_purchase_buttons', 'transact_purchase_buttons_nonce', true, false );
     
    661665                    $count_words = str_word_count(wp_strip_all_tags($content));
    662666                }
    663    
     667
    664668                if($button_controller->get_if_article_donation()) {
    665669                    $content = $content . $button_controller->print_donation_button($count_words);
     
    668672                }
    669673            }
    670    
     674
    671675            $content = '<div id="transact_content">' . $content . '</div>';
    672676        }
     
    863867            return false;
    864868        }
    865         return (isset($premium_from_meta) && $premium_from_meta !== '') || 
     869        return (isset($premium_from_meta) && $premium_from_meta !== '') ||
    866870            ($post_object && strpos($post_object->post_content, 'transact/premium-content') > -1);
    867871
  • transact/trunk/readme.txt

    r2348646 r2367448  
    66Requires PHP: 5.6
    77Tested up to: 5.4.2
    8 Stable tag: 5.1.3
     8Stable tag: 5.1.4
    99License: APACHE-2.0
    1010License URI: https://www.apache.org/licenses/LICENSE-2.0
     
    8282
    8383
     84= 5.1.4 =
     85* Check for already exising email registration.
     86
    8487= 5.1.3 =
    8588* improve zero price checks
  • transact/trunk/transact-plugin.php

    r2348646 r2367448  
    33 * Plugin Name: transact.io
    44 * Description: Integrates transact.io services into WP
    5  * Version: 5.1.3
     5 * Version: 5.1.4
    66 * Author: transact.io
    77 * Author URI: https://transact.io
Note: See TracChangeset for help on using the changeset viewer.