From 2986e6babd73e591526f8645c753c3058cc7966a Mon Sep 17 00:00:00 2001 From: gplane Date: Fri, 21 Apr 2017 16:48:25 +0800 Subject: [PATCH] Fix showing private textures for owner --- app/Http/Controllers/SkinlibController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/SkinlibController.php b/app/Http/Controllers/SkinlibController.php index 8991dcff..78a1e6ef 100644 --- a/app/Http/Controllers/SkinlibController.php +++ b/app/Http/Controllers/SkinlibController.php @@ -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'); }