/** * @param array $requestData * @param DataIO $dataIO */ protected function initializeDataIO(DataIO $dataIO, array $requestData) { $colOpts = $this->dataFactory->createColOpts($requestData['columnOptions']); $limit = $this->dataFactory->createLimit($requestData['limit']); $filter = $this->dataFactory->createFilter($requestData['filter']); $maxRecordCount = $requestData['max_record_count']; $type = $requestData['type']; $format = $requestData['format']; $username = $this->auth->getIdentity()->username; $dataIO->initialize($colOpts, $limit, $filter, $type, $format, $maxRecordCount); $dataIO->setUsername($username); }
/** * Get an instance from this object * @static * @return Shopware_Components_Auth */ public static function getInstance() { if (null === self::$_instance) { self::$_instance = new self(); } return self::$_instance; }
/** * Initiate shopware auth resource * database adapter by default * * @param Enlight_Event_EventArgs $args * @return null|\Zend_Auth */ public function onInitResourceAuth(Enlight_Event_EventArgs $args) { if (!$this->isApiCall) { return; } $adapter = new Zend_Auth_Adapter_Http(array('accept_schemes' => 'digest', 'realm' => 'Shopware4 REST-API', 'digest_domains' => '/', 'nonce_timeout' => 3600)); $adapter->setDigestResolver(new \ShopwarePlugins\RestApi\Components\StaticResolver($this->get('models'))); $adapter->setRequest($this->request); $adapter->setResponse($this->response); $resource = Shopware_Components_Auth::getInstance(); $storage = new Zend_Auth_Storage_NonPersistent(); $resource->setBaseAdapter($adapter); $resource->addAdapter($adapter); $resource->setStorage($storage); return $resource; }
/** * Initiate shopware auth resource * database adapter by default * * @param Enlight_Event_EventArgs $args * @return null|\Zend_Auth */ public function onInitResourceAuth(Enlight_Event_EventArgs $args) { $bootstrap = $this->Application()->Bootstrap(); $bootstrap->loadResource('BackendSession'); $resource = Shopware_Components_Auth::getInstance(); $adapter = new Shopware_Components_Auth_Adapter_Default(); $storage = new Zend_Auth_Storage_Session('Shopware', 'Auth'); $resource->setBaseAdapter($adapter); $resource->addAdapter($adapter); $resource->setStorage($storage); $this->registerAclPlugin($resource); return $resource; }