| @@ 203-212 (lines=10) @@ | ||
| 200 | /** |
|
| 201 | * @inheritdoc |
|
| 202 | */ |
|
| 203 | public function createUser(array $data) |
|
| 204 | { |
|
| 205 | // @TODO: Add hooks |
|
| 206 | if (ArrayUtils::has($data, 'password')) { |
|
| 207 | // @NOTE: Use Directus password hash |
|
| 208 | $data['password'] = password_hash($data['password'], PASSWORD_DEFAULT, ['cost' => 12]); |
|
| 209 | } |
|
| 210 | ||
| 211 | return $this->createEntry('directus_users', $data); |
|
| 212 | } |
|
| 213 | ||
| 214 | /** |
|
| 215 | * @inheritdoc |
|
| @@ 217-226 (lines=10) @@ | ||
| 214 | /** |
|
| 215 | * @inheritdoc |
|
| 216 | */ |
|
| 217 | public function updateUser($id, array $data) |
|
| 218 | { |
|
| 219 | // @TODO: Add hooks |
|
| 220 | if (ArrayUtils::has($data, 'password')) { |
|
| 221 | // @NOTE: Use Directus password hash |
|
| 222 | $data['password'] = password_hash($data['password'], PASSWORD_DEFAULT, ['cost' => 12]); |
|
| 223 | } |
|
| 224 | ||
| 225 | return $this->updateEntry('directus_users', $id, $data); |
|
| 226 | } |
|
| 227 | ||
| 228 | /** |
|
| 229 | * @inheritdoc |
|