Fix Mantis#11998 Send the correct message by SMS when creating an account...

This commit is contained in:
Timothée Jaussoin 2023-11-07 14:20:13 +00:00
parent 9abce3988b
commit 459e8faf9d
4 changed files with 69 additions and 68 deletions

View file

@ -32,7 +32,6 @@ use Awobaz\Compoships\Compoships;
use App\ApiKey;
use App\Password;
use App\Http\Controllers\Account\AuthenticateController as WebAuthenticateController;
use Doctrine\DBAL\Query;
class Account extends Authenticatable
{

View file

@ -162,7 +162,7 @@ class AccountController extends Controller
Log::channel('events')->info('API: Account created using the public endpoint by phone', ['id' => $account->identifier]);
$ovhSMS = new OvhSMS;
$ovhSMS->send($request->get('phone'), 'Your ' . config('app.name') . ' recovery code is ' . $account->confirmation_key);
$ovhSMS->send($request->get('phone'), 'Your ' . config('app.name') . ' creation code is ' . $account->confirmation_key);
} elseif ($request->has('email')) {
// Send validation by email
$account->confirmation_key = Str::random(WebAuthenticateController::$emailCodeSize);

108
flexiapi/composer.lock generated
View file

@ -2056,16 +2056,16 @@
},
{
"name": "laravel/serializable-closure",
"version": "v1.3.1",
"version": "v1.3.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/serializable-closure.git",
"reference": "e5a3057a5591e1cfe8183034b0203921abe2c902"
"reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/e5a3057a5591e1cfe8183034b0203921abe2c902",
"reference": "e5a3057a5591e1cfe8183034b0203921abe2c902",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/076fe2cf128bd54b4341cdc6d49b95b34e101e4c",
"reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c",
"shasum": ""
},
"require": {
@ -2112,7 +2112,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure"
},
"time": "2023-07-14T13:56:28+00:00"
"time": "2023-10-17T13:38:16+00:00"
},
{
"name": "league/commonmark",
@ -2304,16 +2304,16 @@
},
{
"name": "league/flysystem",
"version": "3.17.0",
"version": "3.19.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "bd4c9b26849d82364119c68429541f1631fba94b"
"reference": "1b2aa10f2326e0351399b8ce68e287d8e9209a83"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/bd4c9b26849d82364119c68429541f1631fba94b",
"reference": "bd4c9b26849d82364119c68429541f1631fba94b",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/1b2aa10f2326e0351399b8ce68e287d8e9209a83",
"reference": "1b2aa10f2326e0351399b8ce68e287d8e9209a83",
"shasum": ""
},
"require": {
@ -2342,7 +2342,7 @@
"google/cloud-storage": "^1.23",
"microsoft/azure-storage-blob": "^1.1",
"phpseclib/phpseclib": "^3.0.14",
"phpstan/phpstan": "^0.12.26",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.5.11|^10.0",
"sabre/dav": "^4.3.1"
},
@ -2378,7 +2378,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/3.17.0"
"source": "https://github.com/thephpleague/flysystem/tree/3.19.0"
},
"funding": [
{
@ -2390,20 +2390,20 @@
"type": "github"
}
],
"time": "2023-10-05T20:15:05+00:00"
"time": "2023-11-07T09:04:28+00:00"
},
{
"name": "league/flysystem-local",
"version": "3.16.0",
"version": "3.19.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem-local.git",
"reference": "ec7383f25642e6fd4bb0c9554fc2311245391781"
"reference": "8d868217f9eeb4e9a7320db5ccad825e9a7a4076"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/ec7383f25642e6fd4bb0c9554fc2311245391781",
"reference": "ec7383f25642e6fd4bb0c9554fc2311245391781",
"url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/8d868217f9eeb4e9a7320db5ccad825e9a7a4076",
"reference": "8d868217f9eeb4e9a7320db5ccad825e9a7a4076",
"shasum": ""
},
"require": {
@ -2438,7 +2438,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/flysystem-local/issues",
"source": "https://github.com/thephpleague/flysystem-local/tree/3.16.0"
"source": "https://github.com/thephpleague/flysystem-local/tree/3.19.0"
},
"funding": [
{
@ -2450,20 +2450,20 @@
"type": "github"
}
],
"time": "2023-08-30T10:23:59+00:00"
"time": "2023-11-06T20:35:28+00:00"
},
{
"name": "league/mime-type-detection",
"version": "1.13.0",
"version": "1.14.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/mime-type-detection.git",
"reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96"
"reference": "b6a5854368533df0295c5761a0253656a2e52d9e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/a6dfb1194a2946fcdc1f38219445234f65b35c96",
"reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b6a5854368533df0295c5761a0253656a2e52d9e",
"reference": "b6a5854368533df0295c5761a0253656a2e52d9e",
"shasum": ""
},
"require": {
@ -2494,7 +2494,7 @@
"description": "Mime-type detection for Flysystem",
"support": {
"issues": "https://github.com/thephpleague/mime-type-detection/issues",
"source": "https://github.com/thephpleague/mime-type-detection/tree/1.13.0"
"source": "https://github.com/thephpleague/mime-type-detection/tree/1.14.0"
},
"funding": [
{
@ -2506,20 +2506,20 @@
"type": "tidelift"
}
],
"time": "2023-08-05T12:09:49+00:00"
"time": "2023-10-17T14:13:20+00:00"
},
{
"name": "monolog/monolog",
"version": "2.9.1",
"version": "2.9.2",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1"
"reference": "437cb3628f4cf6042cc10ae97fc2b8472e48ca1f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/f259e2b15fb95494c83f52d3caad003bbf5ffaa1",
"reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/437cb3628f4cf6042cc10ae97fc2b8472e48ca1f",
"reference": "437cb3628f4cf6042cc10ae97fc2b8472e48ca1f",
"shasum": ""
},
"require": {
@ -2596,7 +2596,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
"source": "https://github.com/Seldaek/monolog/tree/2.9.1"
"source": "https://github.com/Seldaek/monolog/tree/2.9.2"
},
"funding": [
{
@ -2608,7 +2608,7 @@
"type": "tidelift"
}
],
"time": "2023-02-06T13:44:46+00:00"
"time": "2023-10-27T15:25:26+00:00"
},
{
"name": "myclabs/deep-copy",
@ -2900,16 +2900,16 @@
},
{
"name": "nette/utils",
"version": "v4.0.2",
"version": "v4.0.3",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
"reference": "cead6637226456b35e1175cc53797dd585d85545"
"reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/cead6637226456b35e1175cc53797dd585d85545",
"reference": "cead6637226456b35e1175cc53797dd585d85545",
"url": "https://api.github.com/repos/nette/utils/zipball/a9d127dd6a203ce6d255b2e2db49759f7506e015",
"reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015",
"shasum": ""
},
"require": {
@ -2980,9 +2980,9 @@
],
"support": {
"issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v4.0.2"
"source": "https://github.com/nette/utils/tree/v4.0.3"
},
"time": "2023-09-19T11:58:07+00:00"
"time": "2023-10-29T21:02:13+00:00"
},
{
"name": "nikic/php-parser",
@ -3128,16 +3128,16 @@
},
{
"name": "ovh/ovh",
"version": "v3.2.0",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/ovh/php-ovh.git",
"reference": "9a29f720d03f0a8cae642ba5c97f51d100144c57"
"reference": "a5241f84111bc8c108ab78480a3141353389cc49"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ovh/php-ovh/zipball/9a29f720d03f0a8cae642ba5c97f51d100144c57",
"reference": "9a29f720d03f0a8cae642ba5c97f51d100144c57",
"url": "https://api.github.com/repos/ovh/php-ovh/zipball/a5241f84111bc8c108ab78480a3141353389cc49",
"reference": "a5241f84111bc8c108ab78480a3141353389cc49",
"shasum": ""
},
"require": {
@ -3172,9 +3172,9 @@
],
"support": {
"issues": "https://github.com/ovh/php-ovh/issues",
"source": "https://github.com/ovh/php-ovh/tree/v3.2.0"
"source": "https://github.com/ovh/php-ovh/tree/v3.3.0"
},
"time": "2023-04-07T08:09:14+00:00"
"time": "2023-10-20T15:21:31+00:00"
},
{
"name": "parsedown/laravel",
@ -8861,16 +8861,16 @@
},
{
"name": "filp/whoops",
"version": "2.15.3",
"version": "2.15.4",
"source": {
"type": "git",
"url": "https://github.com/filp/whoops.git",
"reference": "c83e88a30524f9360b11f585f71e6b17313b7187"
"reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/c83e88a30524f9360b11f585f71e6b17313b7187",
"reference": "c83e88a30524f9360b11f585f71e6b17313b7187",
"url": "https://api.github.com/repos/filp/whoops/zipball/a139776fa3f5985a50b509f2a02ff0f709d2a546",
"reference": "a139776fa3f5985a50b509f2a02ff0f709d2a546",
"shasum": ""
},
"require": {
@ -8920,7 +8920,7 @@
],
"support": {
"issues": "https://github.com/filp/whoops/issues",
"source": "https://github.com/filp/whoops/tree/2.15.3"
"source": "https://github.com/filp/whoops/tree/2.15.4"
},
"funding": [
{
@ -8928,7 +8928,7 @@
"type": "github"
}
],
"time": "2023-07-13T12:00:00+00:00"
"time": "2023-11-03T12:00:00+00:00"
},
{
"name": "hamcrest/hamcrest-php",
@ -8983,16 +8983,16 @@
},
{
"name": "maximebf/debugbar",
"version": "v1.19.0",
"version": "v1.19.1",
"source": {
"type": "git",
"url": "https://github.com/maximebf/php-debugbar.git",
"reference": "30f65f18f7ac086255a77a079f8e0dcdd35e828e"
"reference": "03dd40a1826f4d585ef93ef83afa2a9874a00523"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/30f65f18f7ac086255a77a079f8e0dcdd35e828e",
"reference": "30f65f18f7ac086255a77a079f8e0dcdd35e828e",
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/03dd40a1826f4d585ef93ef83afa2a9874a00523",
"reference": "03dd40a1826f4d585ef93ef83afa2a9874a00523",
"shasum": ""
},
"require": {
@ -9043,9 +9043,9 @@
],
"support": {
"issues": "https://github.com/maximebf/php-debugbar/issues",
"source": "https://github.com/maximebf/php-debugbar/tree/v1.19.0"
"source": "https://github.com/maximebf/php-debugbar/tree/v1.19.1"
},
"time": "2023-09-19T19:53:10+00:00"
"time": "2023-10-12T08:10:52+00:00"
},
{
"name": "mockery/mockery",

View file

@ -57,23 +57,25 @@ Route::get('accounts/me/api_key/{auth_token}', 'Api\Account\ApiKeyController@gen
Route::group(['middleware' => ['auth.digest_or_key']], function () {
Route::get('accounts/auth_token/{auth_token}/attach', 'Api\Account\AuthTokenController@attach');
Route::get('accounts/me/api_key', 'Api\Account\ApiKeyController@generate')->middleware('cookie', 'cookie.encrypt');
Route::prefix('accounts/me')->group(function () {
Route::get('api_key', 'Api\Account\ApiKeyController@generate')->middleware('cookie', 'cookie.encrypt');
Route::get('accounts/me', 'Api\Account\AccountController@show');
Route::delete('accounts/me', 'Api\Account\AccountController@delete');
Route::get('accounts/me/provision', 'Api\Account\AccountController@provision');
Route::get('/', 'Api\Account\AccountController@show');
Route::delete('/', 'Api\Account\AccountController@delete');
Route::get('provision', 'Api\Account\AccountController@provision');
Route::post('accounts/me/phone/request', 'Api\Account\PhoneController@requestUpdate');
Route::post('accounts/me/phone', 'Api\Account\PhoneController@update');
Route::post('phone/request', 'Api\Account\PhoneController@requestUpdate');
Route::post('phone', 'Api\Account\PhoneController@update');
Route::get('accounts/me/devices', 'Api\Account\DeviceController@index');
Route::delete('accounts/me/devices/{uuid}', 'Api\Account\DeviceController@destroy');
Route::get('devices', 'Api\Account\DeviceController@index');
Route::delete('devices/{uuid}', 'Api\Account\DeviceController@destroy');
Route::post('accounts/me/email/request', 'Api\Account\EmailController@requestUpdate');
Route::post('accounts/me/password', 'Api\Account\PasswordController@update');
Route::post('email/request', 'Api\Account\EmailController@requestUpdate');
Route::post('password', 'Api\Account\PasswordController@update');
Route::get('accounts/me/contacts/{sip}', 'Api\Account\ContactController@show');
Route::get('accounts/me/contacts', 'Api\Account\ContactController@index');
Route::get('contacts/{sip}', 'Api\Account\ContactController@show');
Route::get('contacts', 'Api\Account\ContactController@index');
});
Route::group(['middleware' => ['auth.admin']], function () {
if (!empty(config('app.linphone_daemon_unix_pipe'))) {