From 29d914a24bb5201f3d686df9bc5333d35d864473 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Tue, 19 Dec 2023 20:22:29 +0100 Subject: [PATCH] Users can now be verified over the admin bar --- app/Http/Controllers/AdminController.php | 17 +++++++++++++++++ .../views/linkstack/modules/admin-bar.blade.php | 13 +++++++++++++ routes/web.php | 1 + 3 files changed, 31 insertions(+) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index ef6f839..276317f 100755 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -113,6 +113,23 @@ public function SendTestMail(Request $request) return redirect('admin/users/all'); } + //Verify user + public function verifyCheckUser(request $request) + { + $id = $request->id; + $status = $request->verify; + + if ($status == 'vip') { + $verify = 'vip'; + } elseif ($status == 'user') { + $verify = 'user'; + } + + User::where('id', $id)->update(['role' => $verify]); + + return redirect(url('u')."/".$id); + } + //Verify or un-verify users emails public function verifyUser(request $request) { diff --git a/resources/views/linkstack/modules/admin-bar.blade.php b/resources/views/linkstack/modules/admin-bar.blade.php index 2e4ee3f..a0352f4 100644 --- a/resources/views/linkstack/modules/admin-bar.blade.php +++ b/resources/views/linkstack/modules/admin-bar.blade.php @@ -80,6 +80,19 @@ if(Auth::user()->id == $userinfo->id){ @endif + @if(!$isUser and $userinfo->role != 'admin') +
  • + @if($userinfo->role == 'vip') + + + + @else + + + + @endif +
  • + @endif