mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
Fix showing private textures for owner
This commit is contained in:
parent
ec9598ae16
commit
2986e6babd
@ -30,7 +30,7 @@ class SkinlibController extends Controller
|
||||
{
|
||||
$filter = $request->input('filter', 'skin');
|
||||
$sort = $request->input('sort', 'time');
|
||||
$uid = $request->input('uid', 0);
|
||||
$uid = $request->input('uid', session('uid'));
|
||||
$page = $request->input('page', 1);
|
||||
$page = $page <= 0 ? 1 : $page;
|
||||
|
||||
@ -51,8 +51,9 @@ class SkinlibController extends Controller
|
||||
|
||||
if (!is_null($this->user)) {
|
||||
// show private textures when show uploaded textures of current user
|
||||
if ($uid != $this->user->uid && !$this->user->isAdmin())
|
||||
$textures = $textures->where('public', '1');
|
||||
if (!$this->user->isAdmin())
|
||||
$textures = $textures->where('public', '1')
|
||||
->orWhere('uploader', $this->user->uid);
|
||||
} else {
|
||||
$textures = $textures->where('public', '1');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user