mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Add check for users when deleting profile so they do not delete another users profile
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2018-02-01 DariusIII
|
||||
* Chg: Add check for users when deleting profile so they do not delete another users profile
|
||||
* Chg: Remove occurences of ROLE_GUEST as that role is removed
|
||||
2018-01-31 DariusIII
|
||||
* Chg: Add option to users to delete their account from profile page
|
||||
|
||||
@@ -277,6 +277,14 @@ class BasePage
|
||||
die(view('errors.503'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show 503 page.
|
||||
*/
|
||||
public function showBadBoy(): void
|
||||
{
|
||||
die(view('errors.badboy'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show maintenance page.
|
||||
*/
|
||||
|
||||
@@ -8,8 +8,10 @@ if (! User::isLoggedIn()) {
|
||||
|
||||
$userId = $_GET['id'];
|
||||
|
||||
if ($userId !== null) {
|
||||
if ($userId !== null && (int) $userId === User::currentUserId()) {
|
||||
User::logout();
|
||||
User::deleteUser($userId);
|
||||
header('Location: '.WWW_TOP.'/');
|
||||
} else {
|
||||
$page->showBadBoy();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
@extends('errors.layout')
|
||||
|
||||
@section('title')
|
||||
You bad boy!
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
You tried to delete another users account!
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -41,9 +41,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div>
|
||||
@yield('content')
|
||||
</div>
|
||||
@yield('content')
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user