source/Core/Utils.php
public function checkAccessRights()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        $blIsAuth = false;

        $sUserID = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("auth");

        // deleting admin marker
        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("malladmin", 0);
        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("blIsAdmin", 0);
        \OxidEsales\Eshop\Core\Registry::getSession()->deleteVariable("blIsAdmin");
        $myConfig->setConfigParam('blMallAdmin', false);
        //#1552T
        $myConfig->setConfigParam('blAllowInheritedEdit', false);

        if ($sUserID) {
            // escaping
            $sRights = $this->fetchRightsForUser($sUserID);

            if ($sRights != "user") {
                // malladmin ?
                if ($sRights == "malladmin") {
                    \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("malladmin", 1);
                    $myConfig->setConfigParam('blMallAdmin', true);

                    //#1552T
                    //So far this blAllowSharedEdit is Equal to blMallAdmin but in future to be solved over rights and roles
                    $myConfig->setConfigParam('blAllowSharedEdit', true);

                    $sShop = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("actshop");
                    if (!isset($sShop)) {
                        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("actshop", $myConfig->getBaseShopId());
                    }
                    $blIsAuth = true;
                } else {
                    // Shopadmin... check if this shop is valid and exists
                    $sShopID = $this->fetchShopAdminById($sRights);
                    if (isset($sShopID) && $sShopID) {
                        // success, this shop exists

                        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("actshop", $sRights);
                        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("currentadminshop", $sRights);
                        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("shp", $sRights);

                        // check if this subshop admin is evil.
                        if ('chshp' == \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('fnc')) {
                            // dont allow this call
                            $blIsAuth = false;
                        } else {
                            $blIsAuth = true;

                            $aShopIdVars = ['actshop', 'shp', 'currentadminshop'];
                            foreach ($aShopIdVars as $sShopIdVar) {
                                if ($sGotShop = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter($sShopIdVar)) {
                                    if ($sGotShop != $sRights) {
                                        $blIsAuth = false;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
                // marking user as admin
                \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("blIsAdmin", 1);
            }
        }

        return $blIsAuth;
    }
public function checkAccessRights()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        $blIsAuth = false;

        $sUserID = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("auth");

        // deleting admin marker
        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("malladmin", 0);
        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("blIsAdmin", 0);
        \OxidEsales\Eshop\Core\Registry::getSession()->deleteVariable("blIsAdmin");
        $myConfig->setConfigParam('blMallAdmin', false);
        //#1552T
        $myConfig->setConfigParam('blAllowInheritedEdit', false);

        if ($sUserID) {
            // escaping
            $sRights = $this->fetchRightsForUser($sUserID);

            if ($sRights != "user") {
                // malladmin ?
                if ($sRights == "malladmin") {
                    \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("malladmin", 1);
                    $myConfig->setConfigParam('blMallAdmin', true);

                    //#1552T
                    //So far this blAllowSharedEdit is Equal to blMallAdmin but in future to be solved over rights and roles
                    $myConfig->setConfigParam('blAllowSharedEdit', true);

                    $sShop = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("actshop");
                    if (!isset($sShop)) {
                        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("actshop", $myConfig->getBaseShopId());
                    }
                    $blIsAuth = true;
                } else {
                    // Shopadmin... check if this shop is valid and exists
                    $sShopID = $this->fetchShopAdminById($sRights);
                    if (isset($sShopID) && $sShopID) {
                        // success, this shop exists

                        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("actshop", $sRights);
                        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("currentadminshop", $sRights);
                        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("shp", $sRights);

                        // check if this subshop admin is evil.
                        if ('chshp' == \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('fnc')) {
                            // dont allow this call
                            $blIsAuth = false;
                        } else {
                            $blIsAuth = true;

                            $aShopIdVars = ['actshop', 'shp', 'currentadminshop'];
                            foreach ($aShopIdVars as $sShopIdVar) {
                                if ($sGotShop = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter($sShopIdVar)) {
                                    if ($sGotShop != $sRights) {
                                        $blIsAuth = false;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
                // marking user as admin
                \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("blIsAdmin", 1);
            }
        }

        return $blIsAuth;
    }
public function checkAccessRights ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ blIsAuth = false ; $ sUserID = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( "auth" ) ; // deleting admin marker \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "malladmin" , 0 ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "blIsAdmin" , 0 ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> deleteVariable ( "blIsAdmin" ) ; $ myConfig -> setConfigParam ( 'blMallAdmin' , false ) ; //#1552T $ myConfig -> setConfigParam ( 'blAllowInheritedEdit' , false ) ; if ( $ sUserID ) { // escaping $ sRights = $ this -> fetchRightsForUser ( $ sUserID ) ; if ( $ sRights != "user" ) { // malladmin ? if ( $ sRights == "malladmin" ) { \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "malladmin" , 1 ) ; $ myConfig -> setConfigParam ( 'blMallAdmin' , true ) ; //#1552T //So far this blAllowSharedEdit is Equal to blMallAdmin but in future to be solved over rights and roles $ myConfig -> setConfigParam ( 'blAllowSharedEdit' , true ) ; $ sShop = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( "actshop" ) ; if ( ! isset ( $ sShop ) ) { \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "actshop" , $ myConfig -> getBaseShopId ( ) ) ; } $ blIsAuth = true ; } else { // Shopadmin... check if this shop is valid and exists $ sShopID = $ this -> fetchShopAdminById ( $ sRights ) ; if ( isset ( $ sShopID ) && $ sShopID ) { // success, this shop exists \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "actshop" , $ sRights ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "currentadminshop" , $ sRights ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "shp" , $ sRights ) ; // check if this subshop admin is evil. if ( 'chshp' == \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'fnc' ) ) { // dont allow this call $ blIsAuth = false ; } else { $ blIsAuth = true ; $ aShopIdVars = [ 'actshop' , 'shp' , 'currentadminshop' ] ; foreach ( $ aShopIdVars as $ sShopIdVar ) { if ( $ sGotShop = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( $ sShopIdVar ) ) { if ( $ sGotShop != $ sRights ) { $ blIsAuth = false ; break ; } } } } } } // marking user as admin \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "blIsAdmin" , 1 ) ; } } return $ blIsAuth ; }
This function checks if logged in user has access to admin or not

@return bool
This function checks if logged in user has access to admin or not