Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-04-20 18:12:46 +0400
committerBernhard Posselt <dev@bernhard-posselt.com>2014-04-20 18:12:46 +0400
commit7e447f4f42de8dc0cf9a1f92c61a71dfda8f8dcd (patch)
tree3ce88392f3a2b54e1d7c8e4c2be88b7764378f26 /lib/private/appframework
parent1abd9c1305745fe4e66b8b4d0a45f56526dad216 (diff)
make download and redirectresponse public
Diffstat (limited to 'lib/private/appframework')
-rw-r--r--lib/private/appframework/http/downloadresponse.php50
-rw-r--r--lib/private/appframework/http/redirectresponse.php57
-rw-r--r--lib/private/appframework/middleware/security/securitymiddleware.php2
3 files changed, 1 insertions, 108 deletions
diff --git a/lib/private/appframework/http/downloadresponse.php b/lib/private/appframework/http/downloadresponse.php
deleted file mode 100644
index 67b9542dba6..00000000000
--- a/lib/private/appframework/http/downloadresponse.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-
-/**
- * ownCloud - App Framework
- *
- * @author Bernhard Posselt
- * @copyright 2012 Bernhard Posselt nukeawhale@gmail.com
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-namespace OC\AppFramework\Http;
-
-
-/**
- * Prompts the user to download the a file
- */
-class DownloadResponse extends \OCP\AppFramework\Http\Response {
-
- private $filename;
- private $contentType;
-
- /**
- * Creates a response that prompts the user to download the file
- * @param string $filename the name that the downloaded file should have
- * @param string $contentType the mimetype that the downloaded file should have
- */
- public function __construct($filename, $contentType) {
- $this->filename = $filename;
- $this->contentType = $contentType;
-
- $this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"');
- $this->addHeader('Content-Type', $contentType);
- }
-
-
-}
diff --git a/lib/private/appframework/http/redirectresponse.php b/lib/private/appframework/http/redirectresponse.php
deleted file mode 100644
index 05353349065..00000000000
--- a/lib/private/appframework/http/redirectresponse.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-
-/**
- * ownCloud - App Framework
- *
- * @author Bernhard Posselt
- * @copyright 2012 Bernhard Posselt nukeawhale@gmail.com
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-namespace OC\AppFramework\Http;
-
-use OCP\AppFramework\Http\Response;
-use OCP\AppFramework\Http;
-
-
-/**
- * Redirects to a different URL
- */
-class RedirectResponse extends Response {
-
- private $redirectURL;
-
- /**
- * Creates a response that redirects to a url
- * @param string $redirectURL the url to redirect to
- */
- public function __construct($redirectURL) {
- $this->redirectURL = $redirectURL;
- $this->setStatus(Http::STATUS_TEMPORARY_REDIRECT);
- $this->addHeader('Location', $redirectURL);
- }
-
-
- /**
- * @return string the url to redirect
- */
- public function getRedirectURL() {
- return $this->redirectURL;
- }
-
-
-}
diff --git a/lib/private/appframework/middleware/security/securitymiddleware.php b/lib/private/appframework/middleware/security/securitymiddleware.php
index bb02d565fa4..0f160d224ad 100644
--- a/lib/private/appframework/middleware/security/securitymiddleware.php
+++ b/lib/private/appframework/middleware/security/securitymiddleware.php
@@ -25,8 +25,8 @@
namespace OC\AppFramework\Middleware\Security;
use OC\AppFramework\Http;
-use OC\AppFramework\Http\RedirectResponse;
use OC\AppFramework\Utility\MethodAnnotationReader;
+use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Middleware;
use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Http\JSONResponse;