Recent Topics

1 Nov 05, 2006 19:28    

hello,

in the hope that this isn't an FAQ:

on a non public blog i want to show to the (not logged in) public just a neutral login page instead of the blog - is this possible?

PAT

2 Nov 05, 2006 20:05

On like line 450 of /blogs/inc/_blog_main.inc.php add the following;


if ( $blog == $whatever_blog_it_is && !is_logged_in() )
{
	if( !isset($generating_static) )
	{ // We are not generating a static page here:
		$redirect = '?redirect_to='.rawurlencode( regenerate_url() );
	}
	elseif( isset($edited_Blog) )
	{ // We are generating a static page
		$redirect = '?redirect_to='.rawurlencode( $edited_Blog->get('dynurl') );
	}
	else
	{ // We are in a weird situation
		$redirect = '';
	}
	header('Location: '.$htsrv_url.'login.php'.$redirect);
	die;
}

replacing $whatever_blog_it_is with the blog id of the public blog

3 Nov 05, 2006 20:18

balupton wrote:

On like line 450 of /blogs/inc/_blog_main.inc.php add the following;

replacing $whatever_blog_it_is with the blog id of the public blog

problem is, i don't have a public blog. all i want to show is ..htsrv/login.php

regards,

PAT

4 Nov 05, 2006 20:22

sorry, yeh, just replace $whatever_blog_it_is with whatever blog you want to require users to login for. If all yours blog require it, then just get rid of the $blog == $whatever_blog_it_is && part.

5 Nov 06, 2006 07:54

conf/config.php add this just below <?php

$login_required = true;


;)

¥


Form is loading...