Give specific group permissions

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
User avatar
Tarantino
Registered User
Posts: 626
Joined: Sat Feb 18, 2012 1:51 pm
Contact:

Give specific group permissions

Post by Tarantino » Sat Dec 09, 2017 8:59 pm

Hi guys, I want to give to a specific group with id 9, the same ability that admins and mods have to see hidden profiles.

I discover this line on phpbb/profilefields/manager.php:

Code: Select all

case 'profile':
				// Show hidden fields to moderators/admins
				if (!$this->auth->acl_gets('a_', 'm_') && !$this->auth->acl_getf_global('m_'))
				{
					$sql_where .= ' AND f.field_show_profile = 1';
				}
How can I add the group id 9 to that code?

I don't mind to do core edit on this.

User avatar
Tarantino
Registered User
Posts: 626
Joined: Sat Feb 18, 2012 1:51 pm
Contact:

Re: Give specific group permissions

Post by Tarantino » Sat Dec 09, 2017 9:48 pm

If I add this && $this->user->data['group_id']!=9 it works only with the default group. It would be better to work with all groups. But how?

User avatar
Tarantino
Registered User
Posts: 626
Joined: Sat Feb 18, 2012 1:51 pm
Contact:

Re: Give specific group permissions

Post by Tarantino » Sat Dec 09, 2017 10:07 pm

Ok I was able to solve it.

I was using && !group_memberships(9,$this->user->data['user_id'],true) and getting an 500 error, but after seen the log, i understand what was missing :lol:

So after adding this to the begin on function:

Code: Select all

if ( !function_exists('group_memberships') )
		{
			include('./includes/functions_user.php');
		}
All worked :P

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 3 guests