WordPress.org

Ready to get started?Download WordPress

Forums

More Privacy Options
[resolved] Subsite setup with plugin to protect "it" only... why "register first..." msg? (12 posts)

  1. computerkitten
    Member
    Posted 1 year ago #

    Not understanding why a clickable link at the bottom of a subsite that I'm protecting says the following:

    "Brokers Only can be viewed by members of this blog only.
    Register first as a Network User of Testing"...

    When clicking on that link, takes me to a stripped out page of the main website... not registration box to click on, etc.

    Not sure what to do or what an end user would do trying to view the website...and not having an account at that point they would click on this link and be confused.

    Please help.

    Thanks!
    CK

    http://wordpress.org/extend/plugins/more-privacy-options/

  2. David Sader
    Member
    Plugin Author

    Posted 1 year ago #

    If you have created your own signup/registration page, you can use your own filter plugin to redirect network registration/signup to your custom signup page:

    add_filter( 'wp_signup_location', 'my_better_page' );
    function my_better_page( $location ) {
        return 'my_better_page.php';
    }
  3. computerkitten
    Member
    Posted 1 year ago #

    I have not setup their own signup/registration page... in fact I would like to see this confusing link disappear. I suppose I could hide it in CSS but any other ideas how to disable this?

    Thanks!
    CK

  4. David Sader
    Member
    Plugin Author

    Posted 1 year ago #

    I'm befuddled by what you say is a "confusing link". Sorry for not getting it, yet.

    I'll explain, the plugin redirects to a standard network signup link network_site_url( 'wp-signup.php' )

    That should lead your network users to the default WordPress network signup page.

    Now, the link uses the same wp_signup_location filters as any other signup link in WordPress Multisite.

    Is the url of your network signup page something else?

    Have you other plugins filtering the network signup location?

    At any rate you can search the plugin code for network_site_url( 'wp-signup.php' ) and edit it out yourself I guess.

  5. computerkitten
    Member
    Posted 1 year ago #

    I stated this as "confusing" because it takes you to a non sign-up page by default... here is the page that this link is at:

    http://tinyurl.com/b4d7umg

    If you click on it its a page with no sign up... but has some features from the website. I would have thought it would have had at least a generic sign-up. Anyways preference is to control the user sign-up so would prefer to not have a link at all on that page. Is there a way to take this out?

    Thank you...
    CK

  6. David Sader
    Member
    Plugin Author

    Posted 1 year ago #

    Ahh, I smell what you are stepping in now.

    Even without my plugin you will still have a dead-end "register" link on your login form(and anywhere else WordPress creates the signup/register link.

    So you will need a "must use plugin" like the following to filter all WordPress links looking for the signup page:

    1. Create your own "my_better_page" page on your main site and past the url/permalink into the plugin below.
    2. Paste the code below into a *.php file in your "/wp-content/mu-plugins/" folder.

    add_filter( 'wp_signup_location', 'my_better_page' );
    function my_better_page( $location ) {
        return 'http://my_main_site.com/my_better_page/';
    }
  7. computerkitten
    Member
    Posted 1 year ago #

    Well isn't there a way to simply turn off this link... I don't want them to be able to register at all. I don't want to have to create a my_better_page... looking for just a simple disable of this. Else I'm going to hide it with CSS.

    Thanks!

  8. David Sader
    Member
    Plugin Author

    Posted 1 year ago #

    In the privacy plugin, add a couple backslashes to this line:

    Changing this
    add_action('login_form', array(&$this, 'registered_members_login_message'));

    to this

    //add_action('login_form', array(&$this, 'registered_members_login_message'));

    Or add your own plugin to remove action and add your own.

  9. mjn666
    Member
    Posted 5 months ago #

    Just adding to David's answer re: actions

    Here is a snippet to apply to your themes functions.php which will remove the option to sign-up to the blog when using the option described in this ticket.

    Edit: Oops! Actually this was slightly different to what's described in this post, but I'll leave as an alternative/exaggeration of David's reply.

    /**
     * Plugin: More Privacy Options - Modify Login Screen
     *
     * Removes option to sign-up to blog when using the following option:
     * "I would like my blog to be visible only to registered users I add to <blogname>"
     *
     * {@link http://wordpress.org/plugins/more-privacy-options/}
     */
    global $ds_more_privacy_options;
    remove_action('login_form', array( $ds_more_privacy_options, 'registered_members_login_message'));
  10. rvbinder
    Member
    Posted 2 months ago #

    I just installed your plugin 3.7.1 into MS 3.8.1. I'm seeing the same confusing behavior reported by @computerkitten.

    Per your suggestion, I made the hack on the plugin code.

    The //add_action('login_form' appears three times.

    I commented out in all three - is that what you intended?

    BTW, commenting out code to alter behavior is not good programming practice.

    @mjn666's approach would probably be a cleaner solution, but each of my sites uses a different theme and/or child theme, so that would be gnarly.

    However, after making the suggested change to the plugin and attempting to login, I get
    "ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress"

    Although cookies are enabled, I get this in Chrome, IE 10, and Safari.

    Please advise.

  11. rvbinder
    Member
    Posted 2 months ago #

    And now, I cannot log into the site at all, using network admin credentials that I created it with.

    Tried network deactivate, cannot login.

    Tired deleting the plugin files, cannot login.

    I get the "ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress" in all cases.

  12. David Sader
    Member
    Plugin Author

    Posted 2 months ago #

    rvbinder, go back a few steps and make sure all is well with your installation of multisite. Revert to a working state. And as an aside, you do test your code edits on a sandbox, not a live site, right?

    If you are not comfortable editing existing plugin code, are you comfortable creating your own plugins? If not then I agree with you "commenting out code to alter behavior is not good programming practice". Leave the plugin alone, then.

    Saying you see the "the same confusing behaviour" as the op, then applying old suggestions/changes to current code to a live site without a means to back up is what got you into trouble here, I figure.

    The plugin works as intended out of the box on a clean, unedited, Multisite installation.

    Try it on a vanilla install, a sandbox, of your own before going live with it. You are a network admin, so tinker away in your sandbox, fork it to your heart's content. Do not roll out anything to your live site till you have it well under control on your sandbox setup.

    You said you "Tired deleting the plugin files, cannot login". How closely did you read the installation instructions for this plugin?

    http://wordpress.org/plugins/more-privacy-options/installation/

    Have you created an "mu-plugins" directory? That is where you should be looking to delete it then.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic