Commit fe842c2b authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch 'development' into '862-member-key-cannot-be-used-with-the-search-plugin'

Development

See merge request !1382
parents cab04187 7f0a3d8b
......@@ -64,7 +64,7 @@ class MonthlyRequestsGather extends Command
$this->disableOverusedEngines($sumaFile, $sumas);
$this->disableOverusedEngines($sumaEnFile, $sumasEn);
DB::disconnect('mysql');
}
}
......
......@@ -29,12 +29,14 @@ class Kernel extends ConsoleKernel
$schedule->call(function () {
DB::table('monthlyrequests')->truncate();
DB::disconnect('mysql');
})->monthlyOn(1, '00:00');
// Delete all of the old humanverification entries
$schedule->call(function () {
DB::delete('DELETE FROM humanverification WHERE updated_at < (now() - interval 72 hour) AND whitelist = 0 ORDER BY updated_at DESC');
DB::delete('DELETE FROM humanverification WHERE updated_at < (now() - interval 2 week) AND whitelist = 1 ORDER BY updated_at DESC');
DB::disconnect('mysql');
})->everyThirtyMinutes();
}
......
......@@ -51,6 +51,7 @@ class HumanVerification extends Controller
->with('id', $id)
->with('url', $url)
->with('image', $captcha["img"]);
}
public static function remove(Request $request)
......
......@@ -48,6 +48,7 @@ class StartpageController extends Controller
$sponsors = [];
try {
$sponsors = DB::table('sponsorenlinks')->where('langcode', 'de')->orderByRaw('LENGTH(linktext)', 'ASC')->get();
DB::disconnect('mysql');
} catch (\Illuminate\Database\QueryException $e) {
Log::info($e);
}
......
......@@ -126,10 +126,8 @@ class HumanVerification
# The user currently isn't locked
# We have different security gates:
# 50, 75, 85, >=90 => Captcha validated Result Pages
# 50 and then every 25 => Captcha validated Result Pages
# If the user shows activity on our result page the counter will be deleted
# Maybe I'll add a ban if the user reaches 100
if ($user["unusedResultPages"] === 50 || ($user["unusedResultPages"] > 50 && $user["unusedResultPages"] % 25 === 0)) {
$user["locked"] = true;
}
......@@ -138,8 +136,8 @@ class HumanVerification
} catch (\Illuminate\Database\QueryException $e) {
// Failure in contacting metager3.de
} finally {
// Update the user in the database
if ($update) {
// Update the user in the database
if ($newUser) {
DB::table('humanverification')->insert(
[
......@@ -168,8 +166,10 @@ class HumanVerification
);
}
}
DB::disconnect('mysql');
}
$request->request->add(['verification_id' => $user["uid"], 'verification_count' => $user["unusedResultPages"]]);
return $next($request);
}
}
......@@ -48,7 +48,7 @@ return [
'sqlite' => [
'driver' => 'sqlite',
'database' => database_path(env('DB_DATABASE', 'database.sqlite')),
'database' => database_path(env('SQLITE_DATABASE', 'database.sqlite')),
'prefix' => '',
],
......
......@@ -66,7 +66,7 @@ return [
|
*/
'failed' => [
'database' => env('DB_CONNECTION', 'mysql'),
'database' => 'sqlite',
'table' => 'failed_jobs',
],
];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment