mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-01 16:00:53 -05:00
@@ -772,7 +772,7 @@ class ForumController extends Controller
|
||||
$user = auth()->user();
|
||||
$topic = Topic::findOrFail($id);
|
||||
|
||||
abort_unless($user->group->is_modo, 403);
|
||||
abort_unless($user->group->is_modo || $user->id === $topic->first_post_user_id, 403);
|
||||
$name = $request->input('name');
|
||||
$forum_id = $request->input('forum_id');
|
||||
$topic->name = $name;
|
||||
@@ -821,7 +821,7 @@ class ForumController extends Controller
|
||||
$post = Post::findOrFail($postId);
|
||||
$postUrl = "forums/topic/{$post->topic->slug}.{$post->topic->id}?page={$post->getPageNumber()}#post-{$postId}";
|
||||
|
||||
abort_unless($user->group->is_modo || $post->user_id == $user->id, 403);
|
||||
abort_unless($user->group->is_modo || $user->id === $post->user_id, 403);
|
||||
$post->content = $request->input('content');
|
||||
$post->save();
|
||||
|
||||
@@ -841,7 +841,7 @@ class ForumController extends Controller
|
||||
$user = auth()->user();
|
||||
$post = Post::with('topic')->findOrFail($postId);
|
||||
|
||||
abort_unless($user->group->is_modo || $post->user_id == $user->id, 403);
|
||||
abort_unless($user->group->is_modo || $user->id === $post->user_id, 403);
|
||||
$post->delete();
|
||||
|
||||
return redirect()->route('forum_topic', ['slug' => $post->topic->slug, 'id' => $post->topic->id])
|
||||
@@ -903,7 +903,7 @@ class ForumController extends Controller
|
||||
$user = auth()->user();
|
||||
$topic = Topic::findOrFail($id);
|
||||
|
||||
abort_unless($user->group->is_modo, 403);
|
||||
abort_unless($user->group->is_modo || $user->id === $topic->first_post_user_id, 403);
|
||||
$posts = $topic->posts();
|
||||
$posts->delete();
|
||||
$topic->delete();
|
||||
|
||||
@@ -110,9 +110,11 @@
|
||||
<button id="quote"
|
||||
class="btn btn-xs btn-xxs btn-info">@lang('forum.quote')</button>
|
||||
@endif
|
||||
@if (auth()->check() && (auth()->user()->group->is_modo || $p->user_id == auth()->user()->id) && $topic->state == 'open')
|
||||
@if (auth()->check() && (auth()->user()->group->is_modo || $p->user_id == auth()->user()->id))
|
||||
<a href="{{ route('forum_post_edit_form', ['slug' => $topic->slug, 'id' => $topic->id, 'postId' => $p->id]) }}"><button
|
||||
class="btn btn-xs btn-xxs btn-warning">@lang('common.edit')</button></a>
|
||||
@endif
|
||||
@if (auth()->check() && (auth()->user()->group->is_modo || $p->user_id == auth()->user()->id) && $topic->state == 'open')
|
||||
<a href="{{ route('forum_post_delete', ['slug' => $topic->slug, 'id' => $topic->id, 'postId' => $p->id]) }}"><button
|
||||
class="btn btn-xs btn-xxs btn-danger">@lang('common.delete')</button></a>
|
||||
@endif
|
||||
@@ -227,7 +229,7 @@
|
||||
class="btn btn-info">@lang('forum.close-topic')</a>
|
||||
@endif
|
||||
@endif
|
||||
@if (auth()->check() && auth()->user()->group->is_modo)
|
||||
@if (auth()->check() && auth()->user()->group->is_modo || $topic->first_post_user_id == auth()->user()->id)
|
||||
<a href="{{ route('forum_edit_topic_form', ['slug' => $topic->slug, 'id' => $topic->id]) }}"
|
||||
class="btn btn-warning">@lang('forum.edit-topic')</a>
|
||||
<a href="{{ route('forum_delete_topic', ['slug' => $topic->slug, 'id' => $topic->id]) }}"
|
||||
|
||||
Reference in New Issue
Block a user