diff options
author | Hendrik Leppelsack <hendrik@leppelsack.de> | 2015-10-26 11:29:01 +0100 |
---|---|---|
committer | Hendrik Leppelsack <hendrik@leppelsack.de> | 2015-10-26 11:29:01 +0100 |
commit | 14804ae7b7d7a2d006b42189ad303241cde2550b (patch) | |
tree | 41740c2f9a49d9491f34a1db30261e9cb52608e1 /controller |
Initial commit
Diffstat (limited to 'controller')
-rw-r--r-- | controller/pagecontroller.php | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php new file mode 100644 index 00000000..af53a9c1 --- /dev/null +++ b/controller/pagecontroller.php @@ -0,0 +1,53 @@ +<?php +/** + * ownCloud - contactsrework + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Hendrik Leppelsack <hendrik@leppelsack.de> + * @copyright Hendrik Leppelsack 2015 + */ + +namespace OCA\ContactsRework\Controller; + +use OCP\IRequest; +use OCP\AppFramework\Http\TemplateResponse; +use OCP\AppFramework\Http\DataResponse; +use OCP\AppFramework\Controller; + +class PageController extends Controller { + + + private $userId; + + public function __construct($AppName, IRequest $request, $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 + */ + public function index() { + $params = ['user' => $this->userId]; + return new TemplateResponse('contactsrework', 'main', $params); // templates/main.php + } + + /** + * Simply method that posts back the payload of the request + * @NoAdminRequired + */ + public function doEcho($echo) { + return new DataResponse(['echo' => $echo]); + } + + +}
\ No newline at end of file |