Skip to:
Content
Pages
Categories
Search
Top
Bottom

User registration on multisite

Viewing 25 replies - 1 through 25 (of 29 total)

  • jeffacubed
    Participant

    @jeffacubed

    @cobraeyes – I’ve wondered about this exact same bbPress multisite user-registration issue (re-directing to wp-signup.php on the root site regardless of which site the user is registering on…)

    Did you ever find a reasonable solution/resolution?

    -Jeff


    hamsterdj
    Participant

    @hamsterdj

    I’m having the same problem here. When user enters nickname and email address to register, they get redirected to the “default_site_domain/wp-signup.php“, where they have to re-enter everything. It’s very confusing for users wanting to participate on forums to say the least.

    This situation also creates a problem for when a site with forum uses different language than the default site, as mentioned here.

    Can one of the bbPress developers please give us some pointers, or at least tell us that this is not a common problem and we’ll have to figure out why this is happening on our own? We love bbPress and we’re hoping now to get some love back. :)

    @jeffacubed Have you made any progress with this matter? I’m still researching…

    Oh, and I’m running WordPress 3.9 Multisite, bbPress 2.5.3.

    I’ll try to take a look at this this week, there are a couple of ‘gotchas’ when running bbPress in WordPress Multisite. I’ll try to document said findings on the codex and create/update any tickets on Trac.


    jeffacubed
    Participant

    @jeffacubed

    Thx for taking a closer look Stephen! ( @netweb ) – this is seemingly simple – though not simple in seamless execution in a multi-site setup. I’m fairly sure the best way to handle this auto re-direction to the root when registering from WPMS sub-sites is to create a unique wp-signup.php file for any sub-site where one DOES NOT want the re-direction to the root site on registration. I started to test Chris Wiegman’s (& others) method:

    http://chriswiegman.com/2010/02/using-a-custom-wp-signup-page-with-wordpress-mu/

    Which would work – though I didn’t got deep enough (yet) to get the re-direction(s) to the root to stop-happening.

    My ‘temporary’ sol’n @hamsterdj involves two plugins:

    1. Login with Ajax

    2. WP-Members

    While my ‘temporary’ sol’n 100% works (for now) – I’m going to dig-in & try my hand at the custom wp-signup.php sol’n for each sub-site registration as I’m more in favour of soln’s of this nature that do not 100% rely on plugins!

    -Jeff


    lauramelos
    Participant

    @lauramelos

    I’m having this issue too, and couldn’t make it work with those plugins. Is this a “out of the box” problem or something created by some themes or plugin?
    Thanks!


    jeffacubed
    Participant

    @jeffacubed

    I’m not entirely sure it’s a WP multisite core-architecture issue or a specific WP + BP in a multisite environment issue. When I have some ‘testing’ time set aside, I’m going to work through freshly re-creating this entire multisite user-registration conundrum w/ bbPress. The non-plugin sol’n involves having a distinct wp-signup.php files for each separate site across the multisites, though my first attempt at that did not work (likely something in the custom wp-signup.php I created, that I overlooked/mis-understood).

    @lauramelos – As an intermediate sol’n (if your multisite bbPress user registration issue was the same as mine, in that all new registrations were re-directed back to the ‘root’ site), then Login with Ajax (LWA) did resolve that issue, at least for me (i.e new user registrations complete on the site the user is registering from, not re-directing back to the root (site ID=1)).

    It’s on my ‘to do’ list to fully understand what’s really at play here…

    -Jeff


    OlalaWeb
    Participant

    @olalaweb

    Hi,

    Is there any fix to this issue?

    I though bbPress was multisite friendly…

    I’d like not to use a third party plugin but to fix the redirection to the main site.


    korobochkin
    Participant

    @korobochkin

    I posted solution for this issue yesterday but it not appeared here. Maybe it marked as spam? Stupid spam filter system!


    OlalaWeb
    Participant

    @olalaweb

    @korobochkin could you send me your solution by email to support@olalaweb.com ??

    I’ll be glad to fix the issue on my website…

    Thank you


    korobochkin
    Participant

    @korobochkin

    @olalaweb send it. BTW – write all texts for web in your notepad.exe or other app on your computer because web sucks and I have so many times then I loss my data written in stupid browser.


    hamsterdj
    Participant

    @hamsterdj

    @korobochkin could you please try posting your solution here again?


    Robin W
    Moderator

    @robin-w

    @korobochkin

    email me at

    and I’ll post to this thread


    korobochkin
    Participant

    @korobochkin

    @robin-w send it. bbpress.org delete spam replies immediately?


    korobochkin
    Participant

    @korobochkin

    I have solution for this issue!

    First of all — in web published a lot of strange and bad solutions for this issue. Add some rules to .htaccess, change wp-signup.php directly, blah blah blah…

    I dig into the source code and found something interesting. WordPress have wp_signup_location filter which set up the signup page URL (location).

    require_once (TEMPLATEPATH . '/wp-signup.php');
    function selena_signup_page () {
    	return home_url () . '/signup/';
    }
    add_filter ('wp_signup_location', 'selena_signup_page');

    After this create page-signup.php template in your theme folder with your custom forms (buttons, inputs, etc). Forms and other stuff can be grabbed from wp-signup.php. So I took wp-signup.php from root WP folder and put them to my theme folder. But it needs to edit. I remove some requires, functions and function calls (checkout the wp-signup.php). Be careful!

    Right now I dont know how this technique works with caching (but I use Memcached and Batcache on my sites and all works great).

    Next problem is – activate account page. Similar solution. Create page-activate.php template with require_once ( TEMPLATEPATH . '/wp-activate.php'); call inside. And copy wp-activate.php to your theme folder and then edit them (remove requires, filters and actions). Don’t delete this:

    if ( is_object( $wp_object_cache ) )
    $wp_object_cache->cache_enabled = false;

    This line for caching (I write about this above). Maybe someone tell us about object caching in WP? :)

    Now you need disable activation letters (WP sends its twice after this manipulations :). Use wpmu_signup_user_notification filter and your function needs to send emails and return FALSE (or WP send second activation email).

    And that’s all!

    Working example is my sites:

    1. http://armyofselenagomez.com/signup/
    2. http://selenaselena.ru/signup/

    Activation:

    1. http://armyofselenagomez.com/activate/
    2. http://selenaselena.ru/activate/

    It’s a multisite! And both sites also have:

    1. http://armyofselenagomez.com/wp-signup.php
    2. http://armyofselenagomez.com/wp-activate.php
    1. http://selenaselena.ru/wp-signup.php
    2. http://selenaselena.ru/wp-activate.php

    chaharfasl
    Participant

    @chaharfasl

    i had the same problem
    i used the solution with Kolya Korobochkin offered in this topic
    now its ok.

    thanks all


    jeffacubed
    Participant

    @jeffacubed

    I’d say @korobochkin – nailed the solution on this lingering problem with sub-site (only) user-registration, bbPress & multi-site!! Any chance you’d be able to share the exact code/steps you took to resolve this?

    It sounds like hooking into the wp_signup_location filter opens the door :)

    I’ve been trying to work through the steps/logic that Kolya has shared – but I’ve yet to make the entire piece work (though I know it will, eventually)

    -J


    korobochkin
    Participant

    @korobochkin

    I don’t have experience with subfolder installs but I think there is no difference between subdomain and subfolder installs for this case. I can publish my code but its looks like default wp-signup.php and wp-activate.php with small changes like few <div>, additional CSS classes and commented few lines of code.

    At first glance this two files looks messy and hardcoded but you can Folding all functions and comments in code editor.


    jeffacubed
    Participant

    @jeffacubed

    @korobochkin – you’re 100% correct, in that there should be no difference between sub-domain & sub-folder setups for making this work as you described.

    If you could share/paste the actual code for the req’d changed files – that would be wonderful!

    If for whatever reason the actual code can’t be pasted here on the forums, you can always email the files (if you like) to me ( cubedit {at} jeffacubed {dot} com )

    спасибо
    -J


    dingzj
    Participant

    @dingzj

    Spending whole day to figure out the solution of this issue, congrats to @korobochkin for solving this problem.

    Since I’s with WordPress 4.1 and seems it’s have mature multiple sites support, when greping keywords , only these popup, none in the wp-signup.php files.

    grep wp_signup_location * -r
    wp-admin/includes/ms.php:				$sign_up_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );
    wp-includes/canonical.php:				$redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );
    wp-login.php:		wp_redirect( apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ) );
    

    Can you put your code for wp-signup.php page-activate.php at https://gist.github.com/ and give a link here?


    korobochkin
    Participant

    @korobochkin

    I’m sorry for few days of silence. My love in the USA, and I’m in Russia without the visa.

    @jeffacubed thank you for “спасибо”. I can publish the code. Also I can give you access to my private repo on Bitbucket.

    wp_signup_location – it’s the filter which returns the sign up page location (url) and WordPress redirect to this addres. So this address not using in wp-signup.php because you already on the signup page. Your example of grep result shows that this filter using in wp-login.php (this page have the signup link).

    Require necessary files https://gist.github.com/korobochkin/06780b88118e35c3bfd1

    wp-signup.php — https://gist.github.com/korobochkin/9e4f9cd6502c4252d902 I use selena_network_signup_main function from this file on page-signup.php template in child theme.

    wp-activate.php — https://gist.github.com/korobochkin/765d0a5d4e028dc3001a I use selena_network_activation_page function from this file on page-activate.php template.

    And finally https://gist.github.com/korobochkin/a161718855b7784bfb10 file which sends notifications after you create an account and disable default WordPress notifications (return false at the end of the function). If you return true and the end of this function then user get 2 emails with different activation links:
    site.com/wp-activate.php?key=HASH
    site.com/activate/?key=HASH


    korobochkin
    Participant

    @korobochkin

    I’m sorry for few days of silence. My love in the USA, and I’m in Russia without the visa.

    @jeffacubed thank you for “спасибо”. I can publish the code. Also I can give you access to my private repo on Bitbucket.

    wp_signup_location – it’s the filter which returns the sign up page location (url) and WordPress redirect to this addres. So this address not using in wp-signup.php because you already on the signup page. Your example of grep result shows that this filter using in wp-login.php (this page have the signup link).

    My code
    All of this files a part of my mu-plugins for this project.

    Require necessary files — gist.github.com/korobochkin/06780b88118e35c3bfd1

    wp-signup.php — gist.github.com/korobochkin/9e4f9cd6502c4252d902 I use selena_network_signup_main function from this file on page-signup.php template in child theme.

    wp-activate.php — gist.github.com/korobochkin/765d0a5d4e028dc3001a I use selena_network_activation_page function from this file on page-activate.php template.

    And finally gist.github.com/korobochkin/a161718855b7784bfb10 file which sends notifications after you create an account and disable default WordPress notifications (return false at the end of the function). If you return true at the end of this function then user get 2 emails with different activation links:
    site.com/wp-activate.php?key=HASH
    site.com/activate/?key=HASH

    P. S. can’t post this reply with links (bbPress doesn’t allow post replies with links).


    jeffacubed
    Participant

    @jeffacubed

    Thanks so much @korobochkin for sharing this in such detail! I’m going to test this out from start to finish on a 100% fresh bbPress, multi-site setup over the next few weeks. I’m thinking this is ‘finally’ a rock-solid sol’n to managing bbPress on multi-site, particularly in situations where the root site has no obvious visual/branding/etc relationship to the other sites on the network.

    This sol’n looks very solid, much better than what I was previously doing with the Login With Ajax (lwa) plugin, wp-members (plugin) & hard-coded redirections (which while worked, seemed very ‘hacky’) & would not work with the [bbp_register] shortcodes, etc.

    Thanks again Koyla!

    -Jeff


    korobochkin
    Participant

    @korobochkin

    One more thing. I found some “bug” in my solution. If you use wp_signup_location in MU Plugins directory you need to pass three arguments to add_filter, because mu-plugins loaded before plugins or themes.

    1. MU Plugins
    2. Plugins
    3. Themes

    In MU Plugins:

    add_filter ('wp_signup_location', 'selena_signup_page', 99);
    // You can set up any number greater than 10 (default value).
    // Otherwise your WordPress will be redirect users to wrong page.

    In Theme or Plugin:

    add_filter ('wp_signup_location', 'selena_signup_page');
    // or
    // add_filter ('wp_signup_location', 'selena_signup_page', 99);

    korobochkin
    Participant

    @korobochkin

    Oh. Found another bug right now. In wp-signup.php and wp-activate.php exists global variables and in my main function they not defined. I’l publish the solution in the near future.


    korobochkin
    Participant

    @korobochkin

    Fix it. Just add global $active_signup; in selena_network_signup_main. Already update this file on gists.github.

Viewing 25 replies - 1 through 25 (of 29 total)
  • You must be logged in to reply to this topic.
Skip to toolbar