• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 Board Closed Access

#1
First time user, long time admirer...

So, Xenforo is installed and I am happily setting everything up. However, I want to invite some of our long time users to start creating some threads and a bit of vibe before launching the board on the world. But the closed forum seems only accessible to Administrators.

I created a test admin with no privileges, but this is not ideal as it still gives Admin CP access.

Is there a way to create a usergroup with access to a closed board but without Admin CP access?
 

Jake Bunce

XenForo moderator
Staff member
#2
Is there a way to create a usergroup with access to a closed board but without Admin CP access?
Quick file hack:

library/XenForo/ControllerPublic/Abstract.php

Add the red code and specify the privileged user_group_id:

Code:
	/**
	 * Checks that the board is currently active (and can be viewed by the visitor)
	 * or throws an exception.
	 *
	 * @param string $action
	 */
	protected function _assertBoardActive($action)
	{
		$options = XenForo_Application::get('options');
		if (!$options->boardActive && !XenForo_Visitor::getInstance()->get('is_admin'))
		{
			if (!XenForo_Visitor::getInstance()->isMemberOf(4))
			throw $this->responseException($this->responseMessage($options->boardInactiveMessage), 503);
		}
	}
 
#3
Wonderful. Thank you,

One supplementary question: I was wanting to customize access to a specific Node (to create a moderators only forum). But mistakenly thought the usergroup option under the node needed to have their permissions changing (instead of making the node private and granting access on a user by user basis).

In the process I removed all Registered User options. How can I reset them to the default.
 

Jake Bunce

XenForo moderator
Staff member
#4
Wonderful. Thank you,

One supplementary question: I was wanting to customize access to a specific Node (to create a moderators only forum). But mistakenly thought the usergroup option under the node needed to have their permissions changing (instead of making the node private and granting access on a user by user basis).

In the process I removed all Registered User options. How can I reset them to the default.
Edit the group again and change all of the custom permissions to Inherit (the gray one). If everything is gray then it will remove the custom permission record.
 
#5
Sorry, supplementary, supplementary.

I edited the PHP for forum access and this works great, with one user group. I thought that to add multiple groups I would just put a , between the groups. e.g.:
Code:
if (!XenForo_Visitor::getInstance()->isMemberOf(3,4,5))
But it seems this doesn't work.
 

MsJacquiiC

Well-known member
#8
Quick file hack:

library/XenForo/ControllerPublic/Abstract.php

Add the red code and specify the privileged user_group_id:

Code:
/**
* Checks that the board is currently active (and can be viewed by the visitor)
* or throws an exception.
*
* @param string $action
*/
protected function _assertBoardActive($action)
{
$options = XenForo_Application::get('options');
if (!$options->boardActive && !XenForo_Visitor::getInstance()->get('is_admin'))
{
if (!XenForo_Visitor::getInstance()->isMemberOf(4))
throw $this->responseException($this->responseMessage($options->boardInactiveMessage), 503);
}
}
Just the snippet I was looking for! Thanks Jake ;)

J.