#1 WordPress forum plugin created by gVectors Team

wpForo – WordPress Forum Plugin
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation

Forum

Home | Forum

wpDiscuz - WordPress Comment Plugin
  • Forums
  • Members
  • Recent Posts
Forums
Main Support Forums
Bug Reports
WP MultiSite - User...
 
Share:
Share
Tweet
Share
Notifications
Clear all

[Solved] WP MultiSite - User registration issue?

    Last Post
RSS

Hansie
Posts: 18
 Hansie
Topic starter
January 22, 2021 1:14 pm
(@hansie)
Active Member
Joined: 5 years ago

Dear WPForo team,

Trying to resolve an issue with MultiSite user registration activation (see this post in the forum), I noticed something that may be a bug or not. Please correct me if I'm wrong.

For MultiSite users, and email activation enabled, the function wpmu_signup_user should be used.
This creates an entry in wp_signups and send an activation email to the user.
Once the user clicks the activation link in this email, the user will be added to the users tabel wp_users.

However, with the current WPForo version (1.9.3) the function register_new_user is being used which right away adds the user to wp_users and does not send an activation email an there will be no entry in wp_signups - the new user can never activate his or her account.

Modifying the original code of a plugin is not something I can recommend to anyone, but while testing this on my test server the following changes worked by modifying wpforo/wpf-includes/class-members.php around line 263 where you'll find:

$user_id = register_new_user( $user_fields['user_login'], $user_fields['user_email'] );
if ( !is_wp_error( $user_id ) && $user_id ) {
do_action( 'wpforo_create_user_after', $data );
WPF()->notice->clear();
WPF()->notice->add('Success! Please check your mail for confirmation.', 'success');
return $user_id;
}

I've modified the code to this for testing:

if( is_multisite() ) {
wpmu_signup_user($user_fields['user_login'], $user_fields['user_email']);
WPF()->notice->clear();
WPF()->notice->add('Success! Please check your mail for confirmation.', 'success');
return TRUE;
} else {
$user_id = register_new_user( $user_fields['user_login'], $user_fields['user_email'] );
if ( !is_wp_error( $user_id ) && $user_id ) {
do_action( 'wpforo_create_user_after', $data );
WPF()->notice->clear();
WPF()->notice->add('Success! Please check your mail for confirmation.', 'success');
return $user_id;
}
}

And now User signup with email activation works correct on my WP Multisite setup.

Please correct me if I'm wrong - I'm not a coding expert and most certainly will not claim to know much about the inner workings of WPForo. 

This topic was modified 1 year ago by Hansie
Topic Tags
multisite user activation email new user
6 Replies
Sofy
Posts: 4057
Sofy - Facebook Sofy - Twitter
 Sofy
Admin
January 22, 2021 2:15 pm
(@sofy)
Support Team
Joined: 4 years ago

@hansie,

The latest versions are not well tested with WordPress multisites. 

The solution found by you is approved by our developers. They found it as a good solution. 

We've added in our to-do list this issue. We'll test and solve all issues with multisites in the next version of the wpForo. 

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
Hansie liked
Hansie
Posts: 18
 Hansie
Topic starter
January 22, 2021 2:23 pm
(@hansie)
Active Member
Joined: 5 years ago

Thanks Sofy! 👍 🙂 

Reply
Hansie
Posts: 18
 Hansie
Topic starter
February 8, 2021 5:24 pm
(@hansie)
Active Member
Joined: 5 years ago

I just installed WPForo 1.9.4, where this fix was included.
However, the implemented fix doesn't work.
The email is still not send to the user to activate.

However, I did find the culprit.

In the file class-members.php, line 263, the devs wrote:

if( is_multisite() && apply_filters('wpforo_mu_signup', false) ){

This somehow prevents the activation email from being send and we're back to the same behavior as before (not sure what the apply_filters does).

After changing that line to:

 if( is_multisite() ) {   

things work correctly again. ( I removed " && apply_filters('wpforo_mu_signup', false)" )

I realize you guys may not have access to Multisite setups, so I hope this is helpful for you.

Reply
1 Reply
Robert
 Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 8959
Robert - Twitter
February 9, 2021 5:06 pm
Reply toHansieHansie
Posted by: @hansie

things work correctly again. ( I removed " && apply_filters('wpforo_mu_signup', false)" )

Don't do this please. This is a hook to enable it using a hook. Don't do any change in the core. Revert it back asap and use this code in your active WordPress theme functions.php file:

add_filter('wpforo_mu_signup', '__return_true' );

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
Hansie liked
Hansie
Posts: 18
 Hansie
Topic starter
February 9, 2021 5:40 pm
(@hansie)
Active Member
Joined: 5 years ago

Thanks Robert,

Some times I temporary have to change something in the core files to make sure my website works. I'd rather not of course - that's why I'm reporting findings here, as it may help make WPForo better. 😊 

I've revert back to the original code and added the add_filter to my functions.php, and your suggestion works. 👍 

On that note: I doubt folks would like to do this for their multisite setups.
After all, if they use a theme, and update would potentially overwrite their functions.php.

Or ... did I overlook a setting that has become available in the latest WPForo version (1.9.4)?

Reply
1 Reply
Robert
 Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 8959
Robert - Twitter
February 9, 2021 7:37 pm
Reply toHansieHansie

Ok, thank you @hansie,

There is no setting for this. The only way is using this hook.

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
  All forum topics
  Previous Topic
Next Topic  
Related Topics
  • when i reset pasword
    2 months ago
  • Forum Profile Fields
    7 months ago
Topic Tags:  multisite (7), user activation (1), email (18), new user (5),

Forum Search

Join Us!

Download wpForo plugin
on WordPress.org

wpForo Addons

wpforo-private-messages wpforo-advanced-attachments-128x128 wpforo-embeds-128x128 wpForo User Custom Fields addon wpForo – Blog Cross Posting addon wpForo Ads Manager wpForo – WooCommerce Memberships Integration wpForo Emoticons wpForo – Tenor GIFs Integration
View all Addons »

Recent Topics

  • wpforo widgets not showing

    By umais, 12 hours ago

  • Error 2253 Root Cause

    By aaronmckeon, 15 hours ago

  • Forum page

    By Charlespresh, 2 days ago

  • How can I make notification bell appear site wide?

    By marios, 2 days ago

  • wpForo not working correctly with Silk browser on Fire 7 Tablet

    By starman71, 2 days ago

  • Style Guests see "Add Topic" button - even if settings are right

    By DanielOfAnu, 2 days ago

Topic Tags

  • translation49
  • css49
  • plugin conflict48
  • seo45
  • new features43
  • buddypress42
  • ultimate member40
  • avatar40
  • forum40
  • moderation38
  • login38
  • registration36
  • threaded layout35
  • cache33
  • editor32
  • menu32
  • shortcode30
  • spam29
  • phrases28
  • forum accesses28
View all tags (2161)

Recent Posts

  • RE: wpForo 2 Major Update is Imminent!

    Damn, i was really looking forward to this feature as I...

    By Macky, 9 hours ago

  • RE: How can i remove the Buttons under Name?

    @y-3 ##wpforo #wpforo-wrap .wpfl-1 .wpforo-post .wpf...

    By Tutrix, 11 hours ago

  • RE: Error 2253 Root Cause

    Hi @robert - Thanks. I have reviewed those threads and...

    By aaronmckeon, 11 hours ago

  • wpforo widgets not showing

    Hello I cant see wpforo widget in the WordPress widge...

    By umais, 12 hours ago

  • RE: When is the Update Coming?

    @robert thanks mate 🙂

    By Macky, 18 hours ago

  • RE: Guests see "Add Topic" button - even if settings are right

    Hi @danielofanu, Check this post please:

    By Chris, 23 hours ago

  • RE: wpForo not working correctly with Silk browser on Fire 7 Tablet

    Add the forums menu items to your main menu 😉

    By Tutrix, 1 day ago

Share:
Share
Tweet
Share
  Forum Statistics
20 Forums
9,749 Topics
49.4 K Posts
6 Online
43.3 K Members

Latest Post: wpForo 2 Major Update is Imminent! Our newest member: mitom1tv Recent Posts Unread Posts Tags

Forum Icons: Forum contains no unread posts Forum contains unread posts

Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Powered by wpForo | Copyright © 2016-2022 gVectors Team
Copyright Registration Service - Click here for more information or to register work
wpForo is Registered with the IP Rights Office
Copyright Registration Service

Ref: 4477265538
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation