diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-03-26 19:25:07 +0300 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-03-26 19:25:07 +0300 |
commit | bc7676089c7e5fe44d4676b51722f4b6c73b11a1 (patch) | |
tree | 0941c780120abd962591d4521b7742b6953c622a /lib | |
parent | c0bcaa49804eb82fa23f3624e68b7e62c8ac687a (diff) | |
parent | f7f14708a2b1dd9695187a80ebf04ad4a1dea9a8 (diff) |
Merge pull request #15193 from owncloud/stable8-15145
Stable8: 15145
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/appframework/http/notfoundresponse.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/public/appframework/http/notfoundresponse.php b/lib/public/appframework/http/notfoundresponse.php new file mode 100644 index 00000000000..21f0461f5e6 --- /dev/null +++ b/lib/public/appframework/http/notfoundresponse.php @@ -0,0 +1,43 @@ +<?php +/** + * @author Lukas Reschke <lukas@owncloud.com> + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program 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, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCP\AppFramework\Http; + +use OCP\AppFramework\Http; +use OCP\Template; + +/** + * A generic 404 response showing an 404 error page as well to the end-user + */ +class NotFoundResponse extends Response { + + public function __construct() { + $this->setStatus(404); + } + + /** + * @return string + */ + public function render() { + $template = new Template('core', '404', 'guest'); + return $template->fetchPage(); + } +} |