[2.0.15] Redirect anonymous users to login

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

Rating:

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

nickname88
I've Been Banned!
Posts: 9
Joined: Fri Aug 13, 2004 8:51 am

Post by nickname88 »

i found it, you only put REG in the permissions
WhiteFox
Registered User
Posts: 35
Joined: Mon Aug 09, 2004 11:59 am

Post by WhiteFox »

Installed the MOD and I got these when I try to preview my profile page

Code: Select all

Parse error: parse error, unexpected T_ELSE in C:\Program Files\Abyss Web Server\htdocs\forum\profile.php on line 96
StefanKausL
Registered User
Posts: 36
Joined: Fri Jul 09, 2004 7:20 pm
Location: Germany
Contact:

Post by StefanKausL »

WhiteFox wrote: Installed the MOD and I got these when I try to preview my profile page

Code: Select all

Parse error: parse error, unexpected T_ELSE in C:\Program Files\Abyss Web Server\htdocs\forum\profile.php on line 96


Probably you pasted the code at the wrong position like this:

Code: Select all

        if ( $mode == 'viewprofile' )
                if ($userdata['user_id'] == ANONYMOUS)
                {
                        redirect(append_sid('login.'.$phpEx));
                }
        {
It should read:

Code: Select all

	if ( $mode == 'viewprofile' )
	{
		if ($userdata['user_id'] == ANONYMOUS)
		{
			redirect(append_sid('login.'.$phpEx));
		}
StefanKausL
Registered User
Posts: 36
Joined: Fri Jul 09, 2004 7:20 pm
Location: Germany
Contact:

Post by StefanKausL »

nickname88 wrote: i found it, you only put REG in the permissions


Yes, it's that simple :D

To get the MOD working, you have to set up suitable rights. In the Forum Permissions Control section set View, Read, Post etc. to REG.
StefanKausL
Registered User
Posts: 36
Joined: Fri Jul 09, 2004 7:20 pm
Location: Germany
Contact:

Post by StefanKausL »

Crazy Canuck wrote: now, i wanted it on my index page as well, i just added the below into my index page so the ycannot view it without registering :) thanks, i will also add this to my search page.


OK, this works, but I intentionally didn't put the redirect on my index and search page, because I want some visible forums and topics, especially for the rules everybody should read before registering.
Last edited by StefanKausL on Wed Aug 18, 2004 11:03 am, edited 1 time in total.
StefanKausL
Registered User
Posts: 36
Joined: Fri Jul 09, 2004 7:20 pm
Location: Germany
Contact:

Post by StefanKausL »

Caution! That way nobody can register!
Sub_Dive wrote: Is it posible that it don't work as well?
this is the standard:

Code: Select all

#-----[ OPEN ]---------------------------------------------
#
profile.php

#
#-----[ FIND ]---------------------------------------------
#
		if ( $mode == 'viewprofile' )
		{

#
#-----[ AFTER, ADD ]---------------------------------------------
#
			if ($userdata['user_id'] == ANONYMOUS)
			{
				redirect(append_sid('login.'.$phpEx));
			}

#
I have this replace with

Code: Select all

#-----[ OPEN ]---------------------------------------------
#
profile.php

#
#-----[ FIND ]---------------------------------------------
#
		init_userprefs($userdata);

#
#-----[ AFTER, ADD ]---------------------------------------------
#
			if ($userdata['user_id'] == ANONYMOUS)
			{
				redirect(append_sid('login.'.$phpEx));
			}

#

And than it will work


Caution! That way nobody can register!
StefanKausL
Registered User
Posts: 36
Joined: Fri Jul 09, 2004 7:20 pm
Location: Germany
Contact:

Post by StefanKausL »

/\/\orph3us wrote: I loved the Mod, but it is missing this...

posting.php

to stop guest posting... Well, that was the only way I could stop it....

Thanx for the great MOD!


You don't need a redirect in posting.php. Instead set Post to REG in the admin section "Forum Permissions Control".
StefanKausL
Registered User
Posts: 36
Joined: Fri Jul 09, 2004 7:20 pm
Location: Germany
Contact:

Post by StefanKausL »

Vv. wrote: What would search-engines do?
Will they still be able to find and read through the posts?


Search engines did not see posts that are for registered users only, but you can set some forums open to all users including search engines. Go to "Forum Permissions Control" in the admin section and set View and Read to ALL.
wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric »

MOD Updated to version 1.0.3
See first post for Download Link
WhiteFox
Registered User
Posts: 35
Joined: Mon Aug 09, 2004 11:59 am

Post by WhiteFox »

When I try to view the memlist page it give me this error instead

Code: Select all

Fatal error: Call to a member function set_filenames() on a non-object in C:\Program Files\Abyss Web Server\htdocs\forum\includes\page_header.php on line 67
StefanKausL
Registered User
Posts: 36
Joined: Fri Jul 09, 2004 7:20 pm
Location: Germany
Contact:

Post by StefanKausL »

WhiteFox wrote: When I try to view the memlist page it give me this error instead

Code: Select all

Fatal error: Call to a member function set_filenames() on a non-object in C:\Program Files\Abyss Web Server\htdocs\forum\includes\page_header.php on line 67


Seems like an error that has nothing to do with this MOD. However, please check the installation instructions. Maybe you copied the code at a wrong place.
Vv.
Registered User
Posts: 42
Joined: Sat May 29, 2004 10:41 pm

Post by Vv. »

StefanKausL wrote:
Vv. wrote:What would search-engines do?
Will they still be able to find and read through the posts?


Search engines did not see posts that are for registered users only, but you can set some forums open to all users including search engines. Go to "Forum Permissions Control" in the admin section and set View and Read to ALL.

I know, so the boards are readable now for ALL.
But with this mod the boards are not accessible because guests are redirected to login.php, right?
And what I meant: Are searchengines just treated as regular guests? (Guess so huh?)
Vv.
Registered User
Posts: 42
Joined: Sat May 29, 2004 10:41 pm

Post by Vv. »

So this mod may be useful if put in:

- index
- FAQ
- Search (if boards are viewable by ALL)
- Memberlist (for privacy of the members)
- Groups (if the groups are not hidden)

But cannot understand what's te use putting it into viewforum or viewtopic since permissions can be set through ACP..
StefanKausL
Registered User
Posts: 36
Joined: Fri Jul 09, 2004 7:20 pm
Location: Germany
Contact:

Post by StefanKausL »

Vv. wrote: I know, so the boards are readable now for ALL.
But with this mod the boards are not accessible because guests are redirected to login.php, right?


No, if a forum is set to ALL it's accessible to all :wink:
Vv. wrote: And what I meant: Are searchengines just treated as regular guests? (Guess so huh?)


Yes, search engines are treated as guests. This is a characteristic of phpBB.
Vv. wrote: So this mod may be useful if put in:
- index
- FAQ
- Search (if boards are viewable by ALL)
- Memberlist (for privacy of the members)
- Groups (if the groups are not hidden)
But cannot understand what's te use putting it into viewforum or viewtopic since permissions can be set through ACP..


Files to edit are groupcp.php, memberlist.php, profile.php, and viewonline.php. Under certain circumstances it's useful in the files index.php and search.php as well.

viewforum and viewtopic are not listed :wink:
Vv.
Registered User
Posts: 42
Joined: Sat May 29, 2004 10:41 pm

Post by Vv. »

Thanks.
Most is clear, except:
StefanKausL wrote:
Vv. wrote:I know, so the boards are readable now for ALL.
But with this mod the boards are not accessible because guests are redirected to login.php, right?


No, if a forum is set to ALL it's accessible to all :wink:


8O :oops:
Post Reply

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