diff --git a/app/Http/Controllers/Admin/AdminUserController.php b/app/Http/Controllers/Admin/AdminUserController.php index 8cefa79ee..227ff53ea 100644 --- a/app/Http/Controllers/Admin/AdminUserController.php +++ b/app/Http/Controllers/Admin/AdminUserController.php @@ -168,25 +168,44 @@ trait AdminUserController $action = $request->input('action'); $profile = Profile::findOrFail($pid); + if($profile->user->is_admin == true) { + $mid = $request->user()->id; + abort_if($profile->user_id < $mid, 403); + } + switch ($action) { case 'cw': - $profile->cw = true; - $msg = "Successfully added Content Warnings to {$profile->username}'s future posts!"; + $profile->cw = !$profile->cw; + $msg = "Success!"; break; case 'no_autolink': - $profile->no_autolink = true; - $msg = "Successfully applied No Autolinking to {$profile->username}'s future posts!"; + $profile->no_autolink = !$profile->no_autolink; + $msg = "Success!"; break; case 'unlisted': - $profile->unlisted = true; - $msg = "Successfully applied Unlisted scope to {$profile->username}'s future posts!"; + $profile->unlisted = !$profile->unlisted; + $msg = "Success!"; break; } - + $profile->save(); + + ModLogService::boot() + ->objectUid($profile->user_id) + ->objectId($profile->user_id) + ->objectType('App\User::class') + ->user($request->user()) + ->action('admin.user.moderate') + ->metadata([ + 'action' => $action, + 'message' => $msg + ]) + ->accessLevel('admin') + ->save(); + $request->session()->flash('status', $msg); - return redirect('/i/admin/users/show/' . $profile->user_id); + return redirect('/i/admin/users/modtools/' . $profile->user_id); } } \ No newline at end of file diff --git a/resources/views/admin/users/modtools.blade.php b/resources/views/admin/users/modtools.blade.php index befa3e38c..76919302e 100644 --- a/resources/views/admin/users/modtools.blade.php +++ b/resources/views/admin/users/modtools.blade.php @@ -54,53 +54,36 @@
@csrf + - +

Adds a CW to every post made by this account.

@csrf + - +

Removes account from public/network timelines.

@csrf + - +

Do not transform mentions, hashtags or urls into HTML.

-
-
- @csrf - - -

Temporarily disable account until next time user log in.

-
-
- -
-
- @csrf - - -

This prevents any new interactions, without deleting existing data.

-
-
- -
-
- @csrf - - -

This disables the account and changes the password, forcing account to reset password via verified email.

-
-
diff --git a/resources/views/admin/users/show.blade.php b/resources/views/admin/users/show.blade.php index 5a5b44b25..19513ea53 100644 --- a/resources/views/admin/users/show.blade.php +++ b/resources/views/admin/users/show.blade.php @@ -42,80 +42,80 @@ - -
- -
-
-
-
- -

- {{$profile->name}} -

- @if($user->is_admin == true) -

- ADMIN -

- @endif -

- Joined {{$profile->created_at->diffForHumans()}} -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bookmarks{{$profile->bookmarks()->count()}}
collections{{$profile->collections()->count()}}
likes{{$profile->likes()->count()}}
reports{{$profile->reports()->count()}}
reported{{$profile->reported()->count()}}
Active stories{{$profile->stories()->count()}}
storage used{{PrettyNumber::size($profile->media()->sum('size'))}} / {{PrettyNumber::size(config('pixelfed.max_account_size') * 1000)}}
-
-
-
-

Recent Posts

-
-
- @foreach($profile->statuses()->whereHas('media')->latest()->take(9)->get() as $item) -
- - - -
- @endforeach - - @if($profile->statuses()->whereHas('media')->count() == 0) -
-
-

No statuses found

-
-
+ +
+
+
+
+
+
+ +

+ {{$profile->name}} +

+ @if($user->is_admin == true) +

+ ADMIN +

@endif +

+ Joined {{$profile->created_at->diffForHumans()}} +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bookmarks{{$profile->bookmarks()->count()}}
collections{{$profile->collections()->count()}}
likes{{$profile->likes()->count()}}
reports{{$profile->reports()->count()}}
reported{{$profile->reported()->count()}}
Active stories{{$profile->stories()->count()}}
storage used{{PrettyNumber::size($profile->media()->sum('size'))}} / {{PrettyNumber::size(config('pixelfed.max_account_size') * 1000)}}
- @endsection \ No newline at end of file +
+

Recent Posts

+
+
+ @foreach($profile->statuses()->whereHas('media')->latest()->take(9)->get() as $item) +
+ + + +
+ @endforeach + + @if($profile->statuses()->whereHas('media')->count() == 0) +
+
+

No statuses found

+
+
+ @endif +
+
+
+@endsection \ No newline at end of file