| @@ 180-189 (lines=10) @@ | ||
| 177 | /** |
|
| 178 | * @inheritdoc |
|
| 179 | */ |
|
| 180 | public function createUser(array $data) |
|
| 181 | { |
|
| 182 | // @TODO: Add hooks |
|
| 183 | if (ArrayUtils::has($data, 'password')) { |
|
| 184 | // @NOTE: Use Directus password hash |
|
| 185 | $data['password'] = password_hash($data['password'], PASSWORD_DEFAULT, ['cost' => 12]); |
|
| 186 | } |
|
| 187 | ||
| 188 | return $this->createEntry('directus_users', $data); |
|
| 189 | } |
|
| 190 | ||
| 191 | /** |
|
| 192 | * @inheritdoc |
|
| @@ 194-203 (lines=10) @@ | ||
| 191 | /** |
|
| 192 | * @inheritdoc |
|
| 193 | */ |
|
| 194 | public function updateUser($id, array $data) |
|
| 195 | { |
|
| 196 | // @TODO: Add hooks |
|
| 197 | if (ArrayUtils::has($data, 'password')) { |
|
| 198 | // @NOTE: Use Directus password hash |
|
| 199 | $data['password'] = password_hash($data['password'], PASSWORD_DEFAULT, ['cost' => 12]); |
|
| 200 | } |
|
| 201 | ||
| 202 | return $this->updateEntry('directus_users', $id, $data); |
|
| 203 | } |
|
| 204 | ||
| 205 | /** |
|
| 206 | * @inheritdoc |
|