'my events' displaying events for admin including events belonging to other user

  • Jono
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 4 months ago #119864 by Jono
Hi,
The 'my events' page in event booking displays the events that a single user has created.
However, when logged in as super admin, the 'my events' page displays all events instead - is it possible for this page to only show super users their own created events?

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #119881 by Tuan Pham Ngoc
Hi

The page is created as a way to allow seeing and managing events from frontend of your site, so we allow super admin to see all events by design.

If you want to only show events created by super admin only, small code modification will be needed. Change code from:
Code:
if (!$user->authorise('core.admin', 'com_eventbooking')) { $query->where('tbl.created_by=' . (int) $user->id); }

To:
Code:
$query->where('tbl.created_by=' . (int) $user->id);

After that, it should work as expected

Tuan
The following user(s) said Thank You: Jono

Please Log in or Create an account to join the conversation.

  • Jono
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 3 months ago #119931 by Jono
Thank you!
Which php file should I edit to do this?

Please Log in or Create an account to join the conversation.

More
7 years 3 months ago #119932 by Tuan Pham Ngoc
Sorry, the file is components/com_eventbooking/model/events.php

Regards,

Tuan
The following user(s) said Thank You: Jono

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc