Skip to:
Content
Pages
Categories
Search
Top
Bottom

Require Login

  • Avatar of Budde
    Budde
    Participant

    @budde

    I was wondering if it was possible to require login, in order to view any blogs or the BuddyPress features on WPMU.

    So, essentially – You can’t view anything until you have logged in.

    Is this possible?

Viewing 22 replies - 1 through 22 (of 22 total)
  • Avatar of Jalien
    jalien
    Participant

    @jalien

    Yes

    Get the “More Privacy Options” over at wpmudev.org

    http://wpmudev.org/project/More-Privacy-Options

    Then in the Site Admin options go down to Site Privacy and select:

    “Site can be viewed by registered users of this community only.”

    It’s been a while since I set that part up, but I’m sure that’s all you need. If you want to have the main blog available, but not other blogs then use More Privacy Options, plus “New Blog Defaults” at:

    http://wpmudev.org/project/New-Blog-Defaults

    Set the Site Privacy to “Default: privacy managed per blog” and then in the New Blogs Default set privacy to “I would like my blog to be visible only to registered users from blog community” in the Blog Visibility section.

    I think that is all you need for the setup you asked about.

    Avatar of Budde
    Budde
    Participant

    @budde

    Thanks. Will this also allow me to approve members before letting them login?

    This is a great source for plugins.

    http://wpmudev.org/plugins/

    There is a plugin for site-admin approval of registration. IT is either there or at:

    http://premium.wpmudev.org/

    Trent

    This is exactly what I’m trying to do – create a private, members-only site that could be either invite-only or have the registrants moderated by the admin. I would think this scenario would be pretty common with many groups – companies, orgs etc.

    I’ve spent the past day and a half combing this forum and others looking for the solution. FYI, I’m not a PHP programmer, but I can copy and paste code when necessary. The closest I’ve gotten is with 2 methods:

    - the plugin that Trent posted that PW-protects the member pages. It does allow new registrations but it doesn’t protect the home page or the groups.

    - the More-Privacy-Options plugin mentioned above, with the “Site can be viewed by registered users only..” option turned on. The problem I’m having with this one is there’s nowhere for new people to apply/register. So if you’re a non-member and you go to any page (including the registration page) you get the login screen, which doesn’t have a Register link. I’m guessing there must be a workaround for this, but haven’t been able to find it yet.

    Which brings me to another problem that I’m having, which is how to invite non-members into the site. I’ve got the “Invite Friends” plugin installed and it seems to work ok, but it’s only for the administrator, which is ok for now, but eventually it would be good to be able to allow site members to invite new people in. I see this as an option in the settings, and a link in the Friends sidebar.

    Using a common example, Facebook is pretty much doing all of this now. So non-members arrive at the base URL to a landing page with an intro message, where they can register for membership. Plus existing members can invite (via a link in the friends area) non-members to join up.

    Avatar of Wardeh
    Wardee
    Participant

    @wardeh

    Here is the plugin to moderate new blogs: http://wpmudev.org/project/Moderate-New-Blogs

    But I don’t believe there is one to moderate new users. There is a hack for WPMU that does not work for BP because BP overrides WPMUs registration/activation process. I am working on trying to do the hack to BP… but it is not working so far.

    I would like to have a private network also. I don’t want the main site to be private, but I want all the members, groups (if I use them), forums, wire activity, etc. to be private.

    Regarding the blog privacy, if you set the user blogs to anything but option #1 (google-able), then the blogs don’t show up in BP “blogs” list. I think there needs to be something in the middle here — ie. no search engines can find the blogs, yet members can view the blog lists and browse the blogs.

    I’m working on a non-profit group’s site that doesn’t want any of their membership to be known to non-members. As I said above I think this would be a pretty common situation (companies and orgs that want privacy). More-Privacy-Options is so close, but needs a way for non-members to at least see a signup page. There must be a workaround otherwise this plugin would be pretty limited, so someone out there must have a solution.

    Anyone have any ideas on this? Thanks!

    Avatar of Wardeh
    Wardee
    Participant

    @wardeh

    Yes, I agree.

    If you look at the method that I used in the bbPress Force Login plugin (in plugins forum here) and combine it with the member-login plugin I wrote, it would be quite possible to combine the 2 into a complete site solution with excluding the login and register pages. I don’t have time to look at it now, but it is possible.

    Trent

    I’ll check that out next. I was just looking at the code (again I’m a non-programmer!) in More-Privacy-Options and it seems like you might be able to write in an exception:

    // hook into options-privacy.php.

    add_action(‘blog_privacy_selector’, ‘add_privacy_options’);

    // all three add_privacy_option get a redirect and a message

    $number = intval(get_site_option(‘ds_sitewide_privacy’));

    if (( ‘-1′ == $current_blog->public ) || ($number == ‘-1′)) { // add exclusion of main blog if desired

    add_action(‘template_redirect’, ‘ds_users_authenticator’);

    add_action(‘login_form’, ‘registered_users_login_message’);

    }

    if ( ‘-2′ == $current_blog->public ) {

    add_action(‘template_redirect’, ‘ds_members_authenticator’);

    add_action(‘login_form’, ‘registered_members_login_message’);

    }

    if ( ‘-3′ == $current_blog->public ) {

    add_action(‘template_redirect’, ‘ds_admins_authenticator’);

    add_action(‘login_form’, ‘registered_admins_login_message’);

    Where it says “add exclusion of main blog if desired”. Is there a way to add an exception for the /register page?

    Avatar of Wardeh
    Wardee
    Participant

    @wardeh

    Trent,

    I’ve been meaning to ask you about those.

    On the first: force-member-login. Since I’ve been using my own theme, it doesn’t work. This is the error I get:

    Not Found
    You tried going to http://my-site.net/register, and it doesn't exist. All is not lost! You can search for what you're looking for.

    And with the second: force-login. My forums are still accessible. Well, hang on. I am not using the group forums anymore. So it is my actual forums installation that is still accessible. Perhaps your plugin won’t work for this application?

    I take it you don’t have time right now to help me, so I can wait until you have time. This is not urgent.

    Actually, maybe it makes more sense to have a custom login page. Non-logged in users are already being redirected to the login page now, so you can design that page to have an intro message and a registration form, along with the standard login fields.

    @wardeh – I haven’t actually tried that plugin with a custom member theme, but it might not be working for 2 reasons.

    First might be because the plugin is calling $is_member_page, it might not work unless you have all the functions included with the normal buddypress-member theme.

    Second reason might be because the header('Location: ' . get_settings('siteurl') . '/register'); is calling the register page on the main theme that doesn’t exist? Maybe change that line to header('Location: ' . get_settings('siteurl') . '/wp-signup.php'); and see if that works?

    The bbPress plugin should work if you are calling it out of /my-plugins/ but I am pretty sure you have to have the <?php bb_head(); ?> in your template header as well as <?php do_action('bb_foot'); ?> in your template footer.php.

    Let me know, as the bbPress plugin is just a “redesign” of the force login plugin found in the bbPress forums.

    Trent

    Avatar of Wardeh
    Wardee
    Participant

    @wardeh

    Trent, I don’t think it is the first reason, as I am using the buddypress-member theme, just not the home theme.

    Could be the second. I’ll try what you said later and let you know. Thanks!

    Alrighteethen, I’ve given up on a reg form on a custom login page.

    Even simpler, from a code standpoint is a message on the login page that says “This is a private site. To join, please email the site administrator.” with a spam-proof mailto link. I can then manually sign them up. Pretty clunky, but it sounds like BP will be better at this kind of thing someday soon.

    Nope, that doesn’t work either. With the More-Privacy-Options plugin engaged, when I invite a new user with the Invite Friends plugin they get redirected to the login page without having gotten a username and password. And for some reason I can’t manually add a new user through the admin panel (seems a little silly). So back to the drawing board. Two days, so far, of wrestling with this problem.

    Avatar of Wardeh
    Wardee
    Participant

    @wardeh

    I’m sorry for all your trouble.

    You can manually add users though.

    Under Site Admin > Users there is an option down below the list of users. You add their username and email address.

    Thanks for your understanding Wardeh! Yes, I actually tried that as well, but it’s not an actual user creation, it’s an invite link. When they get the email there’s no user/pw. So when they click to the site, they’re directed to a page that says “You have been added to this blog. Please visit the homepage or login using your username and password.” but they don’t yet have one. And the admin (me) can’t manually give them one in the admin tool. So then they’re redirected by MPO to the login page.

    Seems like BP is just screaming for an elegant solution to all of this. Other than this ‘little problem’ it’s such an amazing system. Do I need to hire a programmer or is it in the very near future? Anyone?

    Avatar of Wardeh
    Wardee
    Participant

    @wardeh

    Okay, let’s see. Even so, you can create the user. That user gets listed right away in the user list. Click on the user and it will let you create a new password won’t it? I’ve done it this way. I think you’ll be able to. I mean, it is not the true solution but it might work for you. AT least in the meantime. Yes, I agree. BP needs a solution to this.

    Ah yes, re-read what you said and found the link. I was using the other “Users” link in the tabs in the top right. So yes, I can use that method for now since they get a username and password sent to them, as well as a link to the login page. I’ll supplement that email with a descriptive one that tells them “How to get started in 5 easy steps”. Thanks again!

    Is there a way to have this allow anyone to see the hometheme/homepage, and then make them login to see anything else….i.e. Myspace? Right now when you go to the site you get the login page only and thats not too informative. thanks.

    Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    I’ve added more privacy to members on my test bp:

    - No one can view any details about other members (Activity, Wire, Profile, Friends list) unless they are friends,

    - Also at BP front page I replaced the sidewide activity widget with Friends activities only, once members login to bp it shows them their friends activities, check it on my test environment: http://wpmu.telecomize.com/

    but the problem here all what I’ve done is playing with the code, so whenever I update my BP I have to go over the same changes. also its not optional feature which members cant set it by themselves, its applied for all members.

    if someone has time and can make it as plugin that would be great!!

    Avatar of Dheerajsingh
    dheerajsingh
    Member

    @dheerajsingh

    You can have a look at this thread for new user moderation

    http://buddypress.org/forums/topic.php?id=1696

Viewing 22 replies - 1 through 22 (of 22 total)

You must be logged in to reply to this topic.