RegisterController route

This commit is contained in:
Pellaeon Lin 2014-08-28 15:43:48 +00:00
parent 43c19afed4
commit a88197f646
2 changed files with 7 additions and 21 deletions

View File

@ -22,6 +22,5 @@ namespace OCA\Registration\AppInfo;
$application = new Application();
$application->registerRoutes($this, array('routes' => array(
array('name' => 'page#index', 'url' => '/', 'verb' => 'GET'),
array('name' => 'page#do_echo', 'url' => '/echo', 'verb' => 'POST'),
array('name' => 'registration#displayRegisterPage', 'url' => '/', 'verb' => 'GET')
)));

View File

@ -26,24 +26,11 @@ class RegistrationController extends Controller {
* @NoAdminRequired
* @PublicPage
*/
public function displayRegisterPage($errormsg, $entered) {
OC_Template::printGuestPage('core/registration', 'register',
array('errormsg' => $errormsg,
'entered' => $entered));
public function displayRegisterPage() {
$params = array(
'errormsg' => $this->request->getParam('errormsg'),
'entered' => $this->request->getParam('entered')
);
return new TemplateResponse('registration', 'register', $params);
}
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);
}
}