Commit e3a56af7 authored by Dominik Hebeler's avatar Dominik Hebeler

Merge branch '862-member-key-cannot-be-used-with-the-search-plugin' of...

Merge branch '862-member-key-cannot-be-used-with-the-search-plugin' of https://gitlab.metager3.de/open-source/MetaGer into 862-member-key-cannot-be-used-with-the-search-plugin
parents bbf8d31c fe842c2b
......@@ -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' => '',
],
......
......@@ -9,7 +9,7 @@ return [
| API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection.
|
*/
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
/*
|--------------------------------------------------------------------------
......@@ -22,7 +22,7 @@ return [
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
*/
'connections' => [
'sync' => [
'driver' => 'sync',
......@@ -64,9 +64,9 @@ return [
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
*/
'failed' => [
'database' => env('DB_CONNECTION', 'mysql'),
'database' => 'sqlite',
'table' => 'failed_jobs',
],
];
\ No newline at end of file
];
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