/** * Remove any existing tokens for applications * * @return void */ public function removeTokensTask() { // [SECURITY] Check for request forgeries Request::checkToken(); // Incoming $ids = Request::getVar('id', array(0)); $ids = !is_array($ids) ? array($ids) : $ids; // Do we actually have any entries? if (count($ids) < 1) { // No entries found, so go back to the entries list with // a message scolding the user for not selecting anything. Tsk, tsk. App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_DEVELOPER_SELECT_APPLICATION_TO', $this->_task), 'error'); return; } // loop through each application id foreach ($ids as $id) { // Load the entry and revoke tokens/codes $row = new Models\Api\Application(intval($id)); $row->revokeAccessTokens(); $row->revokeRefreshTokens(); $row->revokeAuthorizationCodes(); } // Set the redirect URL to the main entries listing. App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_DEVELOPER_REVOKE_TOKENS_SUCCESS')); }