public function setAsCurrentUser($signalLoader = true, $resetSessionId = true)
    {
        // Get the current variables
        $oldStore = $this->_getVariableStore();

        // When $oldStore is a \Zend_Session_Namespace, then this user is already the current user.
        if (! $this->isCurrentUser()) {
            $this->userLoader->unsetCurrentUser();

            if ($resetSessionId) {
                \Zend_Session::regenerateId();
            }

            $this->_vars = $this->session;

            foreach ($oldStore as $name => $value) {
                $this->_vars->__set($name, $value);
            }

            // Perform the interface switch
            $this->switchLocale();

            if ($signalLoader) {
                $this->userLoader->setCurrentUser($this);
            }
        }

        $this->getCurrentOrganization()->setAsCurrentOrganization();

        return $this;
    }
public function setAsCurrentUser($signalLoader = true, $resetSessionId = true)
    {
        // Get the current variables
        $oldStore = $this->_getVariableStore();

        // When $oldStore is a \Zend_Session_Namespace, then this user is already the current user.
        if (! $this->isCurrentUser()) {
            $this->userLoader->unsetCurrentUser();

            if ($resetSessionId) {
                \Zend_Session::regenerateId();
            }

            $this->_vars = $this->session;

            foreach ($oldStore as $name => $value) {
                $this->_vars->__set($name, $value);
            }

            // Perform the interface switch
            $this->switchLocale();

            if ($signalLoader) {
                $this->userLoader->setCurrentUser($this);
            }
        }

        $this->getCurrentOrganization()->setAsCurrentOrganization();

        return $this;
    }
public function setAsCurrentUser ( $ signalLoader = true , $ resetSessionId = true ) { // Get the current variables $ oldStore = $ this -> _getVariableStore ( ) ; // When $oldStore is a \Zend_Session_Namespace, then this user is already the current user. if ( ! $ this -> isCurrentUser ( ) ) { $ this -> userLoader -> unsetCurrentUser ( ) ; if ( $ resetSessionId ) { \ Zend_Session :: regenerateId ( ) ; } $ this -> _vars = $ this -> session ; foreach ( $ oldStore as $ name => $ value ) { $ this -> _vars -> __set ( $ name , $ value ) ; } // Perform the interface switch $ this -> switchLocale ( ) ; if ( $ signalLoader ) { $ this -> userLoader -> setCurrentUser ( $ this ) ; } } $ this -> getCurrentOrganization ( ) -> setAsCurrentOrganization ( ) ; return $ this ; }
Set this user as the current user.

This means that the data about this user will be stored in a session.

@param boolean $signalLoader Do not set, except from UserLoader
@param boolean $resetSessionId Should the session be reset?
@return \Gems_User_User (continuation pattern)
Set this user as the current user .