add ability to delete accounts
This commit is contained in:
parent
74a062b7a3
commit
b2e18f1556
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use App\Models\User;
|
||||
use App\Models\UserSetting;
|
||||
|
||||
|
||||
class AccountController extends Controller
|
||||
{
|
||||
public function delete()
|
||||
{
|
||||
return view('dangerzone.delete');
|
||||
}
|
||||
|
||||
public function deleteaccount()
|
||||
{
|
||||
$user = Auth::User();
|
||||
|
||||
Auth::logout();
|
||||
|
||||
$user->delete();
|
||||
|
||||
return view('index');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
@extends('layouts.app')
|
||||
@section('title')
|
||||
<title>Delete Account - {{ env('APP_NAME') }}</title>
|
||||
@endsection
|
||||
@section('titlediscord')
|
||||
<meta content="Delete Account - {{ env('APP_NAME') }}" property="og:title" />
|
||||
@endsection
|
||||
@section('descdiscord')
|
||||
<meta content="ARCHBLOX is a work in progress 2012 ROBLOX revival with a heavy emphasis on Skeuomorphic UI." property="og:description" />
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="PageTitleBar">
|
||||
<h1>Delete Account</h1>
|
||||
</div>
|
||||
<p class="important">
|
||||
WARNING: BY DELETING YOUR ACCOUNT, YOU LOSE
|
||||
<br />
|
||||
<br />
|
||||
@php echo Auth::user()->morbux; @endphp ARKOTs
|
||||
<br />
|
||||
@php echo Auth::user()->getFriendsCount() @endphp FRIENDS
|
||||
<br />
|
||||
{{ App\Models\Message::where('sendto_id', Auth::id())->where('deleted', false)->count() }} SENT MESSAGES
|
||||
<br />
|
||||
{{ App\Models\Message::where('user_id', Auth::id())->count() }} RECIEVED MESSAGES
|
||||
<br />
|
||||
{{ App\Models\Message::where('sendto_id', Auth::id())->where('deleted', true)->count() }} ARCHIVED MESSAGES
|
||||
<br />
|
||||
0 AVATAR ITEMS
|
||||
<br />
|
||||
0 ASSETS
|
||||
<br />
|
||||
0 Places
|
||||
<br />
|
||||
0 UNIVERSES
|
||||
<br />
|
||||
AND ANYTHING ELSE THAT IS LINKED TO YOUR ACCOUNT.
|
||||
<br />
|
||||
<br />
|
||||
</p>
|
||||
@if (App\Models\User::isAdmin())
|
||||
<p>Sorry, since you are an Admin, you cannot delete your account through here. Ask a developer if you wish to delete your account.</p>
|
||||
@else
|
||||
<form method="POST" action="{{ route('deleteaccount') }}">
|
||||
@csrf
|
||||
<input style="width:5%;margin-bottom:15px;margin-top:15px" type="checkbox" name="remember" id="remember">
|
||||
<label class="form-check-label" for="remember">
|
||||
{{ __('I agree that clicking the button below will fully wipe my account from the servers, with no way to recover it later.') }}
|
||||
</label>
|
||||
<br />
|
||||
<br />
|
||||
<button onClick="this.form.submit();this.disabled=true" class="redbutton">Delete Account</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
@if ($message->deleted)
|
||||
<button class="greenbutton" type="submit">Recover</button>
|
||||
@else
|
||||
<button class="redbutton" type="submit">Delete</button>
|
||||
<button class="redbutton" type="submit">Archive</button>
|
||||
@endif
|
||||
</form>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
@extends('layouts.app')
|
||||
@section('title')
|
||||
<title>Deleted Messages - {{ env('APP_NAME') }}</title>
|
||||
<title>Archived Messages - {{ env('APP_NAME') }}</title>
|
||||
@endsection
|
||||
|
||||
@section('alert')
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
({{ App\Models\Message::where('sendto_id', Auth::id())->where('deleted', false)->count() }})</a>
|
||||
<a href="{{ route('inbox_sent') }}" class="tab">Sent
|
||||
({{ App\Models\Message::where('user_id', Auth::id())->count() }})</a>
|
||||
<a href="#" class="tab_selected">Deleted
|
||||
<a href="#" class="tab_selected">Archived
|
||||
({{ App\Models\Message::where('sendto_id', Auth::id())->where('deleted', true)->count() }})</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
({{ App\Models\Message::where('sendto_id', Auth::id())->where('deleted', false)->count() }})</a>
|
||||
<a href="{{ route('inbox_sent') }}" class="tab">Sent
|
||||
({{ App\Models\Message::where('user_id', Auth::id())->count() }})</a>
|
||||
<a href="{{ route('deleted') }}" class="tab">Deleted
|
||||
<a href="{{ route('deleted') }}" class="tab">Archived
|
||||
({{ App\Models\Message::where('sendto_id', Auth::id())->where('deleted', true)->count() }})</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
Message</a></button>
|
||||
<form action="{{ route('delete_all') }}" method="POST" style="display:inline-block">
|
||||
@csrf
|
||||
<button class="redbutton" type="submit">Delete All Messages</button>
|
||||
<button class="redbutton" type="submit">Archive All Messages</button>
|
||||
</form>
|
||||
<br>
|
||||
<br>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<a href="{{ route('inbox') }}" class="tab">Inbox
|
||||
({{ App\Models\Message::where('sendto_id', Auth::id())->where('deleted', false)->count() }})</a>
|
||||
<a href="#" class="tab_selected">Sent ({{ App\Models\Message::where('user_id', Auth::id())->count() }})</a>
|
||||
<a href="{{ route('deleted') }}" class="tab">Deleted
|
||||
<a href="{{ route('deleted') }}" class="tab">Archived
|
||||
({{ App\Models\Message::where('sendto_id', Auth::id())->where('deleted', true)->count() }})</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -212,8 +212,8 @@
|
|||
<br>
|
||||
<div style="flex-wrap: wrap; flex-direction: column;">
|
||||
<h3>DANGER ZONE</h3>
|
||||
<p style="warningtext">These are inactive for now.<br>In order to delete your account, please ask one of the
|
||||
Developers.</p>
|
||||
<p><button class="redbutton" disabled>Delete Account</button> <button class="redbutton" disabled>Disable Account</button></p>
|
||||
<!--<p style="warningtext">These are inactive for now.<br>In order to delete your account, please ask one of the
|
||||
Developers.</p>-->
|
||||
<p><a href="{{ route('delete') }}"> <button class="redbutton" >Delete Account</button></a> <button class="redbutton" disabled>Disable Account</button></p>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -60,6 +60,10 @@ Route::middleware(['auth'])->group(function () {
|
|||
Route::get('/my/invites', [App\Http\Controllers\KeyController::class, 'index'])->name('key_index');
|
||||
Route::post('/my/invites', [App\Http\Controllers\KeyController::class, 'create'])->name('key_create');
|
||||
|
||||
// Account Management routes
|
||||
Route::get('/deleteaccount', [App\Http\Controllers\AccountController::class, 'delete'])->name('delete');
|
||||
Route::post('/deleteaccountrequestbyebye', [App\Http\Controllers\AccountController::class, 'deleteaccount'])->name('deleteaccount');
|
||||
|
||||
|
||||
// Friendship system routes
|
||||
Route::get('/my/friends', [App\Http\Controllers\FriendController::class, 'friends'])->name('friends');
|
||||
|
|
|
|||
Loading…
Reference in New Issue