mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
Fix FLEXIAPI-280 Ensure that the foreign external_accounts key is handling delete on cascade
This commit is contained in:
parent
7cb63f3e51
commit
deeea0ddb6
3 changed files with 13 additions and 11 deletions
|
|
@ -160,13 +160,12 @@ class AccountService
|
|||
$account->setRole($request->get('role'));
|
||||
}
|
||||
|
||||
if (!$request->api && $request->has('activated')) {
|
||||
$account->activated = $request->get('activated') == 'true';
|
||||
}
|
||||
|
||||
if (!$request->api && $request->has('blocked')) {
|
||||
$account->blocked = in_array($request->get('blocked'), ['true', 'on']);
|
||||
}
|
||||
$account->activated = !$request->api
|
||||
&& $request->has('activated')
|
||||
&& in_array($request->get('activated'), ['true', 'on']);
|
||||
$account->blocked = !$request->api
|
||||
&& $request->has('blocked')
|
||||
&& in_array($request->get('blocked'), ['true', 'on']);
|
||||
|
||||
if ($request->get('password')) {
|
||||
$account->updatePassword(
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ return new class extends Migration
|
|||
$table->string('outbound_proxy', 64)->nullable();
|
||||
$table->string('protocol', 4)->default('UDP');
|
||||
|
||||
$table->integer('account_id')->unsigned()->nullable();
|
||||
$table->integer('account_id')->unsigned();
|
||||
$table->foreign('account_id')->references('id')
|
||||
->on('accounts')->onDelete('set null');
|
||||
->on('accounts')->onDelete('cascade');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
<header>
|
||||
<h1><i class="ph">users</i> {{ __('Create') }}</h1>
|
||||
<a href="{{ route('admin.account.index') }}" class="btn btn-secondary oppose">{{ __('Cancel') }}</a>
|
||||
<input form="create_edit" class="btn" type="submit" value="{{ __('Create') }}">
|
||||
</header>
|
||||
@endif
|
||||
|
||||
|
|
@ -124,7 +123,11 @@
|
|||
@endif
|
||||
|
||||
<div class="large">
|
||||
<input class="btn" type="submit" value="{{ __('Update') }}">
|
||||
@if ($account->id)
|
||||
<input class="btn" type="submit" value="{{ __('Update') }}">
|
||||
@else
|
||||
<input form="create_edit" class="btn" type="submit" value="{{ __('Create') }}">
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue