This commit is contained in:
Thomas G 2023-03-07 15:52:07 +11:00
parent b2e18f1556
commit b0a177fbad
8 changed files with 33 additions and 10 deletions

View File

@ -6,7 +6,10 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
use App\Models\User; use App\Models\User;
use App\Models\Message;
use App\Models\UserSetting; use App\Models\UserSetting;
use App\Models\InviteKey;
use App\Models\FeedPost;
class AccountController extends Controller class AccountController extends Controller
@ -20,6 +23,15 @@ class AccountController extends Controller
{ {
$user = Auth::User(); $user = Auth::User();
InviteKey::where('created_by', Auth::id())->delete();
InviteKey::where('user_invited', Auth::id())->delete();
Message::where('user_id', Auth::id())->delete();
Message::where('sendto_id', Auth::id())->delete();
FeedPost::where('user_id', Auth::id())->delete();
Auth::logout(); Auth::logout();
$user->delete(); $user->delete();

View File

@ -71,16 +71,17 @@ class RegisterController extends Controller
$this->verifyKey($data['key']); $this->verifyKey($data['key']);
$invited_by = $this->getInviter($data['key']); $invited_by = $this->getInviter($data['key']);
$this->updateKeyTable($data['key']); $this->updateKeyTable($data['key']);
UserSetting::create(['user_id' => User::all()->last()->id+1]); UserSetting::create(['user_id' => User::all()->last()->id]);
return User::create([ return User::create([
'name' => $data['name'], 'name' => $data['name'],
'email' => $data['email'], 'email' => $data['email'],
'dob' => $data['dob'], 'dob' => $data['dob'],
'password' => Hash::make($data['password']), 'password' => Hash::make($data['password']),
'badges' => [3], 'badges' => [3],
'invited_by' => $invited_by, 'invited_by' => $invited_by
]); ]);;
} }
protected function verifyKey($key) protected function verifyKey($key)

View File

@ -73,4 +73,5 @@
<br> <br>
<!--SU BUTTON--> <!--SU BUTTON-->
<button class="greenbutton" onClick="this.form.submit();this.disabled=true">Sign Up</button> <button class="greenbutton" onClick="this.form.submit();this.disabled=true">Sign Up</button>
<p class="important">If you recieve a 500 error once you sign up, please message Thomas on the discord.</p>
@endsection @endsection

View File

@ -17,13 +17,13 @@
<span id="header-or">or</span> <span id="header-or">or</span>
<span class="studioiFrameLogin"> <span class="studioiFrameLogin">
<span id="login-span"> <span id="login-span">
<a href="{{ route('login') }}" class="btn-control btn-control-large header-login">Login<!-- <span class="grey-arrow"></span>--></a> <a class="btn-control btn-control-large header-login">Login
<span class="grey-arrow"></span>
</a>
</span> </span>
<!-- disabled due to bugs
<div id="iFrameLogin" class="studioiFrameLogin" style="display: none; background: #E1E1E1"> <div id="iFrameLogin" class="studioiFrameLogin" style="display: none; background: #E1E1E1">
<iframe class="login-frame" src=" route('login_iframe') " allow-scripts scrolling="no" frameborder="0"></iframe> <iframe class="login-frame" src="{{ route('login_iframe') }}" allow-scripts scrolling="no" frameborder="0"></iframe>
</div> </div>
-->
</span> </span>
@else @else
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display:none"> <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display:none">

View File

@ -11,4 +11,8 @@
@section('contentloggedout') @section('contentloggedout')
<h2>500 | Internal Server Error <button style="width: fit-content;" class="greybutton" onclick="window.history.back();">Back</button></h2> <h2>500 | Internal Server Error <button style="width: fit-content;" class="greybutton" onclick="window.history.back();">Back</button></h2>
<p>Please go back and try again. If it still does not work, contact one of the developers.</p> <p>Please go back and try again. If it still does not work, contact one of the developers.</p>
@auth
<br />
<p>Please report this error with your USERID: {{ Auth::id() }}</p>
@endauth
@endsection @endsection

View File

@ -26,8 +26,10 @@
<div class="FeedContainerBox" id="FeedContainerBox1"> <div class="FeedContainerBox" id="FeedContainerBox1">
<div id="ProfileContainerBox1TextContainer"> <div id="ProfileContainerBox1TextContainer">
<h3>Invite Key | @if (!$fKey->active) <h3>Invite Key | @if (!$fKey->active)
You Invited: <a href="{{ route('profile', App\Models\User::find($fKey->user_invited)->id) }}" You Invited: <a href="@if (!empty(App\Models\User::find($fKey->user_invited)->id))
style="font-weight:normal;color:blue">{{ App\Models\User::find($fKey->user_invited)->name }}</a> {{ route('profile', App\Models\User::find($fKey->user_invited)->id) }}
@endif"
style="font-weight:normal;color:blue">@if (!empty(App\Models\User::find($fKey->user_invited)->id)){{ App\Models\User::find($fKey->user_invited)->name }}@else[ Deleted User ]@endif</a>
| |
@endif Created {{ $fKey->created_at->format('d/m/Y') }}</h3> @endif Created {{ $fKey->created_at->format('d/m/Y') }}</h3>
@if ($fKey->active) @if ($fKey->active)

View File

@ -5,7 +5,7 @@
@section('content') @section('content')
<div class="PageTitleBar"> <div class="PageTitleBar">
<h1 id="usernameframe">Friends</h1> <h1 id="usernameframe">Friend Requests</h1>
<div> <div>
<a href="{{ route('friends') }}" class="tab">All Friends</a> <a href="{{ route('friends') }}" class="tab">All Friends</a>
<a href="#" class="tab_selected">Pending Requests ({{ count(Auth::user()->getFriendRequests()) }})</a> <a href="#" class="tab_selected">Pending Requests ({{ count(Auth::user()->getFriendRequests()) }})</a>
@ -15,6 +15,7 @@
<div class="content_special" id="FriendsContainer" style="flex-wrap: wrap;"> <div class="content_special" id="FriendsContainer" style="flex-wrap: wrap;">
@foreach ($userRequests as $userReq) @foreach ($userRequests as $userReq)
@php $user = App\Models\User::find($userReq->sender_id) @endphp @php $user = App\Models\User::find($userReq->sender_id) @endphp
@if (!empty($user))
<div class="FriendsContainerBox" id="FriendsContainerBox1"> <div class="FriendsContainerBox" id="FriendsContainerBox1">
<div id="FriendsContainerBox1ImageContainer"> <div id="FriendsContainerBox1ImageContainer">
<a href="{{ route('profile', $user->id) }}"><img alt="Profile Image" <a href="{{ route('profile', $user->id) }}"><img alt="Profile Image"
@ -43,6 +44,7 @@
</div> </div>
</div> </div>
</div> </div>
@endif
@endforeach @endforeach
@if (!count($userRequests)) @if (!count($userRequests))
<p>You have no pending friend requests.</p> <p>You have no pending friend requests.</p>

View File

@ -97,6 +97,7 @@ Route::get('/game/ChatFilter.ashx', [App\Http\Controllers\ClientController::clas
Route::get('/game/join.ashx', [App\Http\Controllers\ClientController::class, 'join'])->name('join'); Route::get('/game/join.ashx', [App\Http\Controllers\ClientController::class, 'join'])->name('join');
Route::get('/IDE/Landing.aspx', [App\Http\Controllers\ClientController::class, 'idelanding'])->name('idelanding'); Route::get('/IDE/Landing.aspx', [App\Http\Controllers\ClientController::class, 'idelanding'])->name('idelanding');
Route::get('/ide/welcome', [App\Http\Controllers\ClientController::class, 'idelanding'])->name('idewelcome'); Route::get('/ide/welcome', [App\Http\Controllers\ClientController::class, 'idelanding'])->name('idewelcome');
Route::get('/ide/login', [App\Http\Controllers\ClientController::class, 'login_iframe'])->name('login_iframe');
Route::get('/IDE/Upload.aspx', [App\Http\Controllers\ClientController::class, 'ideupload'])->name('ideupload'); Route::get('/IDE/Upload.aspx', [App\Http\Controllers\ClientController::class, 'ideupload'])->name('ideupload');
Route::get('/IDE/ClientToolbox.aspx', [App\Http\Controllers\ClientController::class, 'toolbox'])->name('toolbox'); Route::get('/IDE/ClientToolbox.aspx', [App\Http\Controllers\ClientController::class, 'toolbox'])->name('toolbox');
Route::get('/UploadMedia/PostImage.aspx', [App\Http\Controllers\ClientController::class, 'postimage'])->name('postimage'); Route::get('/UploadMedia/PostImage.aspx', [App\Http\Controllers\ClientController::class, 'postimage'])->name('postimage');