From 77a8e733245d8371d179deaca28473cb70774a48 Mon Sep 17 00:00:00 2001
From: Pellaeon Lin
Date: Fri, 3 Oct 2014 16:15:39 +0800
Subject: [PATCH] Start working on createAccount controller
---
controller/registercontroller.php | 23 ++++++++++++++++++++++-
templates/form.php | 6 +++---
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/controller/registercontroller.php b/controller/registercontroller.php
index f43fec2..4574fc2 100644
--- a/controller/registercontroller.php
+++ b/controller/registercontroller.php
@@ -111,7 +111,28 @@ class RegisterController extends Controller {
))
), 'error');
} elseif ( $email ) {
- return new TemplateResponse('registration', 'form', array(), 'guest');
+ return new TemplateResponse('registration', 'form', array('email' => $email), 'guest');
+ }
+ }
+
+ /**
+ * @NoAdminRequired
+ * @NoCSRFRequired
+ * @PublicPage
+ */
+ public function createAccount($token) {
+ $email = $this->pendingreg->findEmailByToken($token);
+ if ( \OCP\DB::isError($email) ) {
+ return new TemplateResponse('', 'error', array(
+ 'errors' => array(array(
+ 'error' => $this->l10n->t('Invalid verification URL. No registration request with this verification URL is found.'),
+ 'hint' => ''
+ ))
+ ), 'error');
+ } elseif ( $email ) {
+ $username = $this->request->getParam('username');
+ $password = $this->request->getParam('password');
+ return new TemplateResponse('registration', 'form', array('email' => $email), 'guest');
}
}
}
diff --git a/templates/form.php b/templates/form.php
index 2451776..a769867 100644
--- a/templates/form.php
+++ b/templates/form.php
@@ -1,4 +1,4 @@
-
-
-
+
+