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

Admin Control Panel for Super Admins Only

Discussion in 'XenForo Questions and Support' started by Veer, Feb 2, 2011.

  1. Veer

    Veer Well-Known Member

    Hello,

    Is there a way to hide the "Admin Control Panel" link from non-super admin users and also restrict access to admin.php ?

    ACP.png
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    I'm not sure I understand, why are they Administrators if they can't access the ACP?

    Restricting access to admin.php can be achieved using .htaccess, for example:
    Code:
    <Files admin.php>
    AuthType Basic
    AuthName "ACP"
    AuthUserFile "path_to_passwd_file"
    Require valid-user
    </Files>
    
     
    Veer likes this.
  3. Floris

    Floris Guest

    You can use a conditional to check if $visitor.user_id is 1, ..
     
  4. Floris

    Floris Guest

    admin.php > appearance > templates > find: moderator_bar and inside it find this code:
    Code:
    <a href="admin.php" class="acp adminLink"><span class="itemLabel">{xen:phrase admin_control_panel}</span></a>
    and replace it with this code:
    Code:
    <xen:if is="{$visitor.user_id} == 1">
    	<a href="admin.php" class="acp adminLink"><span class="itemLabel">{xen:phrase admin_control_panel}</span></a>
    </xen:if>
    And save the template. The super-admin is usually user id 1, otherwise change it.
     
    Veer likes this.
  5. Veer

    Veer Well-Known Member

    Thanks, Floris & Brogan. That's exactly what I needed.
     
  6. ragtek

    ragtek Guest

    agree:)
     

Share This Page