Skip to:
Content
Pages
Categories
Search
Top
Bottom

I would like to disable Email activation

Viewing 25 replies - 1 through 25 (of 28 total)
  • You don’t want to do that since then anyone can sign up with anyone else’s or an invalid email address.


    ousep
    Participant

    @ousep

    Theoretically, if we’d like to disable it, is there a way we can define it in wp-config or bp-custom?

    We’ve got a workaround, but it involves changing a core file, bp-core-signup.php. We changed this line:

    $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_status = 2 WHERE ID = %d", $user_id ) );

    to set the user_status as 0 (activated)

    $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_status = 0 WHERE ID = %d", $user_id ) );

    Next, we changed a line in register.php, in a child theme, where we changed the conditional

    <?php if ( bp_registration_needs_activation() ) : ?>

    to

    <?php if ( !bp_registration_needs_activation() ) : ?>

    This solves the problem, but it involves modifying a core file. Any workaround for that?

    If you put the following code in a plugin then this will disable activation, although the users will still receive an activation email. In any case, they will be able to log straight in and the new account screen will tell them that.

    If someone wants to add this to a plugin and release it please do, but I haven’t tested it, so do that first. In the next version I will add an option to disable activation emails too.

    function disable_validation( $user_id ) {
    global $wpdb;

    $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_status = 0 WHERE ID = %d", $user_id ) );
    }
    add_action( 'bp_core_signup_user', 'disable_validation' );

    function fix_signup_form_validation_text() {
    return false;
    }
    add_filter( 'bp_registration_needs_activation', 'fix_signup_form_validation_text' );


    ousep
    Participant

    @ousep

    Thanks… Will try that out.

    In the activation email, I’ve reworded the text to remove the link, and made it a general “How do you do?” mail.

    Added a link to recover username/password, to make the mail slightly useful.

    Just be aware that when you hack the core you will lose your changes on every upgrade. So make a backup if you must.


    ousep
    Participant

    @ousep

    Tried it out… works perfect.

    I just threw that code into bp-custom.php, and that’s all it took.

    Instead of disabling the email entirely, perhaps you could give options of customizing the welcome mail? Or would that be too much as a core function?

    Next version of Welcome Pack will allow email customisation</plug>


    nickrita
    Participant

    @nickrita

    With BP 1.2 a new user doesn’t get the welcome mail that I set in the admin options. That’s bad, because it contains important information for the user.

    Is there any chance to send an activation-mail (which at the moment causes an error) and, after activation, the first mail that’s set in the options?


    treelovinhippie
    Member

    @treelovinhippie

    Could someone please kindly turn this into a plugin?

    Does this also work with the BP Compatibility plugin or would there be an extra step? I have no problems getting this hack to work with single user WP + BP. However, when I try it with WPMU, it doesn’t work. I thought perhaps it was due to the fact that I’m using the Compatibility plugin in conjunction, but even when that is deactivated the hack isn’t working. Thoughts?


    Shanni Einer
    Participant

    @seosupportbay

    In all honestly, I wouldn’t recommend disabling email verification. In fact – you actually should not only use that, but use it with Gravatar to double verify members. My BP communities are brand new, in dev stages right now. I’ve already been subjected to spammers which is why I support use of Gravatars – because not only will your users be verified in your community, but globally and this is a big step in spam prevention.

    If you want to customize the registration page, many of them can be through your theme framework. However, too much code will slice your page & overall framework right down the middle and break your site.


    ousep
    Participant

    @ousep

    Just to clarify, I’m not in favour of disabling email activation, either. The spam you’d be getting would kill your site.

    However, the site I was doing this for does not allow users to post status updates in the conventional form. The site is an anonymous image sharing site. Users need to be registered to submit an image, but they needn’t be registered as themselves. Every user has the option of using [username]@domain.ext as their email address if they choose to stay anonymous.

    Status updates are replaced by img tags to the uploaded image. Yes, they could spam in activity comments, but I guess that’s a risk that had to be taken. Until someone figures out how to use akismet on those comments too…


    Hollosch
    Participant

    @hollosch

    Had someone turned this into a plugin ?


    techguy
    Participant

    @crashutah

    I’ve started looking into bypassing the activation email. It seems like the code @ wrote above only works for regular WP installs and not WPMU. WPMU uses the wp_signups table and then when they’re activated they’re moved to wp_users. I’m going to see if I can’t figure out the WPMU code to do this. I’d love to hear if people know more about this. Otherwise, I’ll ask in the WPMU forums.

    Also, it seems like you could just use this function to disable the activation email from happening (once again that doesn’t work in WPMU though):
    function disable_activation_email() {
    return false;
    }
    add_filter( ‘bp_core_signup_send_activation_key’, ‘disable_activation_email’ );


    Mark
    Participant

    @wpsec

    @techguy – you might want to get a beta copy of WP 3.0 and work with that instead on this tweak – reason being that WPMU code is merging with WP code starting with WP 3.0


    techguy
    Participant

    @crashutah

    M,
    Yes, I thought of that. I installed the beta copy of WP 3.0 today and found that the users are still stored in the same places for a WP/BP install or a WPMU/BP install as they are separate. So, unless they’ve changed the core user signup calls, then we should be good, but I’ll be sure to test it.

    It’s just too bad that there’s not some BP functions that I could just call like bp_core_creat_user(some variables) and bp_core_activate_user(some variables) so we didn’t have to dig in to figure out the functions that BP is already calling at registration. Maybe there is and I just don’t know it?


    techguy
    Participant

    @crashutah

    Thanks to Sarah Gooding, I found this plugin which mostly works with WPMU 2.9.2 and BP 1.2.3: http://www.thinkinginwordpress.com/2009/10/autoactivate-users-and-blogs-at-buddypress-signup/ Only problem is that it still sends the activation email despite the email already being active.

    My hope is to incorporate the code from Andy so that it will work with both WPMU and WP and then make it so neither one sends the activation email.

    If anyone has ideas why it’s sending the activation email in WPMU, I’d appreciate any help. Seems like it might be a priority issue, but I haven’t yet figured that out.


    techguy
    Participant

    @crashutah

    @Hollosch I turned Andy’s code and my little addition to disable the email at activation into a plugin. I’ve posted it to my blog for now: http://www.crashutah.com/blog/juanchito/2010/05/12/buddypress-disable-email-activation-my-first-buddypress-plugin/ I’m still waiting for the SVN access to be able to add it to the WP plugin repository.

    Also, right now the plugin only works for standard WP. I’m still working on disabling the activation email for WPMU, but have to figure out why it’s sending the email still.

    hey guys, this is all awesome, btw the code to disable activation email from being sent is not working, however I edited that into a welcome email instead and removed the link. My qustion is, how can we automatically sign in registered users? :)

    They are activated already so it is pointless to ask them to log in, really.

    Any ideas?

    Cheers.


    techguy
    Participant

    @crashutah

    @mazen I’m planning to look at this as well. Just haven’t had time yet. My plan was to look at how this plugin does it: https://wordpress.org/extend/plugins/wp-fb-autoconnect/ Hopefully that can be used to do the automatic login. I know there’s a paid plugin that does it so it’s possible.


    techguy
    Participant

    @crashutah

    @mazen I just figured out the code to make it work on WP. I’ll add it to my plugin above soon. Here’s the code:
    //Automatically log the user in
    $user_info = get_userdata($user_id);
    wp_set_auth_cookie($user_id);
    do_action(‘wp_signon’, $user_info->user_login);

    I tried it a little with WPMU. It kind of works, but there’s some sequencing that needs to happen better. Cause it logs me in, but not before the login box appears in the sidebar. So, it looks like you’re not logged in, but you are. Which is weird, because it’s not happening to me on WP. Although, it’s likely cause on WP I’m hooking to bp_core_signup_user and in WPMU it hooks to wpmu_signup_user_notification.

    Who’s for a unified signup process (WPMU and WP) now that they’re one?

    @crashutah thanks a lot man for your responses and information. I’ve noticed that there is some differences indeed between single and MU handling the whole registration, activation, and log in processes.

    I tried this piece of code (in my functions.php after the disabling activation and email bits) however it game me some weird behavior and my backend became non functional. I probably missed something (used the code as is while I needed to modify) or maybe one of my other plugins is causing misbehavior? I have auto redirect to profile on login plugin, and branded login plugin activated.

    Cheers.


    techguy
    Participant

    @crashutah

    If you put it in functions.php you’ll probably need to do something like this:
    function auto_login_bp() {
    //Automatically log the user in
    $user_info = get_userdata($user_id);
    wp_set_auth_cookie($user_id);
    do_action(‘wp_signon’, $user_info->user_login);
    }

    add_filter( ‘wpmu_signup_user_notification’, ‘auto_login_bp’ );

    Although, even then it might not know the $user_id variable. So, you might have to add the code in my original post to the bp-auto-activate-user-and-blog plugin on line 170 or so. Although, that will cause the issues I mentioned above I think.

    Any closer to getting this to work with mu?

    Thanks,
    eor

    techguy …I’ll be looking forward to your progress on this. As a side note…I’ve enjoyed your contributions around this community. Kudos

Viewing 25 replies - 1 through 25 (of 28 total)
  • The topic ‘I would like to disable Email activation’ is closed to new replies.
Skip to toolbar