diff --git a/public/viewpeerlist.php b/public/viewpeerlist.php
index 6538bd75..98943914 100644
--- a/public/viewpeerlist.php
+++ b/public/viewpeerlist.php
@@ -16,6 +16,7 @@ function get_location_column($e, $isStrongPrivacy, $canView): string
{
global $enablelocation_tweak, $seedBoxRep, $lang_functions, $lang_viewpeerlist;
$address = $ips = [];
+ //First, build the location
if ($enablelocation_tweak == 'yes') {
if (!empty($e['ipv4'])) {
list($loc_pub, $loc_mod) = get_ip_location($e['ipv4']);
@@ -29,7 +30,11 @@ function get_location_column($e, $isStrongPrivacy, $canView): string
$address[] = $loc_pub . $seedBoxIcon;
$ips[] = $e['ipv6'];
}
- $title = sprintf('%s%s%s', $lang_functions['text_user_ip'], ': ', implode(', ', $ips));
+ if ($canView) {
+ $title = sprintf('%s%s%s', $lang_functions['text_user_ip'], ': ', implode(', ', $ips));
+ } else {
+ $title = '';
+ }
$addressStr = implode('
', $address);
$location = '
'.$addressStr.'
';
} else {
@@ -104,30 +109,23 @@ function dltable($name, $arr, $torrent)
$s .= "\n";
$secs = max(1, ($e["la"] - $e["st"]));
$columnLocation = $usernameSeedBoxIcon = '';
- if ($privacy == "strong" || ($torrent['anonymous'] == 'yes' && $e['userid'] == $torrent['owner'])) {
- if (get_user_class() >= $viewanonymous_class || $e['userid'] == $CURUSER['id']) {
- if ($showLocationColumn) {
- $columnLocation = get_location_column($e, true, true);
- } else {
- $usernameSeedBoxIcon = get_username_seed_box_icon($e);
- }
- $columnUsername = "".$lang_viewpeerlist['text_anonymous']."".$usernameSeedBoxIcon." (" . get_username($e['userid']) . ") | \n";
- } else {
- if ($showLocationColumn) {
- $columnLocation = get_location_column($e, true, false);
- } else {
- $usernameSeedBoxIcon = get_username_seed_box_icon($e);
- }
- $columnUsername = "".$lang_viewpeerlist['text_anonymous']."".$usernameSeedBoxIcon." | \n";
- }
- } else {
- if ($showLocationColumn) {
- $columnLocation = get_location_column($e, false, false);
- } else {
- $usernameSeedBoxIcon = get_username_seed_box_icon($e);
- }
- $columnUsername = "" . get_username($e['userid']).$usernameSeedBoxIcon." | \n";
+ $isStrongPrivacy = $privacy == "strong" || ($torrent['anonymous'] == 'yes' && $e['userid'] == $torrent['owner']);
+ $canView = get_user_class() >= $viewanonymous_class || $e['userid'] == $CURUSER['id'];
+ if ($showLocationColumn) {
+ $columnLocation = get_location_column($e, $isStrongPrivacy, $canView);
+ } else {
+ $usernameSeedBoxIcon = get_username_seed_box_icon($e);
}
+ if ($isStrongPrivacy) {
+ $columnUsername = "".$lang_viewpeerlist['text_anonymous']."".$usernameSeedBoxIcon;
+ if ($canView) {
+ $columnUsername .= " (" . get_username($e['userid']) . ")";
+ }
+ $columnUsername .= " | ";
+ } else {
+ $columnUsername = "" . get_username($e['userid']).$usernameSeedBoxIcon." | ";
+ }
+
$s .= $columnUsername . $columnLocation;
$s .= "" . ($e['connectable'] == "yes" ? $lang_viewpeerlist['text_yes'] : "".$lang_viewpeerlist['text_no']."") . " | \n";