Commit 6c48a95f465b7c92372fbcd1abfd2f46578d6304

Authored by Alex Savenko
1 parent 0fc45016

registration

Showing 1 changed file with 16 additions and 0 deletions   Show diff stats
app/library/App/Controllers/UserController.php
... ... @@ -87,6 +87,22 @@ class UserController extends CrudResourceController
87 87  
88 88 }
89 89  
  90 + protected function transformPostData($data)
  91 + {
  92 + $result = [];
  93 +
  94 + foreach ($data as $key => $value) {
  95 + $result[$key] = $this->transformPostDataValue($key, $value, $data);
  96 + }
  97 +
  98 + if (!empty($result))
  99 + {
  100 + $result['role'] = 'User';
  101 + }
  102 +
  103 + return $result;
  104 + }
  105 +
90 106 protected function transformPostDataValue($key, $value, $data)
91 107 {
92 108 if ($key == 'password') {
... ...