source/Application/Model/User.php
public function loadActiveUser($blForceAdmin = false)
    {
        $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        $blAdmin = $this->isAdmin() || $blForceAdmin;

        // first - checking session info
        $sUserID = $blAdmin ? Registry::getSession()->getVariable('auth') : Registry::getSession()->getVariable('usr');

        // trying automatic login (by 'remember me' cookie)
        $blFoundInCookie = false;
        if (!$sUserID && !$blAdmin && $oConfig->getConfigParam('blShowRememberMe')) {
            $sUserID = $this->_getCookieUserId();
            $blFoundInCookie = $sUserID ? true : false;
        }

        // checking user results
        if ($sUserID) {
            if ($this->load($sUserID)) {
                // storing into session
                if ($blAdmin) {
                    Registry::getSession()->setVariable('auth', $sUserID);
                } else {
                    Registry::getSession()->setVariable('usr', $sUserID);
                }

                // marking the way user was loaded
                $this->_blLoadedFromCookie = $blFoundInCookie;

                return true;
            }
        } else {
            // no user
            if ($blAdmin) {
                Registry::getSession()->deleteVariable('auth');
            } else {
                Registry::getSession()->deleteVariable('usr');
            }

            return false;
        }
    }
public function loadActiveUser($blForceAdmin = false)
    {
        $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        $blAdmin = $this->isAdmin() || $blForceAdmin;

        // first - checking session info
        $sUserID = $blAdmin ? Registry::getSession()->getVariable('auth') : Registry::getSession()->getVariable('usr');

        // trying automatic login (by 'remember me' cookie)
        $blFoundInCookie = false;
        if (!$sUserID && !$blAdmin && $oConfig->getConfigParam('blShowRememberMe')) {
            $sUserID = $this->_getCookieUserId();
            $blFoundInCookie = $sUserID ? true : false;
        }

        // checking user results
        if ($sUserID) {
            if ($this->load($sUserID)) {
                // storing into session
                if ($blAdmin) {
                    Registry::getSession()->setVariable('auth', $sUserID);
                } else {
                    Registry::getSession()->setVariable('usr', $sUserID);
                }

                // marking the way user was loaded
                $this->_blLoadedFromCookie = $blFoundInCookie;

                return true;
            }
        } else {
            // no user
            if ($blAdmin) {
                Registry::getSession()->deleteVariable('auth');
            } else {
                Registry::getSession()->deleteVariable('usr');
            }

            return false;
        }
    }
public function loadActiveUser ( $ blForceAdmin = false ) { $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ blAdmin = $ this -> isAdmin ( ) || $ blForceAdmin ; // first - checking session info $ sUserID = $ blAdmin ? Registry :: getSession ( ) -> getVariable ( 'auth' ) : Registry :: getSession ( ) -> getVariable ( 'usr' ) ; // trying automatic login (by 'remember me' cookie) $ blFoundInCookie = false ; if ( ! $ sUserID && ! $ blAdmin && $ oConfig -> getConfigParam ( 'blShowRememberMe' ) ) { $ sUserID = $ this -> _getCookieUserId ( ) ; $ blFoundInCookie = $ sUserID ? true : false ; } // checking user results if ( $ sUserID ) { if ( $ this -> load ( $ sUserID ) ) { // storing into session if ( $ blAdmin ) { Registry :: getSession ( ) -> setVariable ( 'auth' , $ sUserID ) ; } else { Registry :: getSession ( ) -> setVariable ( 'usr' , $ sUserID ) ; } // marking the way user was loaded $ this -> _blLoadedFromCookie = $ blFoundInCookie ; return true ; } } else { // no user if ( $ blAdmin ) { Registry :: getSession ( ) -> deleteVariable ( 'auth' ) ; } else { Registry :: getSession ( ) -> deleteVariable ( 'usr' ) ; } return false ; } }
Loads active user object. If
user is not available - returns false.

@param bool $blForceAdmin (default false)

@return bool
Loads active user object . If user is not available - returns false .