Löschen von Gast Accounts für Admins
This commit is contained in:
parent
3770467735
commit
c1341d6999
4 changed files with 322 additions and 1 deletions
|
|
@ -5,6 +5,8 @@ namespace App\Http\Controllers;
|
|||
use Illuminate\Http\Request;
|
||||
use App\Page;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AdminController extends Controller
|
||||
{
|
||||
|
|
@ -87,4 +89,11 @@ class AdminController extends Controller
|
|||
$page->save();
|
||||
return redirect('/activities');
|
||||
}
|
||||
|
||||
public function delete_guests() {
|
||||
if(Auth::user()->role=="ADMIN") {
|
||||
DB::delete('DELETE FROM users WHERE role='GUEST');
|
||||
}
|
||||
return redirect('/');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,6 +103,9 @@
|
|||
<a class="dropdown-item" href="/admin/upload_tourplan">Tourenplan(pdf) hochladen</a>
|
||||
<a class="dropdown-item" href="/admin/upload_mitgliedsantrag">Mitgliedsantrag(pdf) hochladen</a>
|
||||
|
||||
@if(Auth::user()->role !='GUEST')
|
||||
<a class="dropdown-item" href="/delete_guests">Gast Mitglieder löschen</a>
|
||||
@endif
|
||||
|
||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@
|
|||
Route::get('/tour/gallery/{gallery_id}/show_deleted', 'GalleryController@show_deleted_images');
|
||||
Route::get('/tour/gallery/{gallery_id}/restore_image/{imageName}', 'GalleryController@restore_image');
|
||||
|
||||
Route::get('/delete_guests','AdminController@delete_guests');
|
||||
|
||||
Auth::routes();
|
||||
|
||||
/* Cache clearing on remote server */
|
||||
|
|
|
|||
307
tools/motorradig_2025-08-03_165130.sql
Normal file
307
tools/motorradig_2025-08-03_165130.sql
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue