fix photo view by photomoderator

This commit is contained in:
themohooks 2024-07-19 00:59:51 +03:00
parent ebcfe7720b
commit 0c14aeb391
2 changed files with 3 additions and 1 deletions

View file

@ -10,6 +10,7 @@ use \App\Models\User;
<th class="c">Никнейм</th> <th class="c">Никнейм</th>
<th class="c">Почта</th> <th class="c">Почта</th>
<th class="c">Прямая загрузка</th> <th class="c">Прямая загрузка</th>
<th class="c">Ссылка</th>
<th class="c"></th> <th class="c"></th>
</tr> </tr>
</thead> </thead>
@ -29,6 +30,7 @@ use \App\Models\User;
<td class="cs">'.$u['username'].'</td> <td class="cs">'.$u['username'].'</td>
<td class="cs">'.$u['email'].'</td> <td class="cs">'.$u['email'].'</td>
<td class="cs">'.$prem.'</td> <td class="cs">'.$prem.'</td>
<td class="cs"><a href="https://'.$_SERVER['SERVER_NAME'].'/author/'.$u['id'].'">https://'.$_SERVER['SERVER_NAME'].'/author/'.$u['id'].'</a></td>
<td class="cs"><div class="cmt-submit"><a href="/admin?type=UserEdit&user_id='.$u['id'].'">Редактировать</a></div></td> <td class="cs"><div class="cmt-submit"><a href="/admin?type=UserEdit&user_id='.$u['id'].'">Редактировать</a></div></td>
</tr>'; </tr>';
} }

View file

@ -8,7 +8,7 @@ $photo = new \App\Models\Photo($id);
if ($photo->i('id') !== null) { if ($photo->i('id') !== null) {
$photouser = new \App\Models\User($photo->i('user_id')); $photouser = new \App\Models\User($photo->i('user_id'));
if ($photo->i('moderated') === 0) { if ($photo->i('moderated') === 0) {
if ($photo->i('user_id') === Auth::userid()) { if ($photo->i('user_id') === Auth::userid() || $user->i('admin') > 0) {
$moderated = true; $moderated = true;
} else { } else {
$moderated = false; $moderated = false;