_baseUrl = 'http://' . $CC_CONFIG['baseUrl'] . ":" . $CC_CONFIG['basePort'] . "/"; $this->view->layout()->disableLayout(); // Don't inject the standard Now Playing header. $this->_helper->viewRenderer->setNoRender(true); // Don't use (phtml) templates } /** * Send user to a third-party service to authorize before being redirected * * @return void */ public function authorizeAction() { $auth_url = $this->_service->getAuthorizeUrl(); header('Location: ' . $auth_url); } /** * Called when user successfully completes third-party authorization * Store the returned request token for future requests * * @return void */ public function redirectAction() { $code = $_GET['code']; $this->_service->requestNewAccessToken($code); header('Location: ' . $this->_baseUrl . 'Preference'); // Redirect back to the Preference page } /** * Upload the file with the given id to a third-party service * * @return void * * @throws Zend_Controller_Response_Exception thrown if upload fails for any reason */ public function uploadAction() { $request = $this->getRequest(); $id = $request->getParam('id'); $this->_service->upload($id); } /** * Clear the previously saved request token from the preferences * * @return void */ public function deauthorizeAction() { Application_Model_Preference::$this->_SERVICE_TOKEN_ACCESSOR(""); header('Location: ' . $this->_baseUrl . 'Preference'); // Redirect back to the Preference page } /** * Poll the task queue for completed tasks associated with this service * Optionally accepts a specific task name as a parameter * * @return void */ public function pollBrokerTaskQueueAction() { $request = $this->getRequest(); $taskName = $request->getParam('task'); $this->_service->pollBrokerTaskQueue($taskName); } }