An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
Feat: User deletion confirmation
ayntk-aif4263ee02246
diff --git a/app/Livewire/Team/AdminView.php b/app/Livewire/Team/AdminView.phpindex 97d4fcdbf9..ee5e673a5f 100644--- a/app/Livewire/Team/AdminView.php+++ b/app/Livewire/Team/AdminView.php@@ -5,6 +5,8 @@ namespace App\Livewire\Team;use App\Models\Team;use App\Models\User;use Livewire\Component;+use Illuminate\Support\Facades\Auth;+use Illuminate\Support\Facades\Hash;class AdminView extends Component{@@ -73,8 +75,12 @@ class AdminView extends Component$team->delete();}- public function delete($id)+ public function delete($id, $password){+ if (!Hash::check($password, Auth::user()->password)) {+ $this->addError('password', 'The provided password is incorrect.');+ return;+ }if (! auth()->user()->isInstanceAdmin()) {return $this->dispatch('error', 'You are not authorized to delete users');}diff --git a/resources/views/livewire/tags/show.blade.php b/resources/views/livewire/tags/show.blade.phpindex 0c6c35a16e..0b743a3e51 100644--- a/resources/views/livewire/tags/show.blade.php+++ b/resources/views/livewire/tags/show.blade.php@@ -24,9 +24,18 @@<div class="w-[500px]"><x-forms.input readonly label="Deploy Webhook URL" id="webhook" /></div>- <x-modal-confirmation isHighlighted buttonTitle="Redeploy All" action="redeploy_all">- All resources will be redeployed.- </x-modal-confirmation>+ <x-modal-confirmation+ title="Redeploy all resources with this tag?"+ isHighlighted+ buttonTitle="Redeploy All"+ submitAction="redeploy_all"+ :actions="['All resources with this tag will be redeployed.', 'During redeploy resources will be temporarily unavailable.']"+ confirmationText="{{ $oneTag->name }}"+ confirmationLabel="Please confirm the execution of the actions by entering the Tag Name below"+ shortConfirmationLabel="Tag Name"+ :confirmWithPassword="false"+ step2ButtonText="Redeploy All"+ /></div><div class="grid grid-cols-1 gap-2 pt-4 lg:grid-cols-2 xl:grid-cols-3">@foreach ($applications as $application)diff --git a/resources/views/livewire/team/admin-view.blade.php b/resources/views/livewire/team/admin-view.blade.phpindex 0e9429eb4e..c03789fbd7 100644--- a/resources/views/livewire/team/admin-view.blade.php+++ b/resources/views/livewire/team/admin-view.blade.php@@ -16,21 +16,16 @@<div class="flex-1"></div><div class="flex items-center justify-center gap-2 mx-4 text-xs font-bold "><x-modal-confirmation- title="Confirm User Deletion?"- buttonTitle="Delete User"+ title="Confirm User Deletion?"+ buttonTitle="Delete"isErrorButton- :actions="['This will delete the user and all the ressources related to this user from Coolify and the database.']"- confirmText="{{ $user->name }}"+ submitAction="delete({{ $user->id }})"+ :actions="['The selected user will be permanently deleted from Coolify and the database.', 'All resources (application, databases, services, configurations, servers, private keys, tags, etc.) related to this user will be deleted from Coolify and from the server (if the server is reachable).']"+ confirmationText="{{ $user->name }}"confirmationLabel="Please confirm the execution of the actions by entering the User Name below"shortConfirmationLabel="User Name"- submitAction="delete({{ $user->id }})">- This will delete all resources (application, databases, services, configurations, servers,- private keys, tags, etc.) from Coolify and <span- class="font-bold text-red-500 dark:text-warning">from the server (if it's reachable)</span>.- <br> <br>- It is not reversible. <br><br>- <div class="font-bold text-red-500 dark:text-white">Think twice!</div>- </x-modal-confirmation>+ step3ButtonText="Permanently Delete User"+ /></div></div>@empty