1. 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

Discussion in 'XenForo Questions and Support' started by theArchitect, Aug 17, 2012.

  1. theArchitect

    theArchitect Member

    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?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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. theArchitect

    theArchitect Member

    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.
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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. theArchitect

    theArchitect Member

    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.
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Code:
    if (!XenForo_Visitor::getInstance()->isMemberOf(array(3,4,5)))
    
     
    RobinHood likes this.
  7. theArchitect

    theArchitect Member

    I will save the pledge of a first born for a more serious issue, but you get the idea. :)
     
  8. MsJacquiiC

    MsJacquiiC Well-Known Member

    Just the snippet I was looking for! Thanks Jake ;)

    J.
     
  9. MsJacquiiC

    MsJacquiiC Well-Known Member

    LOL!!!!!! Too funny - I suppose Jake would have a tassle of firstborns if earning respect and sharing throughout the XF community were requirements yehehehe
     

Share This Page