WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Lock one of WP Network sites for not registered users (4 posts)

  1. trejder
    Member
    Posted 1 year ago #

    I have a blog network (Multisite), with domain mapping plugin installed, and some of my sites are under development, so I want to lock them from not registered users.

    I tested a few plugins designed for this purpose (Private Only, Private WP suite, Private WP, Members Only, Registered Users Only, Absolute Privacy and Wp-Private) and all failed.

    I accessed site, saw login form, filled it in, marked "Remember Me", logged in and I was redirected to Dashboard (user section) not to site itself. When I re-entered site URL (domain) I again saw login page, though I marked "Remember Me". There is not way I can access site itself.

    I even wrote my own, as simple as possible, plugin for this:

    function show_guest_notice()
    {
    	if(!is_user_logged_in())
    	{
    		echo('No way, man!');
    		die();
    	}
    }
    
    add_action('get_header', 'show_guest_notice');

    and it also failed.

    It seems that either is_user_logged_in() or string user cookie fails on Multisite with Domain Mapping plugin.

    I saw this post and answer by amontobin ("(...) was a domain mapping cookie issue. Now working fine"), but it only assured me that using Multisite with Domain Mapping is source of these problems, but it brings no solution to it.

    So, can anyone help me or got any idea how to make site bloking (is_user_logged_in()) work on Multisite network with Domain Mapping plugin enabled?

  2. trejder
    Member
    Posted 1 year ago #

    This problem is probably caused by redirection done by Domain Mapping plugin and the fact that WordPress login cookie (written for original domain) is not available for domain to which Domain Mapping redirects to.

    Look into this question or this support issue for more details.

  3. I use http://wordpress.org/extend/plugins/underconstruction/

    Activate it on the site, and the put up a splash page for folks who aren't members of that site. Seems to work...

  4. trejder
    Member
    Posted 1 year ago #

    Thanks! This does seems to be a good idea.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.