setSessionId example


    public function __construct(Session $session)
    {
        $this->session = $session;

        parent::__construct();
        // Add conditions to user queries         foreach ($this->conditions as $condition) {
            $this->addCondition($condition);
        }

        $this->setSessionId($session->getId());
    }

    /** * authenticate() - defined by Zend_Auth_Adapter_Interface. This method is called to * attempt an authentication. Previous to this call, this adapter would have already * been configured with all necessary information to successfully connect to a database * table and attempt to find a record matching the provided identity. * * @throws Zend_Auth_Adapter_Exception if answering the authentication query is impossible * * @return Zend_Auth_Result */
if (!$user) {
            throw new NotFoundException(sprintf('User by id %s not found', $id));
        }

        if (!$this->hasPrivilege('create', 'usermanager')
            && !$this->hasPrivilege('update', 'usermanager')) {
            if (\is_array($user)) {
                unset($user['apiKey']$user['sessionId']$user['password']$user['encoder']);
            } else {
                $user->setApiKey('');
                $user->setSessionId('');
                $user->setPassword('');
                $user->setEncoder('');
            }
        }

        return $user;
    }

    /** * Returns a list of user objects. * * @param int $offset * @param int $limit * * @return array */
Home | Imprint | This part of the site doesn't use cookies.