Member menu visible for Admins only... how?

How would I tweak the code so the Member Menu was only visible to those with Admin rights?

TIA

http://pkforum.dolphinhelp.com
Quote · 21 Apr 2012

Yes.

Edit inc\classes\BxDolMemberMenu.php

Find this code at about line. 465

        function genMemberMenu($memberID = 0)
        {

            if(!isAdmin()) return;

            if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->beginMenu('Member Menu');

            // ** init some needed variables ;

            $aMemberInfo = array();
            $sOutputCode   = null;
            //--

            // if member's id was defined, that will receive all member's info ;
            if ($memberID) {
                $aMemberInfo  =  getProfileInfo($memberID);
                $aMemberInfo['ProfileLink'] = getProfileLink($aMemberInfo['ID']);
            }

            // if member not logged ;
            if (!$aMemberInfo) {
                if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->endMenu('Member Menu');
                return ;
            }


Insert the line highlighted as shown below.

        function genMemberMenu($memberID = 0)
        {
            if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->beginMenu('Member Menu');

            // ** init some needed variables ;

            $aMemberInfo = array();
            $sOutputCode   = null;
            //--

            // if member's id was defined, that will receive all member's info ;
            if ($memberID) {
                $aMemberInfo  =  getProfileInfo($memberID);
                $aMemberInfo['ProfileLink'] = getProfileLink($aMemberInfo['ID']);
            }

            // if member not logged ;
            if (!$aMemberInfo) {
                if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->endMenu('Member Menu');
                return ;
            }

EDITED. Needed to correct a mistake.

https://www.deanbassett.com
Quote · 21 Apr 2012

Added and tested... works perfect... thank you!  Smile

http://pkforum.dolphinhelp.com
Quote · 21 Apr 2012

Actually i need to make a correction. The line needs to be moved above the line that turns on the profiler. It may only be a problem for those that have the profiler module installed. Which i don't.

Above code has been edited to correct my mistake.


https://www.deanbassett.com
Quote · 21 Apr 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.