[2.0.15] Redirect anonymous users to login

The cleanup is complete. This forum is now read only.
Post Reply

Rating:

Excellent!
102
73%
Very Good
25
18%
Good
3
2%
Fair
1
1%
Poor
8
6%
 
Total votes: 139

StefanKausL
Registered User
Posts: 36
Joined: Fri Jul 09, 2004 7:20 pm
Location: Germany
Contact:

Re: codes

Post by StefanKausL »

the darkknight wrote: Parse error: parse error in C:\php\phpBB2\_debug_tmp.php on line 139

Please paste some lines of code around line 139, maybe we can see what's wrong.

StefanKausL
Registered User
Posts: 36
Joined: Fri Jul 09, 2004 7:20 pm
Location: Germany
Contact:

Alternative Download URL

Post by StefanKausL »

In case the download link for the mod is broken try this one:

http://kuhlins.de/download/redirect_ann ... od.txt.mod

scoobox
Registered User
Posts: 8
Joined: Sat Dec 11, 2004 12:51 pm
Location: Hertfordshire, UK
Contact:

Post by scoobox »

Thanks Stefan for reposting the link to the code. Installed ok.

I have used this mod before and had no second thoughts about reusing. :)
another Firefox user

eyerouge
Registered User
Posts: 9
Joined: Tue Jan 04, 2005 12:36 am
Location: Sweden

Post by eyerouge »

Installed on my heavily modded 2.0.11, everything seems to work as it shouldm including the regsitration of new users.

Thanks. :)

User avatar
mahidhar
Registered User
Posts: 30
Joined: Thu Sep 02, 2004 2:03 am

Post by mahidhar »

I am not able to download this mod. I am getting page not found message. Are there any problems? Can others download?

User avatar
wolfz
Registered User
Posts: 14
Joined: Mon Feb 14, 2005 9:29 pm
Location: Italy

LOOK and READ

Post by wolfz »

mahidhar wrote: I am not able to download this mod. I am getting page not found message. Are there any problems? Can others download?


plase read 3 post over here..
there is a link to download the mod...

ciao ciao

phpbbindia
Registered User
Posts: 6
Joined: Sun Feb 20, 2005 2:02 pm
Contact:

Post by phpbbindia »

great mod.. saves a lots time.. and good for privacy and security of members data from anonmous users

haris
Registered User
Posts: 3
Joined: Sat Feb 19, 2005 3:06 pm
Location: Copenhagen, Denmark

Post by haris »

This is excellent! Thank you! (No offense to the MOD :-) )
Joe Belmaati wrote: Really nice MOD! Perhaps a more comprehensive way or more of a "teaser" version would be to show guests one thing, i.e. "This page contains information about our members - please register or login to view the memberlist" or some sort message. This can be done very simply by putting

Code: Select all

<!-- BEGIN switch_user_logged_out -->
Some info to guests
<!-- END switch_user_logged_out -->
around the info that only guests should see and

Code: Select all

<!-- BEGIN switch_user_logged_in -->
Your regular memberlist html
<!-- END switch_user_logged_in-->
around the info that your logged in members get, instead of the if statement for each of the php files you are MOD'ing.

Lastly, you can avoid touching the php-files by putting this:

Code: Select all

<!-- BEGIN switch_user_logged_out -->
<script language="javascript">
    window.location.href=("login.php");
</script>
<!-- END switch_user_logged_out -->
at the top of every template file that should redirect guests to login, in this case memberlist_body.tpl, groupcp_user_body.tpl, profile_view_body.tpl. Theoretically, my method should be slightly less taxing on performance, as it is using code that is already there in a standard phpbb distribution.

Nothing in the world wrong with this MOD - simply suggesting a simple alternative.. :D

s3rro
Registered User
Posts: 107
Joined: Mon Oct 11, 2004 2:36 pm

Post by s3rro »

I cannot download it from the given link. any other link any update?
Download File: redirect_annonymous_users_to_login_mod_1.0.3.txt.mod

chase453
Registered User
Posts: 7
Joined: Wed Apr 21, 2004 3:17 am

Post by chase453 »

I applied this mod, but when a new user goes to register, he is directed to login. I think StefanKausL mentioned something about this. What did I do wrong?

EDIT: Nevermind!! Figured it out...

Thanks,
Chase

Kanon
Registered User
Posts: 72
Joined: Sat Sep 11, 2004 2:53 pm

Post by Kanon »

I get a parse error too. phpBB 2.0.13

Parse error: parse error in /blabla/profile.php on line 105

I put in the line #

Code: Select all

//
// Start of program proper
//
if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
	$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
	$mode = htmlspecialchars($mode);

	if ( $mode == 'viewprofile' )
//
//
// Redirect anonymous users to login
	if ($userdata['user_id'] == ANONYMOUS)
		{
			redirect(append_sid('login.'.$phpEx));
		}
// Redirect anonymous users to login
//
//	
	
	{
		include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx);
		exit;
	}
Line 105 ----->	else if ( $mode == 'editprofile' || $mode == 'register' )
	{
		if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
		{
			redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
		}

		include($phpbb_root_path . 'includes/usercp_register.'.$phpEx);
		exit;
	}
	else if ( $mode == 'confirm' )
	{
		// Visual Confirmation
Any suggestions on this?

Edit: Not complet code...

StefanKausL
Registered User
Posts: 36
Joined: Fri Jul 09, 2004 7:20 pm
Location: Germany
Contact:

Post by StefanKausL »

This is a common error:

Code: Select all

	if ( $mode == 'viewprofile' )
		// Redirect anonymous users to login
		if ($userdata['user_id'] == ANONYMOUS)
		{
			redirect(append_sid('login.'.$phpEx));
		}
	{
It should be:

Code: Select all

	if ( $mode == 'viewprofile' )
	{
		// Redirect anonymous users to login
		if ($userdata['user_id'] == ANONYMOUS)
		{
			redirect(append_sid('login.'.$phpEx));
		}

Morrisst
Registered User
Posts: 6
Joined: Sat Mar 05, 2005 1:48 pm

Post by Morrisst »

The download link for this shows that the page is not available.
Does anyone have the code that can copy and paste it here on this thread?

Edited:
I should have looked closer. Thanks I see it has been posted just a few before me.\

Thanks.
:oops:

Kanon
Registered User
Posts: 72
Joined: Sat Sep 11, 2004 2:53 pm

Post by Kanon »

StefanKausL wrote: This is a common error:

Code: Select all

	if ( $mode == 'viewprofile' )
		// Redirect anonymous users to login
		if ($userdata['user_id'] == ANONYMOUS)
		{
			redirect(append_sid('login.'.$phpEx));
		}
	{
It should be:

Code: Select all

	if ( $mode == 'viewprofile' )
	{
		// Redirect anonymous users to login
		if ($userdata['user_id'] == ANONYMOUS)
		{
			redirect(append_sid('login.'.$phpEx));
		}


AH!!! I see it!!! :lol:

Now it works!

Thanks! ALOT!! :)

User avatar
webmacster87
Former Team Member
Posts: 3758
Joined: Fri Jun 11, 2004 2:30 am
Location: San Mateo, CA
Name: Douglas Bell
Contact:

Post by webmacster87 »

Download link reports a phpBB.com 404 Not Found error. Can you provide with a direct (and working) download link?

Post Reply

Return to “[2.0.x] MOD Database Cleanup”