Commit c6503970a652513ff328b45c5c1c1e6d6bf8c125

Authored by Alex Savenko
1 parent 1a3a0f1d

user registration

Showing 1 changed file with 1 additions and 36 deletions   Show diff stats
app/library/App/Controllers/UserController.php
@@ -44,42 +44,7 @@ class UserController extends CrudResourceController @@ -44,42 +44,7 @@ class UserController extends CrudResourceController
44 44
45 public function registration() { 45 public function registration() {
46 46
47 - //$this->create();  
48 -  
49 - $data = $this->getPostedData();  
50 -  
51 - if (!$data || count($data) == 0) {  
52 - return $this->onNoDataProvided();  
53 - }  
54 -  
55 - if (!$this->postDataValid($data, false)) {  
56 - return $this->onDataInvalid($data);  
57 - }  
58 -  
59 - if (!$this->saveAllowed($data) || !$this->createAllowed($data)) {  
60 - return $this->onNotAllowed();  
61 - }  
62 -  
63 - $data = $this->transformPostData($data);  
64 -  
65 - $item = $this->createModelInstance();  
66 -  
67 - $newItem = $this->createItem($item, $data);  
68 -  
69 - if (!$newItem) {  
70 - return $this->onCreateFailed($item, $data);  
71 - }  
72 -  
73 - $primaryKey = $this->getModelPrimaryKey();  
74 - $responseData = $this->getFindData($newItem->$primaryKey);  
75 -  
76 - $response = $this->getCreateResponse($responseData, $data);  
77 -  
78 - $this->afterHandleCreate($newItem, $data, $response);  
79 - $this->afterHandleWrite();  
80 - $this->afterHandle();  
81 -  
82 - return $response; 47 + $this->create();
83 48
84 } 49 }
85 50