HOW TO allow viewer to access his own events only

Talk and info about common issues and learn how to do almost anything with ApPHP Calendar

Moderator: alexandrleonenko

administrator
Site Admin
Site Admin
Posts: 6011
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO allow viewer to access his own events only

Postby administrator » May 23rd, '11, 09:31

To allow user to access his own events only, you have to set user ID:
(you don't need to add users in specific table for this - it's optional)

Code: Select all

// where UID - is user ID in your system.
$user_id = UID;
$objCalendar->SetUserID($user_id);


From this moment all events, the visitor of the page could add/edit or manage only his own events.
He couldn't view or access events of other users.

Of, course, if you want to allow visitor to view/work with all events, you have to comment this line of code:

Code: Select all

//$objCalendar->SetUserID($user_id);

Return to “ApPHP Calendar {HOW TO}”