Plugin Directory

Changeset 1155760


Ignore:
Timestamp:
05/08/2015 12:59:32 AM (11 years ago)
Author:
sreedoap
Message:

updated remember me to retain session when browser is closed. Fixed issue with login form when WordPress is hosted on a subdomain

Location:
pilotpress/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pilotpress/trunk/pilotpress.php

    r1112106 r1155760  
    44Plugin URI: http://ontraport.com/
    55Description: OfficeAutoPilot / Ontraport WordPress integration plugin.
    6 Version: 1.7.2
     6Version: 1.7.3
    77Author: Ontraport Inc.
    88Author URI: http://ontraport.com/
     
    2121    class PilotPress {
    2222
    23         const VERSION = "1.7.2";
     23        const VERSION = "1.7.3";
    2424        const WP_MIN = "3.0";
    2525        const NSPACE = "_pilotpress_";
     
    171171                    }
    172172
    173                     if(isset($_SESSION["contact_id"])) {
    174                         $api_result = $this->api_call("get_site_settings", array("site" => site_url(), "contact_id" => $_SESSION["contact_id"], "username" => $_SESSION["user_name"]));
     173                    if(isset($_COOKIE["contact_id"])) {
     174                        if(!function_exists('get_currentuserinfo'))
     175                        {
     176                            include(ABSPATH . "wp-includes/pluggable.php");
     177                        }
     178                        global $current_user;
     179                        get_currentuserinfo();
     180                        $username = $current_user->user_login;
     181                        $api_result = $this->api_call("get_site_settings", array("site" => site_url(), "contact_id" => $_COOKIE["contact_id"], "username" => $username));
    175182                    }
    176183                    else {
     
    15651572        function user_login($username, $password) {
    15661573            if(isset($_POST["wp-submit"])) {
     1574
     1575                //Wordpress trims trailing and leading spaces before authenticating, lets do the same.
    15671576                $password = trim($password);
     1577
    15681578                $hashed_password = $username . self::VERSION . $password . self::AUTH_SALT;
    15691579 
     
    16571667                                               
    16581668                        $user_id = $user->ID;
     1669                        $remember = false;
     1670                        if (!empty($_POST["rememberme"]))
     1671                        {
     1672                            $remember = true;
     1673                        }
    16591674                        wp_set_current_user($user_id, $username);
    1660                         wp_set_auth_cookie($user_id);
     1675                        wp_set_auth_cookie($user_id ,$remember);
    16611676                        do_action('wp_login', $username , $user);
    16621677
     
    22312246            $page_levels = get_post_meta($id, "_pilotpress_level");
    22322247            $user_levels = $this->get_setting("levels","user",true);
    2233            
     2248
    22342249            if(!is_array($user_levels)) {
    22352250                $user_levels = array($user_levels);
  • pilotpress/trunk/readme.txt

    r1112104 r1155760  
    1212== Description ==
    1313
    14 [Video: __Intro and Overview__ (4:36)](http://pseudo01.hddn.com/vod/moonray.moonray/PilotPress_2_intro.mp4)
    1514
    1615PilotPress is a WordPress plug-in that brings the power of [ONTRAPORT](http://ontraport.com) to the WordPress platform, specifically:
     
    3029== Installation ==
    3130
    32 [Video: __Installing on an existing WordPress Site__ (3:13)](http://pseudo01.hddn.com/vod/moonray.moonray/PilotPress_3_Installing_to_existin_site.mp4)
    33 
    34311. Upload the PilotPress plugin to the "/wp-content/plugins/" directory
    35322. Activate the plugin through the "Plugins" menu in WordPress
     
    6057== Changelog ==
    6158
     59= 1.7.3 =
     60* Fixed issue with logging in where the "remember me" option would not keep users logged in, if/when was browser closed and the session was destroyed
     61* Fixed issue with custom login form going to 404 page if WordPress was hosted on a subdomain
     62
    6263= 1.7.2 =
    6364* Fixed bug where if your home page is set to a static page and is protected by a membership level it would still show the content.
     
    6566
    6667= 1.7.1 =
    67 * Fixed bug where featured images would not show up properly when creating a new post
     68* Fixed bug where featured images would not show up properly when creating a new post/page
    6869
    6970= 1.7.0 =
     
    9394* Fixed a bug with the "not_contact" shortcode where it would not function if a user was not logged in.
    9495* Improved page load speeds by moving the ONTRAPORT tracking script into the footer.
    95 * Fixed a bug where a user not logged in trying to use the affiliate_center would redirect to wp_login.php instead of the PilotPress log in page.
     96* Fixed a bug where a user not logged in trying to use the affiliate_center would redirect to wp_login.php instead of the PilotPress login page.
    9697* Added two additional shortcode attributes to the show_if shortcode - 'not_cookied_contact' and 'is_cookied_contact'
    9798
     
    145146== Upgrade Notice ==
    146147
     148= 1.7.3 =
     149* Fixed issue with logging in where the "remember me" option would not keep users logged in, if/when was browser closed
     150* Fixed issue with custom login form going to 404 page if WordPress was hosted on a subdomain
     151
    147152= 1.7.2 =
    148153* Fixed bug where if your home page is set to a static page and is protected by a membership level it would still show the content.
     
    150155
    151156= 1.7.1 =
    152 * Fixed bug where featured images would not show up properly when creating a new post
     157* Fixed bug where featured images would not show up properly when creating a new post/page
    153158
    154159= 1.7.0 =
     
    178183* Fixed a bug with the "not_contact" shortcode where it would not function if a user was not logged in.
    179184* Improved page load speeds by moving the ONTRAPORT tracking script into the footer.
    180 * Fixed a bug where a user not logged in trying to use the affiliate_center would redirect to wp_login.php instead of the PilotPress log in page.
     185* Fixed a bug where a user not logged in trying to use the affiliate_center would redirect to wp_login.php instead of the PilotPress login page.
    181186* Added two additional shortcode attributes to the show_if shortcode - 'not_cookied_contact' and 'is_cookied_contact'
    182187
     
    224229== Using your WordPress site as a Membership Site (aka Protecting and revealing content) ==
    225230
    226 [Video: __Protect and Release Content__ (6:46)](http://pseudo01.hddn.com/vod/moonray.moonray/PilotPress_5_protect_and_release_content.mp4)
    227 
    228231Below are instructions on how to protect content in your membership site. There are two ways to do this:
    229232
     
    279282- - For this rule, you would set the "What Should Happen" section to "Change Field to Value" and then select the "Membership Level" field as the one to have changed. Then, set it to change to the next specific level of membership, in this case, we'd set it to 'Week 2'. It would be the same moving forward to week 3, etc.
    280283
    281 - - Next , you could create an email step to fire immediately after the rule step to notify your contact that they are able to log in and access week 2's content, you may repeat this as many time as you wish. And, you don't have to do it all at once. You might add the first three weeks to start, then add a week or twos worth of additional content at a time later on. The process is the same either way.
     284- - Next , you could create an email step to fire immediately after the rule step to notify your contact that they are able to login and access week 2's content, you may repeat this as many time as you wish. And, you don't have to do it all at once. You might add the first three weeks to start, then add a week or twos worth of additional content at a time later on. The process is the same either way.
    282285
    283286- Note: Be sure to save each step as you go and then save your sequence when you're all through.
     
    333336== Creating the Sign-Up Page ==
    334337
    335 [Video: __Creating a Sign Up Page and Adding Forms__ (2:32)](http://pseudo01.hddn.com/vod/moonray.moonray/PilotPress%20_6_Create_Signup_pg_and_post_form_to_wp.mp4)
    336 
    337338This is where your prospects/clients purchase their membership. It's the page that any sales emails, sales letters, and sales videos would point to.
    338339
Note: See TracChangeset for help on using the changeset viewer.