WordPress.org

Support

Support » Plugins and Hacks » Custom login/register pages?

Custom login/register pages?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I ended up reverting back to using Private BuddyPress instead of this plugin, then doing a check to see if the current user is a member of the current site and logging them out if they’re not.

    function log_out_non_currentsite_users() {
    	    global $current_user;
    		get_currentuserinfo();
    		if (is_user_logged_in() && !is_user_member_of_blog($current_user->ID)) {
    			wp_logout();
    		}
    	}
    	add_action('init', 'log_out_non_currentsite_users');

    This works for my situation as the user on the main site is a generic user that many people will access, while the private area has a different user for each person.

    This doesn’t seem like as much of a solid solution, but the does the trick. Any comments welcome.

    Plugin Author David Sader

    @dsader

    I do not run a BuddyPress install so I am not familiar with all its nuances. Sounds like you are figuring it out, though.

    Does adding the following to the top of my plugin just before the Hooks help?

    if( strpos($_SERVER['REQUEST_URI'], '/register/')) return;

    Plugin Author David Sader

    @dsader

    Further, without editing my plugin but adding to your own a function to remove the actions added by my plugin if the page url contains /register/

    <?php
    add_filter( 'wp_signup_location', 'register_page' );
    	function register_page( $location ) {
    		return '/register/';
    	}
    
    add_action('send_headers','ds_more_privacy_options_register_page',10);
    	function ds_more_privacy_options_register_page() {
    		global $ds_more_privacy_options;
    
    		if( strpos($_SERVER['REQUEST_URI'], '/register/')) {
    			remove_action('template_redirect', array($ds_more_privacy_options, 'ds_users_authenticator'),10);
    			remove_action('template_redirect', array($ds_more_privacy_options, 'ds_members_authenticator'),10);
    			remove_action('template_redirect', array($ds_more_privacy_options, 'ds_admins_authenticator'),10);
    		}
    	}
    ?>

    Thanks for your reply David. I will test over the weekend and get back to you.

    Samantha

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom login/register pages?’ is closed to new replies.