Rename controller, no userID needed
This commit is contained in:
parent
c3eedc1460
commit
4031687e26
|
|
@ -14,7 +14,7 @@ namespace OCA\Registration\AppInfo;
|
|||
|
||||
use \OCP\AppFramework\App;
|
||||
|
||||
use \OCA\Registration\Controller\PageController;
|
||||
use \OCA\Registration\Controller\RegistrationController;
|
||||
|
||||
|
||||
class Application extends App {
|
||||
|
|
@ -28,11 +28,10 @@ class Application extends App {
|
|||
/**
|
||||
* Controllers
|
||||
*/
|
||||
$container->registerService('PageController', function($c) {
|
||||
return new PageController(
|
||||
$container->registerService('RegistrationController', function($c) {
|
||||
return new RegistrationController(
|
||||
$c->query('AppName'),
|
||||
$c->query('Request'),
|
||||
$c->query('UserId')
|
||||
$c->query('Request')
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -16,33 +16,36 @@ use \OCP\IRequest;
|
|||
use \OCP\AppFramework\Http\TemplateResponse;
|
||||
use \OCP\AppFramework\Controller;
|
||||
|
||||
class PageController extends Controller {
|
||||
class RegistrationController extends Controller {
|
||||
|
||||
private $userId;
|
||||
|
||||
public function __construct($appName, IRequest $request, $userId){
|
||||
parent::__construct($appName, $request);
|
||||
$this->userId = $userId;
|
||||
}
|
||||
public function __construct($appName, IRequest $request, $userId){
|
||||
parent::__construct($appName, $request);
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @PublicPage
|
||||
*/
|
||||
public function index() {
|
||||
$params = array('user' => $this->userId);
|
||||
return new TemplateResponse('registration', 'main', $params); // templates/main.php
|
||||
}
|
||||
*/
|
||||
public function displayRegisterPage($errormsg, $entered) {
|
||||
OC_Template::printGuestPage('core/registration', 'register',
|
||||
array('errormsg' => $errormsg,
|
||||
'entered' => $entered));
|
||||
}
|
||||
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);
|
||||
}
|
||||
/**
|
||||
* Simply method that posts back the payload of the request
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function doEcho($echo) {
|
||||
return array('echo' => $echo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue