WHK102 wrote: ↑Mon Sep 03, 2018 1:26 am
for specific user group (registred users)
They all are in the registered user group but the anonymous user, so:
Code: Select all
// if not ANONYMOUS
if ($this->user->data['user_id'] != ANONYMOUS)
{
// do your magic
}
instead if you really want to focus on a specific group you oughta know that not every board have the same group's ID as per the default installation (virgin board), so you have to use a query to catch that number. Quite ugly though.
The best way IMO is to create a new user permission to add to the registered user group and use the $auth object to surround your code, like
Code: Select all
// if the user has my permission
if ($this->auth->acl_get('u_my_permission'))
{
// do your magic
}
That's just a starter, please read the docs:
https://area51.phpbb.com/docs/dev/3.2.x ... sions.html