From 5f58a1f4ad94460412289646e7f31b3fa9022b0c Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Mon, 11 Jul 2022 18:00:22 +0200 Subject: [PATCH] Added protection against admins deleting their own accounts Admins cannot un-verify, block or delete admin accounts. This includes their own and other accounts. --- resources/views/panel/users.blade.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/views/panel/users.blade.php b/resources/views/panel/users.blade.php index 0108c5a..48f5c4d 100755 --- a/resources/views/panel/users.blade.php +++ b/resources/views/panel/users.blade.php @@ -40,9 +40,13 @@ {{ $user->role }} Edit View - @if(env('REGISTER_AUTH') !== 'auth')@if($user->email_verified_at == '')no@elseyes@endif@endif - {{ $user->block }} -
Delete
+ @if(env('REGISTER_AUTH') !== 'auth') + @if($user->find($user->id)->role == 'admin' and $user->email_verified_at != '')yes @else + @if($user->email_verified_at == '')no@elseyes@endif + @endif + @endif + @if($user->find($user->id)->role == 'admin')-@else{{ $user->block }}@endif + @if($user->find($user->id)->role == 'admin')
-
@else
Delete
@endif @endforeach