Posted on: 06/26/02 10:10am
By: broelling
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!??
Easy
Posted on: 06/26/02 12:17pm
By: Dirk
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
Easy...
Posted on: 06/26/02 11:16pm
By: broelling
Thanx man!
You're right - it's in fact very easy
I just had to have a startingpoint...