registration fix
This commit is contained in:
parent
499fb4afd6
commit
b809f3f25e
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class AdminController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('admin.index');
|
||||
}
|
||||
|
||||
public function keys()
|
||||
{
|
||||
return view('admin.keys');
|
||||
}
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ class RegisterController extends Controller
|
|||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => ['required', 'string', 'alpha_dash', 'min:3', 'max:20', 'unique:users'],
|
||||
'name' => ['required', 'string', 'min:3', 'max:20', 'unique:users', 'regex:/^(?!^\.)(?!.*[-_.]$)[a-zA-Z0-9 ]+$/'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users', 'confirmed', 'email:rfc,dns'],
|
||||
'dob' => ['required', 'date_format:Y-m-d', 'before:today', 'after:01/01/1970'],
|
||||
'password' => ['required', 'string', 'min:8', 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{6,}$/'],
|
||||
|
|
|
|||
|
|
@ -65,5 +65,6 @@ class Kernel extends HttpKernel
|
|||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
'AdminCheck' => \App\Http\Middleware\AdminCheck::class,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class AdminCheck
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if (!User::isAdmin())
|
||||
{
|
||||
abort(403);
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
@ -337,4 +337,27 @@ a, #navbarusername {
|
|||
display: table;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
.iphone-sidebar {
|
||||
position: fixed;
|
||||
color: black;
|
||||
width: 20%;
|
||||
height: 100%;
|
||||
margin-left: 0px;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
.iphone-content {
|
||||
position: relative;
|
||||
color: black;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
left: 20%;
|
||||
background-color: rgba(132, 132, 132, 0.5);
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
#InviteTreeContainer {
|
||||
background-color: rgb(255, 255, 255);
|
||||
}
|
||||
|
|
@ -40,6 +40,7 @@ background: linear-gradient(#f07575 10%, #e13b3b 49%, #d22 50%, #de2323 100%);
|
|||
width: max-content;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #3D414A;
|
||||
background: rgb(80, 80, 80); /* Fallback for IE 11*/
|
||||
background: linear-gradient(#cacbcc 10%, #99999a 49%, #747474 50%, #2d2d2d 100%);
|
||||
}
|
||||
.navbar {
|
||||
|
|
@ -56,6 +57,7 @@ background: linear-gradient(#f07575 10%, #e13b3b 49%, #d22 50%, #de2323 100%);
|
|||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
width: 100%;
|
||||
background: rgb(58, 83, 242); /* Fallback for IE 11*/
|
||||
background: linear-gradient(#759CF0 10%, #3B72E1 49%, #2260DD 50%, #2362DE 100%);
|
||||
}
|
||||
.navbarbuttoncontainer, .smallnavbarbuttoncontainer, .navbarlogincontainer {
|
||||
|
|
@ -200,6 +202,7 @@ body {
|
|||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
min-height: 300px;
|
||||
background: rgb(255,255,255); /* Fallback for IE 11*/
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
|
|
@ -211,6 +214,7 @@ body {
|
|||
margin-top: 30px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
background: rgb(255,255,255); /* Fallback for IE 11*/
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
|
|
@ -229,6 +233,7 @@ body {
|
|||
padding-right: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
background: rgb(172,172,172); /* Fallback for IE 11*/
|
||||
background-color: rgba(172, 172, 172, 0.8);
|
||||
min-height: fit-content;
|
||||
}
|
||||
|
|
@ -296,6 +301,7 @@ background: linear-gradient(#75f094 10%, #39d746 49%, #21b71c 50%, #137a32 100%)
|
|||
padding-right: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
background: rgb(172,172,172); /* Fallback for IE 11*/
|
||||
background-color: rgba(172, 172, 172, 0.8);
|
||||
min-height: fit-content;
|
||||
}
|
||||
|
|
@ -319,6 +325,7 @@ a, #navbarusername {
|
|||
margin: auto;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
background: rgb(255,255,255); /* Fallback for IE 11*/
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
|
|
@ -330,4 +337,27 @@ a, #navbarusername {
|
|||
display: table;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
.iphone-sidebar {
|
||||
position: fixed;
|
||||
color: black;
|
||||
width: 20%;
|
||||
height: 100%;
|
||||
margin-left: 0px;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
.iphone-content {
|
||||
position: relative;
|
||||
color: black;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
left: 20%;
|
||||
background-color: rgba(132, 132, 132, 0.5);
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
#InviteTreeContainer {
|
||||
background-color: rgb(255, 255, 255);
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
@extends('layouts.app')
|
||||
@section('title')
|
||||
<title>Admin - {{ env('APP_NAME') }}</title>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="iphone-sidebar">
|
||||
<img src="https://morblox.us/img/MORBLOXlogo.png" width="50%">
|
||||
<p>Admin Panel</p>
|
||||
<p>Logged in as: ballsgamer123</p>
|
||||
<br>
|
||||
<a>User List</a>
|
||||
<br>
|
||||
<a>Game List</a>
|
||||
<br>
|
||||
<a>Invite Tree</a>
|
||||
<br>
|
||||
<a>Asset Approval Queue</a>
|
||||
<br>
|
||||
<a>Reports</a>
|
||||
<br>
|
||||
<a>Moderation Logs</a>
|
||||
<br>
|
||||
<a>Game Servers</a>
|
||||
</div>
|
||||
<div class="iphone-content" style="padding-left: 0px; padding-right: 0px;">
|
||||
<div id="UserList">
|
||||
<h2>User List</h2>
|
||||
<p><input type="text" placeholder="Search..."><button class="bluebutton">Search by Username</button> <button class="bluebutton">Search by ID</button></p>
|
||||
<div id="SearchContainer">
|
||||
<div class="ProfileContainerBox" id="ProfileContainerBox1">
|
||||
<div id="ProfileContainerBox1ImageContainer">
|
||||
<img alt="Profile Image" src="https://morblox.us/img/reviewpending.png" width="60px" height="100%">
|
||||
</div>
|
||||
<div id="ProfileContainerBox1TextContainer">
|
||||
<p>USERNAME: MORBLOX</p>
|
||||
<p>EMAIL: test@example.com</p>
|
||||
<p>ID: 1</p>
|
||||
<p>DOB: 1/1/01</p>
|
||||
<p>STATUS: Normal</p>
|
||||
<p>INVITED BY: SYSTEM (ID: 0)</p>
|
||||
<button class="greybutton">Check Reports For This User</button>
|
||||
<button class="bluebutton">Edit User Data</button>
|
||||
<button class="bluebutton">Warn/Ban History</button>
|
||||
<button class="redbutton">Warn</button>
|
||||
<button class="redbutton">Ban/Terminate</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="GameList">
|
||||
<h2>Game List</h2>
|
||||
<p><input type="text" placeholder="Search..."><button class="bluebutton">Search by Name</button> <button class="bluebutton">Search by ID</button></p>
|
||||
<div id="SearchContainer">
|
||||
<div class="ProfileContainerBox" id="ProfileContainerBox1">
|
||||
<div id="ProfileContainerBox1ImageContainer">
|
||||
<img alt="Game Image" src="https://morblox.us/img/reviewpending.png" width="60px" height="100%">
|
||||
</div>
|
||||
<div id="ProfileContainerBox1TextContainer">
|
||||
<p>Game Name: MORBLOX's Place</p>
|
||||
<p>Game Description: This is your first MORBLOX Place. Open it with MORBLOX Studio to start building!</p>
|
||||
<p>Creator: MORBLOX</p>
|
||||
<p>GAMEID: 1</p>
|
||||
<button class="greybutton">Check Reports For This Game</button>
|
||||
<button class="greenbutton">Play Game In Studio</button>
|
||||
<button class="redbutton">Delete Game</button>
|
||||
<button class="redbutton">Ban/Terminate Creator</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="InviteTree">
|
||||
<h2>Invite Tree</h2>
|
||||
<p><input type="text" placeholder="Search..."><button class="bluebutton">Search by Username</button> <button class="bluebutton">Search by ID</button></p>
|
||||
<div id="InviteTreeContainer">
|
||||
<p>---------------------------</p>
|
||||
<p>SYSTEM (ID: 0)</p>
|
||||
<p>- MORBLOX (ID: 1)</p>
|
||||
<p>- Conkley (ID: 2)</p>
|
||||
<p>- Thomas (ID: 3)</p>
|
||||
<p>- - the night guard from five nights at freddy (ID: ??)</p>
|
||||
<p>- Mura (ID: 4)</p>
|
||||
<p>- Pipedream (ID: 5)</p>
|
||||
<p>---------------------------</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="AssetApprovalQueue">
|
||||
<h2>Asset Approval Queue</h2>
|
||||
<p><input type="text" placeholder="Search..."><button class="bluebutton">Search by Asset Name</button> <button class="bluebutton">Search by Username</button></p>
|
||||
<div id="AssetApprovalContainer">
|
||||
<div class="ProfileContainerBox" id="ProfileContainerBox1">
|
||||
<div id="ProfileContainerBox1ImageContainer">
|
||||
<img alt="Asset Image" src="https://morblox.us/img/reviewpending.png" width="60px" height="100%">
|
||||
</div>
|
||||
<div id="ProfileContainerBox1TextContainer">
|
||||
<p>Asset Name: PLACEHOLDER</p>
|
||||
<p>Asset Description: PLACEHOLDER IMAGE</p>
|
||||
<p>Asset Type: Decal</p>
|
||||
<p>Asset Creator: MORBLOX (ID: 1)</p>
|
||||
<button class="bluebutton">Accept</button>
|
||||
<button class="bluebutton">Decline</button>
|
||||
<button class="redbutton">Warn User</button>
|
||||
<button class="redbutton">Ban/Terminate User</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="Reports">
|
||||
<h2>Reports</h2>
|
||||
<p><input type="text" placeholder="Search..."><button class="bluebutton">Search by Game Name/Id</button> <button class="bluebutton">Search by Username/Id</button></p>
|
||||
<div id="ReportsContainer">
|
||||
<div class="ProfileContainerBox" id="ProfileContainerBox1">
|
||||
<div id="ProfileContainerBox1ImageContainer">
|
||||
<img alt="Asset Image" src="https://morblox.us/img/reviewpending.png" width="60px" height="100%">
|
||||
</div>
|
||||
<div id="ProfileContainerBox1TextContainer">
|
||||
<p>Reporting: Game</p>
|
||||
<p>Report Sender: MORBLOX (USERID: 1)</p>
|
||||
<p>Game: MORBLOX's Place (GAMEID: 1)</p>
|
||||
<p>Game Creator: MORBLOX (USERID: 1)</p>
|
||||
<p>Reason: Racial/Homophobic Slurs</p>
|
||||
<p>Comments: Has the N Word in it.</p>
|
||||
<button class="greenbutton">Open Game In Studio</button>
|
||||
<button class="greybutton">Warn Report Sender</button>
|
||||
<button class="redbutton">Delete Game</button>
|
||||
<button class="redbutton">Ban/Terminate Game Creator</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ProfileContainerBox" id="ProfileContainerBox1">
|
||||
<div id="ProfileContainerBox1ImageContainer">
|
||||
<img alt="Asset Image" src="https://morblox.us/img/reviewpending.png" width="60px" height="100%">
|
||||
</div>
|
||||
<div id="ProfileContainerBox1TextContainer">
|
||||
<p>Reporting: Player</p>
|
||||
<p>Report Sender: MORBLOX (USERID: 1)</p>
|
||||
<p>Player: Thomas (USERID: 3)</p>
|
||||
<p>Inviter: SYSTEM (USERID: 0)</p>
|
||||
<p>Reason: Harrassment</p>
|
||||
<p>Comments: Said "It's Morbin Time"</p>
|
||||
<button class="bluebutton">View Chat Logs</button>
|
||||
<button class="greybutton">Warn Report Sender</button>
|
||||
<button class="redbutton">Warn Player</button>
|
||||
<button class="redbutton">Ban/Terminate Player</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ModLogs">
|
||||
<h2>Moderation Logs</h2>
|
||||
<p><input type="text" placeholder="Search..."><button class="bluebutton">Search by Reason</button> <button class="bluebutton">Search by Moderator</button></p>
|
||||
<div id="ModLogsContainer">
|
||||
<div class="ProfileContainerBox" id="ProfileContainerBox1">
|
||||
<div id="ProfileContainerBox1TextContainer">
|
||||
<p>Moderator: Thomas (ID: 3)</p>
|
||||
<p>Player: skeuomorphism hater (ID: ??)</p>
|
||||
<p>Inviter: skeuomorphism lover (ID: ??)</p>
|
||||
<p>Punishment: Termination, Disabling invites for Inviter</p>
|
||||
<p>Reason: Being mean :(</p>
|
||||
<button class="greybutton">View Original Report</button>
|
||||
<button class="greybutton">View Proof</button>
|
||||
<button class="redbutton">Undo Invite Ban for Inviter</button>
|
||||
<button class="redbutton">Undo Ban/Termination</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="GameServers">
|
||||
<h2>Game Servers</h2>
|
||||
<p><input type="text" placeholder="Search..."><button class="bluebutton">Search by Game Name</button></p>
|
||||
<div id="ModLogsContainer">
|
||||
<p>There are no running game servers!</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -31,7 +31,10 @@
|
|||
<a class="navbarbutton" id="smallbtn4" href="catalog.html">Catalog</a>
|
||||
<a class="navbarbutton" id="smallbtn0" href="build.html">Build</a>
|
||||
<a class="navbarbutton" id="smallbtn1" href="forum.html">Forum</a>
|
||||
<a class="navbarbutton" id="smallbtn2" href="@guest {{ route('login') }} @else {{ route('profile', Auth::id()) }} @endguest">Profile</a>
|
||||
<a class="navbarbutton" id="smallbtn2"
|
||||
href="@guest {{ route('login') }}
|
||||
@else
|
||||
{{ route('profile', Auth::id()) }} @endguest">Profile</a>
|
||||
<a class="navbarbutton" id="smallbtn3" href="{{ route('settings') }}">Settings</a>
|
||||
</div>
|
||||
@guest
|
||||
|
|
@ -40,8 +43,11 @@
|
|||
</div>
|
||||
@else
|
||||
<div id="navbarsignedincontainer">
|
||||
<p class="nonbolded" id="navbarusername">Logged in as: {{ Auth::user()->name }} <a href="{{ route('logout') }}" onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">Log out...</a></p>
|
||||
<p class="nonbolded" id="navbarusername">Logged in as: {{ Auth::user()->name }} <a
|
||||
href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">Log
|
||||
out...</a></p>
|
||||
</div>
|
||||
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display:none">
|
||||
|
|
@ -55,6 +61,9 @@
|
|||
<a class="smallnavbarbutton" href="avatar.html">Avatar</a>
|
||||
<a class="smallnavbarbutton" href="Settings.html">Transactions</a>
|
||||
<a class="smallnavbarbutton" href="{{ route('users') }}">Users</a>
|
||||
@if (!Auth::guest() && Auth::user()->isAdmin())
|
||||
<a class="smallnavbarbutton" href="{{ route('admin_index') }}">Admin</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@yield('alert')
|
||||
|
|
@ -63,8 +72,10 @@
|
|||
@yield('content')
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p>MORBLOX is not affiliated with Roblox Corp, Lego, Sony, SEGA, Microsoft, Nintendo and Morbius. It's Morbin time!</p>
|
||||
<p><a href="{{ route('privacy') }}">Privacy Policy</a> <a href="{{ route('tos') }}">Terms of Service</a></p>
|
||||
<p>MORBLOX is not affiliated with Roblox Corp, Lego, Sony, SEGA, Microsoft, Nintendo and Morbius. It's Morbin
|
||||
time!</p>
|
||||
<p><a href="{{ route('privacy') }}">Privacy Policy</a> <a href="{{ route('tos') }}">Terms of Service</a>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,17 +14,15 @@ use Illuminate\Support\Facades\Auth;
|
|||
|
|
||||
*/
|
||||
|
||||
/*Route::get('/', function () {
|
||||
return view('welcome');
|
||||
});*/
|
||||
|
||||
Auth::routes();
|
||||
|
||||
// Public pages
|
||||
Route::get('/', [App\Http\Controllers\HomeController::class, 'index'])->name('index');
|
||||
Route::get('/privacy', [App\Http\Controllers\PageController::class, 'privacy'])->name('privacy');
|
||||
Route::get('/tos', [App\Http\Controllers\PageController::class, 'tos'])->name('tos');
|
||||
Route::get('/user/{id}', [App\Http\Controllers\PageController::class, 'profile'])->name('profile');
|
||||
|
||||
// Must be logged in
|
||||
Route::middleware(['auth'])->group(function () {
|
||||
Route::get('/home', [App\Http\Controllers\HomeController::class, 'home'])->name('home');
|
||||
Route::get('/users', [App\Http\Controllers\PageController::class, 'users'])->name('users');
|
||||
|
|
@ -33,3 +31,9 @@ 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');
|
||||
});
|
||||
|
||||
// Admin only
|
||||
Route::group(['middleware' => 'AdminCheck'], function() {
|
||||
Route::get('/iphone/dashboard', [App\Http\Controllers\AdminController::class, 'index'])->name('admin_index');
|
||||
Route::get('/iphone/keys', [App\Http\Controllers\AdminController::class, 'keys'])->name('admin_keys');
|
||||
});
|
||||
Loading…
Reference in New Issue