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 ...@@ -64,7 +64,7 @@ class MonthlyRequestsGather extends Command
$this->disableOverusedEngines($sumaFile, $sumas); $this->disableOverusedEngines($sumaFile, $sumas);
$this->disableOverusedEngines($sumaEnFile, $sumasEn); $this->disableOverusedEngines($sumaEnFile, $sumasEn);
DB::disconnect('mysql');
} }
} }
......
...@@ -29,12 +29,14 @@ class Kernel extends ConsoleKernel ...@@ -29,12 +29,14 @@ class Kernel extends ConsoleKernel
$schedule->call(function () { $schedule->call(function () {
DB::table('monthlyrequests')->truncate(); DB::table('monthlyrequests')->truncate();
DB::disconnect('mysql');
})->monthlyOn(1, '00:00'); })->monthlyOn(1, '00:00');
// Delete all of the old humanverification entries // Delete all of the old humanverification entries
$schedule->call(function () { $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 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::delete('DELETE FROM humanverification WHERE updated_at < (now() - interval 2 week) AND whitelist = 1 ORDER BY updated_at DESC');
DB::disconnect('mysql');
})->everyThirtyMinutes(); })->everyThirtyMinutes();
} }
......
...@@ -51,6 +51,7 @@ class HumanVerification extends Controller ...@@ -51,6 +51,7 @@ class HumanVerification extends Controller
->with('id', $id) ->with('id', $id)
->with('url', $url) ->with('url', $url)
->with('image', $captcha["img"]); ->with('image', $captcha["img"]);
} }
public static function remove(Request $request) public static function remove(Request $request)
......
...@@ -48,6 +48,7 @@ class StartpageController extends Controller ...@@ -48,6 +48,7 @@ class StartpageController extends Controller
$sponsors = []; $sponsors = [];
try { try {
$sponsors = DB::table('sponsorenlinks')->where('langcode', 'de')->orderByRaw('LENGTH(linktext)', 'ASC')->get(); $sponsors = DB::table('sponsorenlinks')->where('langcode', 'de')->orderByRaw('LENGTH(linktext)', 'ASC')->get();
DB::disconnect('mysql');
} catch (\Illuminate\Database\QueryException $e) { } catch (\Illuminate\Database\QueryException $e) {
Log::info($e); Log::info($e);
} }
......
...@@ -126,10 +126,8 @@ class HumanVerification ...@@ -126,10 +126,8 @@ class HumanVerification
# The user currently isn't locked # The user currently isn't locked
# We have different security gates: # 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 # 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)) { if ($user["unusedResultPages"] === 50 || ($user["unusedResultPages"] > 50 && $user["unusedResultPages"] % 25 === 0)) {
$user["locked"] = true; $user["locked"] = true;
} }
...@@ -138,8 +136,8 @@ class HumanVerification ...@@ -138,8 +136,8 @@ class HumanVerification
} catch (\Illuminate\Database\QueryException $e) { } catch (\Illuminate\Database\QueryException $e) {
// Failure in contacting metager3.de // Failure in contacting metager3.de
} finally { } finally {
// Update the user in the database
if ($update) { if ($update) {
// Update the user in the database
if ($newUser) { if ($newUser) {
DB::table('humanverification')->insert( DB::table('humanverification')->insert(
[ [
...@@ -168,8 +166,10 @@ class HumanVerification ...@@ -168,8 +166,10 @@ class HumanVerification
); );
} }
} }
DB::disconnect('mysql');
} }
$request->request->add(['verification_id' => $user["uid"], 'verification_count' => $user["unusedResultPages"]]); $request->request->add(['verification_id' => $user["uid"], 'verification_count' => $user["unusedResultPages"]]);
return $next($request); return $next($request);
} }
} }
...@@ -48,7 +48,7 @@ return [ ...@@ -48,7 +48,7 @@ return [
'sqlite' => [ 'sqlite' => [
'driver' => 'sqlite', 'driver' => 'sqlite',
'database' => database_path(env('DB_DATABASE', 'database.sqlite')), 'database' => database_path(env('SQLITE_DATABASE', 'database.sqlite')),
'prefix' => '', 'prefix' => '',
], ],
......
...@@ -9,7 +9,7 @@ return [ ...@@ -9,7 +9,7 @@ return [
| API, giving you convenient access to each back-end using the same | API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection. | syntax for every one. Here you may define a default connection.
| |
*/ */
'default' => env('QUEUE_CONNECTION', 'sync'), 'default' => env('QUEUE_CONNECTION', 'sync'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
...@@ -22,7 +22,7 @@ return [ ...@@ -22,7 +22,7 @@ return [
| |
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
| |
*/ */
'connections' => [ 'connections' => [
'sync' => [ 'sync' => [
'driver' => 'sync', 'driver' => 'sync',
...@@ -64,9 +64,9 @@ return [ ...@@ -64,9 +64,9 @@ return [
| can control which database and table are used to store the jobs that | 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. | have failed. You may change them to any database / table you wish.
| |
*/ */
'failed' => [ 'failed' => [
'database' => env('DB_CONNECTION', 'mysql'), 'database' => 'sqlite',
'table' => 'failed_jobs', '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