registration/controller/pagecontroller.php

49 lines
1.0 KiB
PHP

<?php
/**
* ownCloud - registration
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Pellaeon Lin <pellaeon@hs.ntnu.edu.tw>
* @copyright Pellaeon Lin 2014
*/
namespace OCA\Registration\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;
}
/**
* @NoAdminRequired
* @PublicPage
*/
public function index() {
$params = array('user' => $this->userId);
return new TemplateResponse('registration', 'main', $params); // templates/main.php
}
/**
* Simply method that posts back the payload of the request
* @NoAdminRequired
*/
public function doEcho($echo) {
return array('echo' => $echo);
}
}