And IF it is a MOD, then the credit goes to the author of the Hide All User Info MOD:
Code: Select all
darbyrob rob@wombatmedia.com (Rob Chojnacki)
The ONLY reason I am posting this was when I looked for the solution here, I found other users also looking, and very few answers.
But anyway, for those interested:
Here's how I let only logged in users see certian pages on my site.
Code: Select all
OPEN:
//The .php file you want to protect
FIND:
//
// End session management
//
ADD AFTER:
//
// Block guests from viewing page - Redirect to login
//
if ( !$userdata['session_logged_in'] ) {
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.".$phpEx."?redirect=PAGENAME.".$phpEx, true));
exit;
}
//
// End Block guests
//
FIND:
redirect=PAGENAME.
//change to the name of the page you are trying to protect, minus the php extension ex. example.php = example.