diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-10 18:40:59 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-11 15:31:29 +0200 |
commit | 75f0d3c093de01365f85e8e3035291d9a9a8c889 (patch) | |
tree | b84b25a2e6eb16c00a74fd6db8b0f446ef661a03 /lib/Controller/PageController.php | |
parent | 3f3ad0eeb8e01fe725a89ad196d23f22ad33de41 (diff) |
Vue cleanup and init
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib/Controller/PageController.php')
-rw-r--r-- | lib/Controller/PageController.php | 62 |
1 files changed, 41 insertions, 21 deletions
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 3ade020c..233a274c 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -1,53 +1,73 @@ <?php /** - * Nextcloud - contacts + * @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com> * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. + * @author John Molakvoæ <skjnldsv@protonmail.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * 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 + * along with this program. If not, see <http://www.gnu.org/licenses/>. * - * @author Hendrik Leppelsack <hendrik@leppelsack.de> - * @copyright Hendrik Leppelsack 2015 */ namespace OCA\Contacts\Controller; -use OCP\IRequest; -use OCP\AppFramework\Http\TemplateResponse; -use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Controller; +use OCP\AppFramework\Http\TemplateResponse; +use OCP\IRequest; class PageController extends Controller { - private $userId; - public function __construct($AppName, IRequest $request, $UserId){ + public function __construct(string $AppName, + IRequest $request, + string $UserId) { parent::__construct($AppName, $request); $this->userId = $UserId; } /** - * CAUTION: the @Stuff turns off security checks; for this page no admin is - * required and no CSRF check. If you don't know what CSRF is, read - * it up in the docs or you might create a security hole. This is - * basically the only required method to add this exemption, don't - * add it to any other method if you don't exactly know what it does - * * @NoAdminRequired * @NoCSRFRequired + * + * Default routing */ - public function index() { + public function index(): TemplateResponse { $params = ['user' => $this->userId]; - return new TemplateResponse('contacts', 'main', $params); // templates/main.php + + return new TemplateResponse('contacts', 'main', $params); // templates/main.php } /** - * Simply method that posts back the payload of the request * @NoAdminRequired + * @NoCSRFRequired + * + * Default routing for groups */ - public function doEcho($echo) { - return new DataResponse(['echo' => $echo]); + public function indexGroup(): TemplateResponse { + return $this->index(); } + /** + * @NoAdminRequired + * @NoCSRFRequired + * + * Default routing for contacts + */ + public function indexContact(): TemplateResponse { + return $this->index(); + } } |