Welcome to Geeklog, Anonymous Friday, April 26 2024 @ 06:57 pm EDT

Geeklog Forums

PHP pages using the usersystem...


Status: offline

broelling

Forum User
Junior
Registered: 04/30/02
Posts: 23
HI I can't seem to understand how to include the usersystem in Geeklog to new pages, which I need to create myself. Pages like f.ex. submit.php, which checks to see if there's a logged in user at the other end. Can somebody tell me how this is included!??
I'd rather be good than clever - I'd rather have all facts wrong, than no reply whatever...
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
It's actually quite easy. First of all, you need to include('lib-common.php'); If you do that, you have access to the $_USER array, which contains the user name and ID (amongst other things). If you need the additional security for the admin area, you should also include('auth.inc.php'); This lets you check if e.g. the current user has the rights to edit stories, like this: if (!SEC_hasRights('story.edit')) { echo "You can't edit stories!"; } Have a good look at the code that's already there. With the information from above, it should be quite obvious how all this works. bye, Dirk
 Quote

Status: offline

broelling

Forum User
Junior
Registered: 04/30/02
Posts: 23
Thanx man! You're right - it's in fact very easy Smile I just had to have a startingpoint...
I'd rather be good than clever - I'd rather have all facts wrong, than no reply whatever...
 Quote

All times are EDT. The time is now 06:57 pm.

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