Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
fe842c2b
Commit
fe842c2b
authored
Feb 27, 2019
by
Dominik Hebeler
Browse files
Merge branch 'development' into '862-member-key-cannot-be-used-with-the-search-plugin'
Development See merge request
open-source/MetaGer!1382
parents
cab04187
7f0a3d8b
Changes
7
Hide whitespace changes
Inline
Side-by-side
app/Console/Commands/MonthlyRequestsGather.php
View file @
fe842c2b
...
...
@@ -64,7 +64,7 @@ class MonthlyRequestsGather extends Command
$this
->
disableOverusedEngines
(
$sumaFile
,
$sumas
);
$this
->
disableOverusedEngines
(
$sumaEnFile
,
$sumasEn
);
DB
::
disconnect
(
'mysql'
);
}
}
...
...
app/Console/Kernel.php
View file @
fe842c2b
...
...
@@ -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
();
}
...
...
app/Http/Controllers/HumanVerification.php
View file @
fe842c2b
...
...
@@ -51,6 +51,7 @@ class HumanVerification extends Controller
->
with
(
'id'
,
$id
)
->
with
(
'url'
,
$url
)
->
with
(
'image'
,
$captcha
[
"img"
]);
}
public
static
function
remove
(
Request
$request
)
...
...
app/Http/Controllers/StartpageController.php
View file @
fe842c2b
...
...
@@ -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
);
}
...
...
app/Http/Middleware/HumanVerification.php
View file @
fe842c2b
...
...
@@ -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
);
}
}
config/database.php
View file @
fe842c2b
...
...
@@ -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'
=>
''
,
],
...
...
config/queue.php
View file @
fe842c2b
...
...
@@ -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
];
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment