Skip to content

Commit

Permalink
Merge pull request #31 from itinerare/main
Browse files Browse the repository at this point in the history
- Fix invisible characters being visible to logged-out and non-permissioned users
- Fix error on attempting to view a purchase log relating to a deleted shop
  • Loading branch information
itinerare authored Oct 26, 2020
2 parents a240ddb + 756a6b9 commit 12ad047
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/Http/Controllers/BrowseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ public function getCharacters(Request $request)
$query->orderBy('characters.number', 'DESC');
}

if(!Auth::check() || !Auth::user()->hasPower('manage_characters')) $query->visible();

return view('browse.masterlist', [
'isMyo' => false,
'characters' => $query->paginate(24)->appends($request->query()),
Expand Down Expand Up @@ -307,6 +309,8 @@ public function getMyos(Request $request)
break;
}

if(!Auth::check() || !Auth::user()->hasPower('manage_characters')) $query->visible();

return view('browse.myo_masterlist', [
'isMyo' => true,
'slots' => $query->paginate(30)->appends($request->query()),
Expand Down
2 changes: 1 addition & 1 deletion resources/views/shops/_purchase_history_row.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<tr class="outflow">
<td>{!! $log->item ? $log->item->displayName : '(Deleted Item)' !!}</td>
<td>{!! $log->shop->displayName !!}</td>
<td>{!! $log->shop ? $log->shop->displayName : '(Deleted Shop)' !!}</td>
<td>{!! $log->character_id ? $log->character->displayName : '' !!}</td>
<td>{!! $log->currency ? $log->currency->display($log->cost) : $log->cost . ' (Deleted Currency)' !!}</td>
<td>{!! format_date($log->created_at) !!}</td>
Expand Down

0 comments on commit 12ad047

Please sign in to comment.