Users can now be verified over the admin bar

This commit is contained in:
Julian Prieber 2023-12-19 20:22:29 +01:00
parent 30523f13ef
commit 29d914a24b
3 changed files with 31 additions and 0 deletions

View File

@ -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)
{

View File

@ -80,6 +80,19 @@ if(Auth::user()->id == $userinfo->id){
</div>
</li>
@endif
@if(!$isUser and $userinfo->role != 'admin')
<li id="linkstack-admin-bar-defaultsp">
@if($userinfo->role == 'vip')
<a class="ab-item" href="{{route('verifyCheckUser', ['verify' => 'user', 'id' => $userinfo->id]);}}">
<svg style="top:5px;position:relative;" xmlns="http://www.w3.org/2000/svg" height="30" width="30" viewBox="0 0 350 512"><path fill="#f0301e" d="M148.318 339.734c-9.872-6.385-17.162-14.661-22.502-24.945-24.141 6.892-45.916 2.799-63.712-15.055-17.662-17.719-21.743-39.341-14.888-63.082C1.827 213.511.832 150.051 47.123 125.64c-6.813-23.82-2.936-45.607 14.941-63.466 17.733-17.715 39.283-21.87 63.403-14.97 12.205-21.609 30.238-34.318 55.597-34.289 25.157.028 43.112 12.552 55.366 34.228 24.033-6.869 45.778-2.839 63.585 15.104 17.645 17.779 21.659 39.38 14.824 63.116 45.417 23.578 46 86.753.043 111.052 6.798 23.843 2.901 45.626-14.998 63.468-17.746 17.69-39.311 21.819-63.461 14.884-9.296 17.366-23.263 28.952-42.682 33.063-15.981 3.383-31.116.675-45.424-8.094m44.037-122.589l33.372 33.511 24.901-25.162-45.585-45.032 44.783-44.014-24.731-25.203-44.89 45.258-43.587-44.332-25.288 24.678 45.226 44.8-44.559 43.814 24.977 25.155 44.405-45.082 10.977 11.61z"/><path fill="#fefdfd" d="M192.089 216.912l-10.711-11.377-44.405 45.082-24.977-25.155 44.559-43.814-45.226-44.8 25.288-24.678 43.587 44.332 44.89-45.258 24.731 25.203-44.783 44.014 45.585 45.032-24.901 25.162-33.638-33.744z"/></svg>
</a>
@else
<a class="ab-item" href="{{route('verifyCheckUser', ['verify' => 'vip', 'id' => $userinfo->id]);}}">
<svg style="top:5px;position:relative;" xmlns="http://www.w3.org/2000/svg" height="30" width="30" viewBox="0 0 350 512"><path fill="#1CAC78" d="M315.781 241.008c.091.153.181.305-.07.893-4.665 3.842-1.388 8.16-1.639 12.026-.577 8.9-.804 17.822-1.173 26.735-11.409 26.671-42.123 44.84-76.299 34.094-12.105 21.438-30.064 34.219-55.381 34.261-25.297.042-43.281-12.605-55.707-34.304-11.566 3.608-23.199 4.461-34.937 1.252-23.151-6.328-37.968-21.15-44.461-44.158-2.988-10.587-2.368-21.345.407-31.88.782-2.968.006-4.047-2.319-5.454-22.857-13.836-33.473-34.2-30.93-60.766 1.187-12.401 5.59-23.861 15.203-32.634L46.82 124.08c-.04-.157-.435-1.732-.536-3.907 4.172-7.605.812-14.996 1.326-22.185.043-.599-1.7-1.325-2.613-1.992.863-9.097 4.426-17.161 10.118-24.828 3.078-.394 5.489 4.931 8.22-.218.113-1.018-.109-1.986-.114-3.249l5.439-7.557c.008.017-.633-1.308-1.274-2.633 0 0 .083.054.384.09.608-.425.914-.885 1.22-1.345 17.06-12.62 35.8-14.991 56.069-9.119 3.342-4.577 6.377-9.536 10.181-13.811 20.699-23.259 55.789-27.717 80.509-9.45 8.177 6.042 14.499 14.593 22.384 22.735 22.04-5.889 43.011-2.211 61.41 15.536 18.695 18.032 19.652 39.543 15.672 63.668l3.889 2.278c31.648 18.919 39.984 61.207 17.263 90.134-4.799 6.109-11.69 10.574-18.199 15.56-2.079.42-4.662.857-4.848 1.778-.393 1.951-1.83 5.276 2.461 5.444m-86.803-116.516l-68.172 70.225-32.758-31.453c-2.706-2.662-4.39-3.254-7.183-.112-4.198 4.723-8.905 8.993-13.365 13.486l-9.373 9.608 62.678 60.889 104.155-106.212-27.15-25.74-8.833 9.309z"/><path fill="#42ef28" d="M313.103 280.406c.165-8.658.392-17.581.969-26.48.251-3.865-3.026-8.184 1.614-11.761 3.136 9.303 3.01 18.764.267 28.232l-2.849 10.009z"/><path fill="#33e919" d="M67.096 57.645c.932 1.192 1.573 2.517 1.565 2.5l-5.441 7.559c-.219.296-.222.301-.472.484-.082 1.059.085 1.935.253 2.812-2.396 5.1-4.807-.225-7.588-.003 3.545-4.415 7.47-8.817 11.684-13.352z"/><path fill="#33f017" d="M44.755 96.342c1.155.321 2.897 1.047 2.854 1.646-.514 7.188 2.847 14.58-1.31 21.796-.781-7.558-1.284-15.327-1.545-23.442M46 102.14v7.776l.722-.007V98.772c-.469 1.699-.593 2.147-.722 3.368z"/><path fill="#42ef28" d="M315.787 240.643c-4.298.197-2.861-3.128-2.468-5.079.186-.921 2.769-1.358 4.502-1.719-2.209 1.718-3.657 3.508-2.034 6.798z"/><path fill="#33e919" d="M68.738 56.302c-.054.414-.36.874-.961 1.25.04-.457.374-.83.961-1.25z"/><path fill="#fefffe" d="M229.224 124.238l8.586-9.056 27.15 25.74-104.155 106.212-62.678-60.889 9.373-9.608c4.461-4.492 9.167-8.762 13.365-13.486 2.792-3.142 4.477-2.55 7.183.112l32.758 31.453 68.418-70.479z"/><path fill="#33e919" d="M63.002 67.998c.224.966.446 1.934.333 2.952C63 71 63 71 63.001 70.625l-.004-2.62z"/><path d="M62.746 68.188c.252.566.253 1.315.254 2.437-.169-.502-.336-1.379-.254-2.437zm-16.743 33.566c.126-.835.25-1.283.719-2.982v11.137l-.722.007.002-8.162z" fill="#1CAC78"/></svg>
</a>
@endif
</li>
@endif
</ul>
<ul id="linkstack-admin-bar-top-secondary" class="ab-top-secondary ab-top-menu">
<li id="linkstack-admin-bar-my-account" class="menupop with-avatar">

View File

@ -152,6 +152,7 @@ Route::group([
Route::get('/admin/links/{id}', [AdminController::class, 'showLinksUser'])->name('showLinksUser');
Route::get('/admin/deleteLink/{id}', [AdminController::class, 'deleteLinkUser'])->name('deleteLinkUser');
Route::get('/admin/users/block/{block}/{id}', [AdminController::class, 'blockUser'])->name('blockUser');
Route::get('/admin/users/verify/{verify}/{id}', [AdminController::class, 'verifyCheckUser'])->name('verifyCheckUser');
Route::get('/admin/users/verify/-{verify}/{id}', [AdminController::class, 'verifyUser'])->name('verifyUser');
Route::get('/admin/edit-user/{id}', [AdminController::class, 'showUser'])->name('showUser');
Route::post('/admin/edit-user/{id}', [AdminController::class, 'editUser'])->name('editUser');