PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

No answer? Disable user login confirmation for paying users?

s2Member Plugin. A Membership plugin for WordPress®.

No answer? Disable user login confirmation for paying users?

Postby candy » July 15th, 2011, 5:49 pm

Hi,

Ok, just got that sandbox to get trhough a registration, and I need to change one very annoying WP behaviour, namely forcing the user to confirm his registration.

That might make lots of sense for free registrations, but when I have a user who pays I definitely do not need to loop him through an even more messy registration process (the whole paypal story is annoying & complicated enough).

So I want him to be automatically logged in once he filled in his user name & pass, and not wait 4 him to 1st confirm it by clicking in that email.

The reason is that I want the user to get as quickly as possible to see a certain page (which actually sent him through the whole registration pain) and not make his life really impossible with 10000000 annoying steps.

If he paid, and paypal sent him back as "ok" to my site, I don't need that extra mile, really.

So what do I have 2 change an where so that when a user is sent back from paypal after completing a payment, all he has to do is enter an username & pasword and once he cliks "register" he'll be automatically and imediatelly logged in into the site (and sent to the page he originally came from, before going through the whole paypal process)?

This is VERY important!

Thank you!

PS: free registration disabled!
Last edited by candy on July 17th, 2011, 6:40 pm, edited 2 times in total.
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Disable user email confirmation for paying users - how?

Postby rossagrant » July 15th, 2011, 6:52 pm

This would be a vey cool trick!

I, personally hate the activation emails as they often end up in spam or people don't want to have to go through the whole process of clicking links etc.

I agree, for paid users there is absolutely no need to have the activation email.

I'd be happy with just a decent captcha for Buddypress signups that were free too and cut out the whole activation email cycle.

If it has to be the way with free members then so be it but for premium it would be great to cut that step out!
User avatar
rossagrant
Experienced User
Experienced User
 
Posts: 127
Joined: May 5, 2010

Re: Disable user email confirmation for paying users - how?

Postby candy » July 16th, 2011, 8:01 am

Any advise please?

Thanks!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: No answer? Disable user email confirmation for paying us

Postby candy » July 16th, 2011, 4:26 pm

hmm ... any chance to get an answer on this one please?
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: No answer? Disable user email confirmation for paying us

Postby Cristián Lávaque » July 16th, 2011, 4:45 pm

Hmm... I'm not sure what you mean by WordPress making you confirm the account. When I create an account, I just receive the new user email with my login info, but no need to click anywhere to confirm my account. I do see that I need to login, is that what you mean? Log the person in automatically after account creation?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: No answer? Disable user email confirmation for paying us

Postby candy » July 16th, 2011, 5:01 pm

logg him automatically - exactely - and redirect him to the page he originally came from ....

a hack/trick whatever would be great!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: No answer? Disable user email confirmation for paying us

Postby Cristián Lávaque » July 16th, 2011, 5:17 pm

Ah ok. Well, here's one I found using a Theme My Login hook: https://wordpress.org/support/topic/aut ... st-1732782

You could modify it to work with an s2Member hook, like 'ws_plugin__s2member_during_configure_user_registration_front_side'.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: No answer? Disable user email confirmation for paying us

Postby candy » July 16th, 2011, 5:53 pm

hmm ... I tried that Theme my login plugin with the hook, did not work - I mean the part with the redirection did not work, as it keeps pushing the new user to a "profile" page.

I did not understand where to add / use that code you've just mentioned?

`ws_plugin__s2member_during_configure_user_registration_front_side`
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: No answer? Disable user email confirmation for paying us

Postby Cristián Lávaque » July 16th, 2011, 11:25 pm

I just showed you those so you don't start from scratch, but you still needed to customize it. Like this

/wp-content/mu-plugins/s2hacks.php
Code: Select all
<?php
add_action
('ws_plugin__s2member_during_configure_user_registration_front_side', 's2_auto_login_after_registration');
function s2_auto_login_after_registration($vars = array()) {
    wp_set_auth_cookie($vars['user_id'], false, is_ssl());
    wp_redirect(S2MEMBER_LOGIN_WELCOME_PAGE_URL);
    exit;
}
?>


That takes the new user to the Login Welcome Page after registration. You can change the URL to whatever you want, maybe a special page to welcome a new member.

In your case, where you want to take the person to the page he was at when he got taken to the Membership Options Page, you'll need to store that page somewhere so you can later tell which it was. Maybe save it in a cookie and get it from there later. However you do it, it'll have to also be able to deal with those that bought without having tried to view a protected page.

Ask your develper to help you with this part. If you don't have one, there are many in websites like jobs.wordpress.org, oDesk, eLance, etc.

I hope that helps. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: No answer? Disable user email confirmation for paying us

Postby candy » July 17th, 2011, 6:12 pm

Hi,

Well, whatever I try it does not seem to work ...
The snippet you wrote does not do the trick either, unfortunatelly ... :-(
It does not even get me pass that annoying login screen, leave alone the redirect.

I do not have a programmer, and actually s2 is promising to do that redirect:

"... s2Member to provide information about what the User/Member was attempting to access ( e.g. before they were redirected to the Membership Options Page ). This is where s2Member's MOP Vars come in ( i.e. Membership Options Page Variables ). Whenever s2Member redirects a User/Member to your Membership Options Page, it will include these important MOP Variables in the query string of the URL. These Variables can be used to provide more informative messages; or even to provide a different set of Membership Options ( i.e. Payment Buttons ), based on what a User/Member was attempting to access."

But it obviously doesn't :-(

I tried this in s2-hacks.php:

Code: Select all
add_action('ws_plugin__s2member_during_configure_user_registration_front_side', 's2_auto_login_after_registration');
function s2_auto_login_after_registration($vars = array()) {
    wp_set_auth_cookie($vars['user_id'], false, is_ssl());
    $referer = remove_query_arg( array( 'action', 'instance' ), wp_get_referer() );
   wp_redirect( $referer );
    exit;
}


No success :-(

How do I solve it than?

Any way to include smth. in that paypal button maybe !?!? And if ... than what !??!

Thanks a lot!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: No answer? Disable user login confirmation for paying us

Postby candy » July 18th, 2011, 11:34 am

Hi,

me again ... I have tried with this function in the theme's functions.php

Code: Select all
function auto_login($userID) {
    if (!is_user_logged_in()) {
        $user = get_userdata($userID);
        $user_id = $user->ID;
        $user_login = $user->user_login;

        //login
        wp_set_current_user($user_id, $user_login);
        wp_set_auth_cookie( $user_id, $remember, $secure );
        do_action('wp_login', $user_login);
       
    }
}
add_action('user_register', 'auto_login');


Autologin works fine, what does NOT work however is to send the user back to the page he came from.

As I already have those

list($seeking, $id) = preg_split("/-/", $_GET["s2member_seeking"], 2);
list($seeking, $uri) = preg_split("/-/", $_GET["s2member_seeking"], 2);
list($seeking, $file) = preg_split("/-/", $_GET["s2member_seeking"], 2);

on the memberships page, I really do not know what else I can do.

To me it looks like a bug of some sort (maybe through the paypal communication, I don't know) or there are secret tricks that one should employ to get those variables passed through to paypal, back and through the autologin.

Fact is it does not work, and that's a serious issue, as I do not want the user to land to an irrelavant page - I want him 2 be able to turn back to the very page he started at.
Actually, I think no one wants that :-)

How can this be solved please?

Thank you!


PS: Reminder: I am not (!) a programmer, so please try to reply as for "newbies" ;) Thanks"
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: No answer? Disable user login confirmation for paying us

Postby candy » July 19th, 2011, 11:58 am

Any news?
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: No answer? Disable user login confirmation for paying us

Postby Cristián Lávaque » July 19th, 2011, 10:02 pm

The MOP variables are only meant to give the Membership Options Page some info that you can use to customize it. WP Admin -> s2Member -> API / Scripting -> Membership Options Page Variables

They don't do anything or are expected to remain for later pages either. You can, though, save those values somewhere where they won't be lost and you will be able to use later, that's why earlier I suggested saving them into a cookie or the session.

The autologin code I posted worked for me in an installation with the latest versions of WordPress and s2Member (WP 3.2.1, s2M 110710).

See the line with wp_redirect() in my code? If you stored the MOP vars somewhere, you can then use that info to redirect the user there after registration.

I hope that helps. :)

If you don't know how to do this, you should look for a developer that helps you implement it. A good one should be able to get this done without much effort. You can look for one in freelance websites like jobs.wordpress.net, oDesk, eLance.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: No answer? Disable user login confirmation for paying us

Postby candy » July 20th, 2011, 9:52 pm

Hi,

Did you by any chance mean a MU site? Cause your code definitely does NOT work for me :-(
Not even the autologin. If I use your code it keeps asking for me to enter the login credentials, if I use the other one (see above) in functions.php it makes it through the autologin, but keeps redirecting me to "mydomain.com/?page_id=0" (no idea where it taked that page_id=0 from) after I logged in

So unfortunatelly after all this I am deep in the same fogg as I was in the beggining :-(

:cry:
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: No answer? Disable user login confirmation for paying us

Postby Cristián Lávaque » July 20th, 2011, 10:09 pm

I see.

No, mu there stands for "must use".

What version of WordPres and s2Member are you using? Where did you try using the code I gave you?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: No answer? Disable user login confirmation for paying us

Postby rwilki » July 26th, 2011, 8:51 am

I'm still not sure how to make that work either. I'm not a newbie but I just wish there was a way to make this happen more understandably...
User avatar
rwilki
Registered User
Registered User
 
Posts: 61
Joined: July 22, 2011

Re: No answer? Disable user login confirmation for paying us

Postby candy » July 27th, 2011, 9:25 pm

I am sorry Christian, but your code definitely does not log the user in :-(
It prevents that second screen to appear (the one which usually appears after registration, asking the fresh user to log in) but when I try to access a page which would only be available to a registered user, it sends me to the memberships page, asking me to pay again! (which is wrong). And the user is definitely not "in".

I did not find a solution for the redirect either, I think it should be an integrated function, as sending the user to a central always same page is not logical if you have a site with more let's say products or options different from each other. If the user land to the welcome page, he will not likely NOt know his way back to the page he was actually interested in. Does not make much sense, you know?

Would be nice if you or Jason would have a solution for us :-)

Thanks
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: No answer? Disable user login confirmation for paying us

Postby rwilki » July 27th, 2011, 9:48 pm

Amen Candy. The other part that gets me is when people click on a protected link, it takes them to login or registration page, then the My welcome page, but NEVER the article that the visitor first clicked on...
User avatar
rwilki
Registered User
Registered User
 
Posts: 61
Joined: July 22, 2011

Re: No answer? Disable user login confirmation for paying us

Postby Cristián Lávaque » July 27th, 2011, 11:02 pm

Look guys, what you're asking for is not something s2Member provides by default (at least not now) and most people aren't asking for it. I'm sorry, customizing this goes beyond support for the plugin, I hope you understand.

That said, I mentioned this to Jason earlier and it's being considered, but I have no date for it since there are several other things to be done as well.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: No answer? Disable user login confirmation for paying us

Postby Cristián Lávaque » July 27th, 2011, 11:08 pm

candy wrote:I am sorry Christian, but your code definitely does not log the user in :-(
It prevents that second screen to appear (the one which usually appears after registration, asking the fresh user to log in) but when I try to access a page which would only be available to a registered user, it sends me to the memberships page, asking me to pay again! (which is wrong). And the user is definitely not "in".


That's odd, in my tests it logs me in and takes me to the Login Welcome Page, which is protected at Level 0 and I wouldn't be able to see unless logged in.

Just tested with a Level 1 link to register, got logged in automatically again. Went to my admin account, loaded the profile for the new account and it was properly set at Level 1.

There must be something in your installation that's interfering with this if it doesn't work for you. I'm using the latest WordPress and s2Member, TwentyTen theme and only a couple other plugins installed.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: No answer? Disable user login confirmation for paying us

Postby rwilki » July 27th, 2011, 11:33 pm

Cristian, thank you for your feedback and great support. I know now, that s2Member doesn't do what we're asking for but I appreciate the time and energy you've spent replying all this time...
User avatar
rwilki
Registered User
Registered User
 
Posts: 61
Joined: July 22, 2011

Re: No answer? Disable user login confirmation for paying us

Postby Cristián Lávaque » July 27th, 2011, 11:40 pm

Thanks for understanding, Bob.

I'll keep trying to help with what I can, so keep asking if you have trouble/questions with s2Member. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 2 guests

cron