Banlist ip check
cataalin opened this issue · 27 comments
I have seen that the $ipbanned option was deactivated, I activated it to see how it is but it seems that it does not work well, how can I fix it? He shows me this even though I ban myself. @Wruczek
If you banned yourself then it's correct that you see the ban information. I do not understand, can you try explaining what is wrong?
If you banned yourself then it's correct that you see the ban information. I do not understand, can you try explaining what is wrong?
Shouldn't it come out that you are not banned by not being? because the same thing always comes out, banned or not.
Wouldn't it work just like in a post of yours from 2018?
I guess the bans page is complete. Finishing the viewer now!
You don't need to enable this feature - it is on by default. In fact, there is no config for this function. Everyone banned will see this message. I was referring to the fact that you should not edit any files as all the config options are in DB.
I was saying it because I tried an autoban and nothing comes out, but what about this image? when does it appear?
I guess the bans page is complete. Finishing the viewer now!
Line 12 does not activate anything, you have made the site think that everyone is IP banned. The configuration is in database, you don't need to change anything else.
oh, but in the database I don't see anything related to this, not even in the translations, could you tell me where?
You don't need to enable this feature - it is on by default. In fact, there is no config for this function. Everyone banned will see this message.
I was referring to the fact that you should not edit any files as all the config options are in DB.
It seems that it was removed, only the "You are banned" alert exists.
ah I understand, that's why there is no div in body.latte, okay thanks I'll close the topic.
It should - check if the banned IP is the same as shown in the login modal screen when hovering over the 𝝅 icon.
It should - check if the banned IP is the same as shown in the login modal screen when hovering over the 𝝅 icon.
I have checked and it is the same.
Can you attach a screenshot both from the 𝝅 icon and banlist? You can censor half of the IP.
Also, are any other files modified? Please make sure you are using TS-website with no file modifications.
¿Puedes adjuntar una captura de pantalla tanto del ícono 𝝅 como de la lista de prohibición? Puedes censurar la mitad de la IP. Además, ¿se modifican otros archivos? Asegúrese de estar utilizando el sitio web de TS sin modificaciones de archivos.
original website without any editing, it shows the same ip check, I have php 7.4 and use https protocol
Edit bans.php
and add the following line on line 63
if ($ip === Utils::getClientIp()) {
$ipbanned = [
"invoker" => (string) $ban["invokername"],
"reason" => (string) $ban["reason"]
];
+ var_dump($ipbanned);
}
Refresh the website, you should see additional text show up - please screenshot or copy/paste it here.
Edit
bans.php
and add the following line on line 63if ($ip === Utils::getClientIp()) { $ipbanned = [ "invoker" => (string) $ban["invokername"], "reason" => (string) $ban["reason"] ]; + var_dump($ipbanned); }
Refresh the website, you should see additional text show up - please screenshot or copy/paste it here.
It matches me on line 53 and nothing appears, it does not show the var_dump
Move it after the if statement + add an echo with more info:
if ($ip === Utils::getClientIp()) {
$ipbanned = [
"invoker" => (string) $ban["invokername"],
"reason" => (string) $ban["reason"]
];
}
+ var_dump($ipbanned);
+ echo "IP: $ip, Client: " . Utils::getClientIp() . "<br>\n";
Move it after the if statement + add an echo with more info:
if ($ip === Utils::getClientIp()) { $ipbanned = [ "invoker" => (string) $ban["invokername"], "reason" => (string) $ban["reason"] ]; } + var_dump($ipbanned); + echo "IP: $ip, Client: " . Utils::getClientIp() . "<br>\n";
now show me
bool(false) IP: 47.63.***.***, Client: 47.63.***.***
Send the same output but not censored.
Send the same output but not censored.
sent, you can check.
I see, it compares against the censored IP....
Try changing these lines to:
try {
$ipCensored = Utils::censorIpAddress($ip);
} catch (\Exception $e) {}
if ($lastNickname !== null) {
$abbreviation = [$ipCensored, "IP"];
} else {
$target = $ipCensored;
}
I see, it compares against the censored IP....
Try changing these lines to:
try { $ipCensored = Utils::censorIpAddress($ip); } catch (\Exception $e) {} if ($lastNickname !== null) { $abbreviation = [$ipCensored, "IP"]; } else { $target = $ipCensored; }
It seems to work, thank you very much for the help, there are a couple of other similar things that I'm trying to solve but I don't know if I should open a topic for each one, what do you think, would you have time?
Yes, each problem should have its own issue.
Yes, each problem should have its own issue.
Ok, I was saying it so as not to make you too dizzy, I have been able to solve some things but there are some that I can't find with it, when I have time I'll tell you, thanks!