Skip to content
Snippets Groups Projects
Commit ddb68893 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

removed the temp spam removal

parent 9fae7df8
No related branches found
No related tags found
1 merge request!1445Development
......@@ -26,16 +26,6 @@ class HumanVerification extends Controller
}
if ($request->getMethod() == 'POST') {
$dowCheck = true;
# Temp remove later
# Check for recent Spams
if (\preg_match("/eingabe=[\\d]{3}\s*chan.*$/si", $url)) {
# Sleep a random time
$rand = rand(0, 15);
sleep($rand);
$dowCheck = false;
}
$user = $redis->hgetall(HumanVerification::PREFIX . "." . $id);
$user = ['uid' => $user["uid"],
'id' => $user["id"],
......@@ -49,7 +39,7 @@ class HumanVerification extends Controller
$key = $request->input('captcha');
$key = strtolower($key);
if (!$dowCheck || !$hasher->check($key, $lockedKey)) {
if (!$hasher->check($key, $lockedKey)) {
$captcha = Captcha::create("default", true);
$pipeline = $redis->pipeline();
$pipeline->hset(HumanVerification::PREFIX . "." . $id, 'lockedKey', $captcha["key"]);
......@@ -200,6 +190,9 @@ class HumanVerification extends Controller
public static function couldBeSpammer($ip)
{
if (!env("REMOVE_SPAM_IN_TOR")) {
return false;
}
$serverAddress = empty($_SERVER['SERVER_ADDR']) ? "144.76.88.77" : $_SERVER['SERVER_ADDR'];
$queryUrl = "https://tor.metager.org?password=" . urlencode(env("TOR_PASSWORD")) . "&ra=" . urlencode($ip) . "&sa=" . urlencode($serverAddress) . "&sp=443";
......
......@@ -101,15 +101,6 @@ class HumanVerification
"lockedKey" => "",
];
}
# Temp remove later
# Check for recent Spams
$eingabe = \Request::input('eingabe');
if (\preg_match("/^[\\d]{3}\s*chan.*$/si", $eingabe)) {
# Sleep a random time between 1 and 5 seconds
$rand = rand(0, 5);
sleep($rand);
$user["locked"] = true;
}
# A lot of automated requests are from websites that redirect users to our result page.
# We will detect those requests and put a captcha
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment