Fix #43 Ensure that admins cannot create or edit account with capital letters in usernames

Update the dependencies
Bump the package number
This commit is contained in:
Timothée Jaussoin 2022-09-27 11:51:21 +02:00
parent 10d601b95c
commit 54b9c2a3f3
4 changed files with 27 additions and 15 deletions

View file

@ -6,6 +6,8 @@ use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use App\Account;
use App\Rules\IsNotPhoneNumber;
use App\Rules\NoUppercase;
use App\Rules\WithoutSpaces;
class CreateAccountRequest extends FormRequest
@ -20,6 +22,8 @@ class CreateAccountRequest extends FormRequest
return [
'username' => [
'required',
new NoUppercase,
new IsNotPhoneNumber,
Rule::unique('accounts', 'username')->where(function ($query) {
$query->where('domain', config('app.sip_domain'));
}),

View file

@ -6,6 +6,8 @@ use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use App\Account;
use App\Rules\IsNotPhoneNumber;
use App\Rules\NoUppercase;
use App\Rules\WithoutSpaces;
class UpdateAccountRequest extends FormRequest
@ -20,6 +22,8 @@ class UpdateAccountRequest extends FormRequest
return [
'username' => [
'required',
new NoUppercase,
new IsNotPhoneNumber,
Rule::unique('accounts', 'username')->where(function ($query) {
$query->where('domain', config('app.sip_domain'));
})->ignore($this->route('id'), 'id'),

32
flexiapi/composer.lock generated
View file

@ -1465,16 +1465,16 @@
},
{
"name": "laravel/framework",
"version": "v8.83.23",
"version": "v8.83.24",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "bdc707f8b9bcad289b24cd182d98ec7480ac4491"
"reference": "a684da6197ae77eee090637ae4411b2f321adfc7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/bdc707f8b9bcad289b24cd182d98ec7480ac4491",
"reference": "bdc707f8b9bcad289b24cd182d98ec7480ac4491",
"url": "https://api.github.com/repos/laravel/framework/zipball/a684da6197ae77eee090637ae4411b2f321adfc7",
"reference": "a684da6197ae77eee090637ae4411b2f321adfc7",
"shasum": ""
},
"require": {
@ -1634,7 +1634,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2022-07-26T13:30:00+00:00"
"time": "2022-09-22T18:59:47+00:00"
},
{
"name": "laravel/serializable-closure",
@ -7926,16 +7926,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.5.24",
"version": "9.5.25",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5"
"reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d0aa6097bef9fd42458a9b3c49da32c6ce6129c5",
"reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d",
"reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d",
"shasum": ""
},
"require": {
@ -7957,14 +7957,14 @@
"phpunit/php-timer": "^5.0.2",
"sebastian/cli-parser": "^1.0.1",
"sebastian/code-unit": "^1.0.6",
"sebastian/comparator": "^4.0.5",
"sebastian/comparator": "^4.0.8",
"sebastian/diff": "^4.0.3",
"sebastian/environment": "^5.1.3",
"sebastian/exporter": "^4.0.3",
"sebastian/exporter": "^4.0.5",
"sebastian/global-state": "^5.0.1",
"sebastian/object-enumerator": "^4.0.3",
"sebastian/resource-operations": "^3.0.3",
"sebastian/type": "^3.1",
"sebastian/type": "^3.2",
"sebastian/version": "^3.0.2"
},
"suggest": {
@ -8008,7 +8008,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.24"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.25"
},
"funding": [
{
@ -8018,9 +8018,13 @@
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
"type": "tidelift"
}
],
"time": "2022-08-30T07:42:16+00:00"
"time": "2022-09-25T03:44:45+00:00"
},
{
"name": "sebastian/cli-parser",

View file

@ -8,7 +8,7 @@
#%define _datadir %{_datarootdir}
#%define _docdir %{_datadir}/doc
%define build_number 152
%define build_number 153
%define var_dir /var/opt/belledonne-communications
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager