From c6503970a652513ff328b45c5c1c1e6d6bf8c125 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 7 Feb 2017 18:12:48 +0200 Subject: [PATCH] user registration --- app/library/App/Controllers/UserController.php | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/app/library/App/Controllers/UserController.php b/app/library/App/Controllers/UserController.php index df672b1..8cc5a24 100755 --- a/app/library/App/Controllers/UserController.php +++ b/app/library/App/Controllers/UserController.php @@ -44,42 +44,7 @@ class UserController extends CrudResourceController public function registration() { - //$this->create(); - - $data = $this->getPostedData(); - - if (!$data || count($data) == 0) { - return $this->onNoDataProvided(); - } - - if (!$this->postDataValid($data, false)) { - return $this->onDataInvalid($data); - } - - if (!$this->saveAllowed($data) || !$this->createAllowed($data)) { - return $this->onNotAllowed(); - } - - $data = $this->transformPostData($data); - - $item = $this->createModelInstance(); - - $newItem = $this->createItem($item, $data); - - if (!$newItem) { - return $this->onCreateFailed($item, $data); - } - - $primaryKey = $this->getModelPrimaryKey(); - $responseData = $this->getFindData($newItem->$primaryKey); - - $response = $this->getCreateResponse($responseData, $data); - - $this->afterHandleCreate($newItem, $data, $response); - $this->afterHandleWrite(); - $this->afterHandle(); - - return $response; + $this->create(); } -- libgit2 0.21.4