Community Support Forums — WordPress® ( Users Helping Users ) — 2011-07-29T18:23:03-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=3145 2011-07-29T18:23:03-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3145&p=29472#p29472 <![CDATA[Re: Outside WP application integration]]>
mdelacruzperu wrote:
I found a way to do this. This is the code on the site outside WP:

Code:
require( '/path_to_wp/wp-load.php' );

if ( is_user_logged_in() ) {
    echo '<pre>';print_r($current_user);echo '</pre>';
}
 else {
    echo 'Please login first';
}
 


It works great, I now have to check the s2 functions to validate the user has a paid subscription. But I have a little problem.

My application is configured to run in a subdomain and the authentication cookie doesn't recognize subdomains. Is there a way in s2member to configure to authentication cookie to be valid for all the domain and not just where wordpress is installed? I mean wordpress is in http://www.myurl.com and the application is in app.myurl.com I need to allow the cookie to work for all the domain myurl.com and all folders.


Sounds great,
But where do I put in the code?

In any of the wp-page or as script somewhere?

Regards / Lars

Statistics: Posted by LarsW — July 29th, 2011, 6:23 pm


]]>
2011-04-13T22:19:41-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3145&p=9990#p9990 <![CDATA[Re: Outside WP application integration]]>

Regarding subdomains, if you really need to use different ones, you could modify your wp-config.php file.

http://codex.wordpress.org/Editing_wp-c ... kie_Domain

Code:
define('COOKIE_DOMAIN', '.example.com');  


Remove the www and always provide a leading dot. This tells WordPress to set cookies for all sub-domains.

Let me know if that helps. :)

Statistics: Posted by Cristián Lávaque — April 13th, 2011, 10:19 pm


]]>
2011-04-13T12:15:26-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3145&p=9683#p9683 <![CDATA[Re: Outside WP application integration]]>
Code:
require( '/path_to_wp/wp-load.php' );

if ( is_user_logged_in() ) {
    echo '<pre>';print_r($current_user);echo '</pre>';
}
 else {
    echo 'Please login first';
}
 


It works great, I now have to check the s2 functions to validate the user has a paid subscription. But I have a little problem.

My application is configured to run in a subdomain and the authentication cookie doesn't recognize subdomains. Is there a way in s2member to configure to authentication cookie to be valid for all the domain and not just where wordpress is installed? I mean wordpress is in http://www.myurl.com and the application is in app.myurl.com I need to allow the cookie to work for all the domain myurl.com and all folders.

Statistics: Posted by mdelacruzperu — April 13th, 2011, 12:15 pm


]]>
2011-04-12T20:36:16-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3145&p=9622#p9622 <![CDATA[Re: Outside WP application integration]]> WP Admin -> s2Member -> API / Notifications.

This video will help you too.

embed

Statistics: Posted by Cristián Lávaque — April 12th, 2011, 8:36 pm


]]>
2011-04-12T19:47:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3145&p=9615#p9615 <![CDATA[Re: Outside WP application integration]]> For example is the user creates a free account don't call the script, if the user creates a paid account call the scripts. If a user cancel a paid account call the script, etc.
I know this requires advanced programming but we're ready to deal with that.
Maybe I can use some s2member hooks.

Statistics: Posted by mdelacruzperu — April 12th, 2011, 7:47 pm


]]>
2011-04-12T19:30:49-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3145&p=9612#p9612 <![CDATA[Re: Outside WP application integration]]>

Did you try protecting the script you had under s2Member's file protection and serve it from there? I don't know if it'd work, but you could give it a go. WP Admin -> s2Member -> Download Options.

Statistics: Posted by Cristián Lávaque — April 12th, 2011, 7:30 pm


]]>
2011-04-12T17:48:46-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3145&p=9597#p9597 <![CDATA[Re: Outside WP application integration]]> Cristian, is it possible to make some ajax call to wordpress from the other side to validate if the user is logged in at wordpress and has the correct subscription in s2ember to allow him access?

Statistics: Posted by mdelacruzperu — April 12th, 2011, 5:48 pm


]]>
2011-04-12T17:42:12-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3145&p=9596#p9596 <![CDATA[Re: Outsite WP application integration]]>

I'm glad you're happy with s2Member Pro! Jason is definitely doing an awesome job with it.

Regarding your question:

If you want to control the access to the other application, no, s2Member currently works inside WordPress, including the URI Restriction feature.

If you need to give them information regarding this other application, you can do it with a page protected by s2Member in WordPress.

Does that help?

Statistics: Posted by Cristián Lávaque — April 12th, 2011, 5:42 pm


]]>
2011-04-12T17:34:40-05:00 http://www.primothemes.com/forums/viewtopic.php?t=3145&p=9592#p9592 <![CDATA[Outside WP application integration]]> I have wordpress to run a site but I built a custom application to allows users to get some information, I have to give the users access to the application (outside wordpress) only if they have a valid paid subscription in wp and s2member.
Is there a way to integrate this scenery? s2member validating access to an application outside wordpress but in the same domain off course.

Statistics: Posted by mdelacruzperu — April 12th, 2011, 5:34 pm


]]>