/** * Save the tokens to the registry */ public function connectResponseAction() { $oAuthTokens = $this->sessionStorageAdapter->read('dropboxTokens'); $this->dropbox->getOAuth()->setToken($oAuthTokens); $oAuthTokens = $this->dropbox->getOAuth()->getAccessToken(); if (is_array($oAuthTokens)) { $this->registry->set('tx_dlDropbox', 'oauth_tokens', $oAuthTokens); $this->view->assign('successfullyAuthenticated', true); } }
/** * action show * * @return void */ public function showAction() { /** It seems dropbox ignores the callBackUrl parameters, so the default controller / action is called */ if ($this->sessionStorageAdapter->read('dropBoxConnectInProgress')) { $this->sessionStorageAdapter->delete('dropBoxConnectInProgress'); $this->forward('connectResponse', 'OAuth'); } $syncs = $this->syncConfigurationRepository->findAll(); $this->view->assign('syncs', $syncs); $this->view->assign('isAuthenticated', $this->dropbox->isAuthenticated()); }
/** * @param $remotePath * @return array|bool|true */ protected function getDBDirectoryList($remotePath) { try { $list = $this->dropbox->getMetaData($remotePath); } catch (Exception $e) { if ($e instanceof Dropbox_Exception_NotFound) { $this->flashMessageContainer->add('Folder ' . $remotePath . ' not found in your dropbox.'); } return FALSE; } return $list; }