latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Immediate login to members page

Home Forums Community Forum Immediate login to members page

This topic contains 12 replies, has 5 voices. Last updated by  Cristián Lávaque 4 years, 4 months ago.

Topic Author Topic
Posted: Thursday Aug 9th, 2012 at 10:41 pm #21671

Hi S2 Member,

I am a big fan! Love the plugin so much. Anyway, I need help. The plugin works successfully but I was hoping if I could immediately move the paid customer (after payment) to the Members Area page without having to login anymore?

Is this possible?

Many thanks,

Giancarlo

List Of Topic Replies

Viewing 12 replies - 1 through 12 (of 12 total)
Author Replies
Author Replies
Posted: Friday Aug 10th, 2012 at 7:50 am #21702

Hi Giancarlo.

Thanks for the kudos! :)

There’s a hack to login automatically after registration: http://www.s2member.com/forums/topic/auto-login-after-successful-payment/#post-16660

I hope that helps.

Posted: Friday Aug 10th, 2012 at 8:05 am #21705

Hi Cristian,

Does it work for Paypal Pro Forms? I set it up following your instructions on the docs and videos as well Optimize Press videos. I am just worried that I might get problems.

So I just create a mu-plugin folder and upload the s2hack.php file. And that is it? No more configuration on the S2member options?

Thanks,

Giancarlo

Posted: Saturday Aug 11th, 2012 at 2:40 am #21748

Right, just that. And it works with pro-forms too. :)

Posted: Wednesday Aug 15th, 2012 at 11:27 am #22107

I love the Pro plugin and the possibility of an auto-login feature (much less confusing to sign-ups than just putting some yellow-background text above the reg. form). My problem is when I try to implement the hack for auto-login, I’m getting all kinds of problems when I try to login to my WP admin (see below, this is just a sample of over a dozen warnings that show up). Problem goes away as soon as I remove the s2hacks.php file. Any suggestions? Thanks.

Warning: Cannot modify header information – headers already sent by (output started at /nfs/c04/h01/mnt/62642/domains/laschoolreport.com/html/wp-content/mu-plugins/s2hacks.php:1) in /nfs/c04/h01/mnt/62642/domains/laschoolreport.com/html/wp-login.php on line 362

Warning: Cannot modify header information – headers already sent by (output started at /nfs/c04/h01/mnt/62642/domains/laschoolreport.com/html/wp-content/mu-plugins/s2hacks.php:1) in /nfs/c04/h01/mnt/62642/domains/laschoolreport.com/html/wp-login.php on line 374

Warning: Cannot modify header information – headers already sent by (output started at /nfs/c04/h01/mnt/62642/domains/laschoolreport.com/html/wp-content/mu-plugins/s2hacks.php:1) in /nfs/c04/h01/mnt/62642/domains/laschoolreport.com/html/wp-includes/pluggable.php on line 697

Warning: Cannot modify header information – headers already sent by (output started at /nfs/c04/h01/mnt/62642/domains/laschoolreport.com/html/wp-content/mu-plugins/s2hacks.php:1) in /nfs/c04/h01/mnt/62642/domains/laschoolreport.com/html/wp-includes/pluggable.php on line 698

Posted: Wednesday Aug 15th, 2012 at 12:36 pm #22125
Eduan
Username: Eduan
Moderator

Elizabeth,

Could you please post the code inside the s2hacks.php file? Thanks. :)

Posted: Wednesday Aug 15th, 2012 at 1:29 pm #22135

It’s the code I pulled from these forums. I have tried it both with and without the closing ?> tag.

<?php
add_action(&#039;ws_plugin__s2member_during_configure_user_registration&#039;, &#039;s2_auto_login_after_registration&#039;);
function s2_auto_login_after_registration($vars = array()) {
    if (!is_admin() &amp;&amp; $vars[&#039;processed&#039;] === &#039;yes&#039;) {
        wp_new_user_notification($vars[&#039;user_id&#039;], $vars[&#039;pass&#039;]);
        wp_set_auth_cookie($vars[&#039;user_id&#039;], false, is_ssl());
        wp_redirect(S2MEMBER_LOGIN_WELCOME_PAGE_URL . &#039;?first&#039;);
        exit();
    }
}
  • This reply was modified 4 years, 4 months ago by  Eduan. Reason: Added the code tags
Posted: Thursday Aug 16th, 2012 at 7:13 am #22192
Raam Dev
Username: Raam
Staff Member

Elizabeth,

It looks like when you copied and pasted the code, the code was garbled. There are a bunch of bad characters in your pasted code. Could you try copying the code from the forum again and paste it into a plain text file (using Notepad or TextEdit) and then copy and paste it again to the s2-hacks.php file?

Posted: Thursday Aug 16th, 2012 at 7:28 am #22198

Elizabeth said:
Warning: Cannot modify header information – headers already sent by (output started at /nfs/c04/h01/mnt/62642/domains/laschoolreport.com/html/wp-content/mu-plugins/s2hacks.php:1)

Make sure you don’t have a space or line break before the opening PHP tag. The [hilite code]

Posted: Thursday Aug 16th, 2012 at 8:09 am #22215

Does the S2 Hack require that I must have the https? Because, I just use paypal during the signup so it redirects it to the paypal page. But when I applied the S2 hack nothing happens.

Posted: Thursday Aug 16th, 2012 at 8:52 am #22226

No, HTTPS is required for a page with a pro-form when you receive payments on-site, like with PayPal Pro or Authorize.Net.

Posted: Thursday Aug 16th, 2012 at 4:12 pm #22279

Thank you Raam and Cristian, the combination of your advice worked (I did notice extra space before the <?php tag). I really appreciate your help, and your product. Thanks again.

Posted: Friday Aug 17th, 2012 at 8:05 am #22321

You’re welcome, Elizabeth. I’m glad you got it working. Thanks for the update! :)

Viewing 12 replies - 1 through 12 (of 12 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.