1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-11 16:32:55 +00:00

First Commit. Datascheme is in tests

This commit is contained in:
Loic Blot
2014-09-12 11:46:39 +00:00
commit 8d03780e6f
21 changed files with 1128 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
<?php
/**
* ownCloud - ocsms
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Loic Blot <loic.blot@unix-experience.fr>
* @copyright Loic Blot 2014
*/
namespace OCA\OcSms\Controller;
use \OCP\IRequest;
use \OCP\AppFramework\Http\TemplateResponse;
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 turn 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 = array('user' => $this->userId);
return new TemplateResponse('ocsms', 'main', $params); // templates/main.php
}
/**
* Simply method that posts back the payload of the request
* @NoAdminRequired
*/
public function doEcho($echo) {
return array('echo' => $echo);
}
}