[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

sq8
Registered User
Posts: 96
Joined: Thu Sep 06, 2007 7:24 pm

Re: [2.0.15] Redirect anonymous users to login

Post by sq8 » Tue Sep 11, 2007 7:26 pm

Perfect! Thanks! And easy to install, too! (I apparently can't use EasyMod due to security restrictions on my host that force me to upload files manually, so I have to do the mods manually, too.)

kdMO
Registered User
Posts: 2
Joined: Fri Sep 14, 2007 2:15 am

Re: [2.0.15] Redirect anonymous users to login

Post by kdMO » Fri Sep 14, 2007 2:21 am

Thank you so much for this wonderfully simple mod! I installed it in the profile, viewonline, groupcp, index, search and memberlist pages (I have a board that I'd like to be completely locked down and only people that I invite to register are registered). All worked wonderful except for the memberlist page. For some reason, I keep getting the following Warning messages above the memberlist. Does anyone have any tips for me? This is only the second mod that I've installed, so I am completely new to this!

Thanks so much in advance!

**************************************************

Warning: Cannot modify header information - headers already sent by (output started at /home/solanabe/public_html/bb/memberlist.php:2) in /home/solanabe/public_html/bb/includes/sessions.php on line 366

Warning: Cannot modify header information - headers already sent by (output started at /home/solanabe/public_html/bb/memberlist.php:2) in /home/solanabe/public_html/bb/includes/sessions.php on line 367

Warning: Cannot modify header information - headers already sent by (output started at /home/solanabe/public_html/bb/memberlist.php:2) in /home/solanabe/public_html/bb/includes/page_header.php on line 483

Warning: Cannot modify header information - headers already sent by (output started at /home/solanabe/public_html/bb/memberlist.php:2) in /home/solanabe/public_html/bb/includes/page_header.php on line 485

Warning: Cannot modify header information - headers already sent by (output started at /home/solanabe/public_html/bb/memberlist.php:2) in /home/solanabe/public_html/bb/includes/page_header.php on line 486

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51433
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by Brf » Fri Sep 14, 2007 2:45 am

You probably have two blank lines at the top of momberlist.php.
There should be nothing before the <?php

kdMO
Registered User
Posts: 2
Joined: Fri Sep 14, 2007 2:15 am

Re: [2.0.15] Redirect anonymous users to login

Post by kdMO » Sat Sep 15, 2007 1:49 am

That worked! You were right. I had 2 spaces before the <?php

Thank you SO MUCH for your help!

User avatar
shenyang
Registered User
Posts: 15
Joined: Fri May 25, 2007 12:09 pm
Location: Shenyang China
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by shenyang » Tue Sep 18, 2007 2:09 pm

:shock: i have downloaded it, and it is a windows movie file.... click on it and media player opens - somethin don't seem right. anyone else havin this?

User avatar
shenyang
Registered User
Posts: 15
Joined: Fri May 25, 2007 12:09 pm
Location: Shenyang China
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by shenyang » Tue Sep 18, 2007 2:18 pm

damn, just tried again. somethin aint right - like the downloads been hijacked - if anyone could check it out would appreciate! if i'm missin somethin, and there is actually a mod in the mpeg file (which i doubt - even i am new at this stuff) let me know.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51433
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by Brf » Tue Sep 18, 2007 3:21 pm

Use notepad to open it, not media player.

User avatar
shenyang
Registered User
Posts: 15
Joined: Fri May 25, 2007 12:09 pm
Location: Shenyang China
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by shenyang » Tue Sep 18, 2007 4:36 pm

:lol: hehe - thanx Brf! I didn't know what to do with it, but wasn't lookin for a how to video... that wouldv been kinda cool though. cheers! :D

User avatar
cvtrig
Registered User
Posts: 14
Joined: Mon Oct 08, 2007 9:54 am

Re: [2.0.15] Redirect anonymous users to login

Post by cvtrig » Tue Oct 09, 2007 8:36 pm

Works great. I'm creating a private forum where I don't want people to be able to see user lists and such.

I found that this MOD actually needs to included in any of the the menu php file such as search and index in it to make the same change as viewonline.php.

If your view index link is active, protecting the memberlist.php file is only half the battle. If someone can type in index.php or click the link without being logged in then they get your user list any way.

So by adding:

if ($userdata['user_id'] == ANONYMOUS)
{
redirect(append_sid("login.$phpEx?redirect=viewonline.$phpEx", true));
}


to the index php in the first section where the session starts, this eliminates the risk of the index being viewed, especially if you can remove the link to the index as well.
You can teach anyone to paint. You cannot teach anyone to be an artist. That's a quality of mind, a love of the magic of life.

Millard Sheets, 1977

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51433
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by Brf » Wed Oct 10, 2007 4:43 pm

cvtrig wrote: I found that this MOD actually needs to included in any of the the menu php file such as search and index in it to make the same change as viewonline.php.

If your view index link is active, protecting the memberlist.php file is only half the battle. If someone can type in index.php or click the link without being logged in then they get your user list any way.
No they dont. The "link" takes you to memberlist.php, so protecting that file keeps them out.

brianwestchest
Registered User
Posts: 25
Joined: Wed Sep 13, 2006 3:31 pm

Re: [2.0.15] Redirect anonymous users to login

Post by brianwestchest » Wed Oct 17, 2007 8:06 pm

Please forgive me if this is a stupid question. But, I am a NEWBIE. I need detailed instructions.

I only want to use this mod to lock down my memberlist page. I'd like to stop human spammers from targeting me and putting their URLs in my member list in hopes of being crawled by search engines.

How do I go about doing this with phpBB 2.0.22?

Thanks,
Brian

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51433
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by Brf » Wed Oct 17, 2007 8:20 pm

Nope. This mod is the other way around... for keeping guests from seeing your memberlist, not from keeping spammers from putting undesirable info in their profiles...

For spammers, read the sticky at the top of the Support forum -- Preventing SPAM

brianwestchest
Registered User
Posts: 25
Joined: Wed Sep 13, 2006 3:31 pm

Re: [2.0.15] Redirect anonymous users to login

Post by brianwestchest » Wed Oct 17, 2007 8:49 pm

Brf wrote:Nope. This mod is the other way around... for keeping guests from seeing your memberlist, not from keeping spammers from putting undesirable info in their profiles...

For spammers, read the sticky at the top of the Support forum -- Preventing SPAM
I didn't word that very well. I want to hide my memberlist (and that only) from people who are not logged in. Can this mod help me do that? I got confused because it seems to do a lot more and the instructions for the things I need to do before I install it are confusing to me. For example, I'd like all my forums to remain open to search engines. I just don't want people to be able to see my memberlist. I'm hoping hiding my memberlist from guests will deter spammers from trying to sign up.

I was able to figure out how to hide several fields on the registration form that I hope will keep spammers from entering their websites on my forums. Now, they have to be logged in to see those fields in the profile.

Thanks,
Brian

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51433
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by Brf » Wed Oct 17, 2007 9:25 pm

brianwestchest wrote: I'm hoping hiding my memberlist from guests will deter spammers from trying to sign up.
No. They can still spread their pron URLs to your registered users.

To hide your memberlist, do this mod's change to memberlist.php.

clyde4210
Registered User
Posts: 14
Joined: Sat Oct 20, 2007 7:31 pm
Contact:

Re: [2.0.15] Redirect anonymous users to login

Post by clyde4210 » Sat Oct 20, 2007 7:36 pm

Hello,
I have a shoutbox i wish to have a redirection on.

does anyone know how i could add it to this box?, or if this is the correct spot i need to add some code to?

Code: Select all

include("config.php");
include("mainfile.php");

$link = mysql_connect($dbhost, $dbuname, $dbpass);
@mysql_select_db($dbname);
cookiedecode($user);


switch($op){

case write:



$msg = $_POST['shout'];
$time = time();

$user = $cookie[1];
if ($user == "") {
$user = "Anonymous";
}
$result =  mysql_query("INSERT INTO ".$prefix."_shout (UID, PDT, MSG)
VALUES ('$user', '$time', '$msg')") or die(mysql_error());


case read:


$query = mysql_query("select * from ".$prefix."_shout ORDER BY PID DESC");
$nrows = mysql_num_rows($query);
$msg = "output=";
for($i = 0; $i < $nrows; $i++) {
	$row = mysql_fetch_array($query);
	$time = strftime("%a %m/%d/%y %H:%M", $row['PDT']);
	$msg .= "<p class=\"output1\">" . $row['UID'] . " " . $time . "</p>";
	$msg .= "<p class=\"output2\">".$row['MSG'] . "</p>";
	$msg .= "<p class=\"output1\">------------------------------------------------------------------</p><br>";

}


$msg .= "";
echo $msg;

$user = $cookie[1];
if ($user == "") {
$user = "Anonymous";
}
$msg2 = "&username=";
$msg2 .= $user;
echo $msg2;
what i am attempting to do is, let anonymous see the box but not allow them to post in it and have them redirected to the login/register page when they click on the send button.

Post Reply

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

Who is online

Users browsing this forum: No registered users and 9 guests