Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Thursday, May 23 2013 @ 04:15 AM EDT


 Forum Index > Support > General Geeklog Support New Topic Post Reply
 Redirecting Anonymous Users
   
squatty
 02/07/02 07:43PM (Read 1182 times)  
+++++
Full Member

Status: offline


Registered: 01/21/02
Posts: 269
What's the best way to determine if a user is anonymous vs. logged in?



I have some pages on my site (pages, not blocks) that I would like to only make accessible to registered users. If a user is not logged in they would be redirected to the registration page or a please register to see this page. If a user is logged in they would then get the page they requested.



Can anyone point me at the Geeklog code that would help with the above scenario?



Thanks,
Danny


In a world without walls and fences, who needs Windows and Gates?
 
Profile Email Website
 Quote
Tony
 02/08/02 08:27AM  
AAAAA
Admin

Status: offline


Registered: 12/17/01
Posts: 405
Add this to the top of your PHP file you want to protect after your include of lib-common.php:

if (!($_USER['uid'] > 1)) {
   echo COM_refresh('url_to_some_other_page');
}

-----
The reason people blame things on previous generations is that there's only one other choice.


The reason people blame things on previous generations is that there's only one other choice.
 
Profile Email Website
 Quote
squatty
 02/11/02 10:17AM  
+++++
Full Member

Status: offline


Registered: 01/21/02
Posts: 269
Thanks! Sometimes it's the simplest things that make Geeklog so great!

In a world without walls and fences, who needs Windows and Gates?
 
Profile Email Website
 Quote
Content generated in: 0.38 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
Filtered HTML Allowed 
Censored Content