mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-28 04:13:11 +00:00
Add API action to create account
This commit is contained in:
@@ -1911,6 +1911,24 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
return $grants;
|
||||
}
|
||||
|
||||
public function create_account(array $data)
|
||||
{
|
||||
/** @var \Alchemy\Phrasea\Authentication\RegistrationService $service */
|
||||
$service = $this->app['authentication.registration_service'];
|
||||
|
||||
$user = $service->registerUser($data);
|
||||
$token = $service->getAccountUnlockToken($user);
|
||||
|
||||
$result = new API_V1_result($this->app, $this->app['request'], $this);
|
||||
|
||||
$result->set_datas(array(
|
||||
'user' => $this->list_user($user),
|
||||
'token' => $token
|
||||
));
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the password for a given email address
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user