Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Commits
7784d87d
Commit
7784d87d
authored
6 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
Es werden nun auch die URLs geloggt bzw gelöscht, damit Vorgänge auch nachvollziehbar bleiben.
parent
ff5fbcb6
No related branches found
No related tags found
1 merge request
!1365
Resolve "Filter Options for MetaGer"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Http/Middleware/HumanVerification.php
+4
-0
4 additions, 0 deletions
app/Http/Middleware/HumanVerification.php
database/migrations/2018_05_03_101301_usedurls.php
+34
-0
34 additions, 0 deletions
database/migrations/2018_05_03_101301_usedurls.php
with
38 additions
and
0 deletions
app/Http/Middleware/HumanVerification.php
+
4
−
0
View file @
7784d87d
...
...
@@ -38,6 +38,8 @@ class HumanVerification
DB
::
table
(
'humanverification'
)
->
insert
(
[
'id'
=>
$id
,
'unusedResultPages'
=>
1
,
'locked'
=>
false
,
'updated_at'
=>
now
()]
);
# Insert the URL the user tries to reach
DB
::
table
(
'usedurls'
)
->
insert
([
'user_id'
=>
$id
,
'url'
=>
$request
->
url
()]);
$user
=
DB
::
table
(
'humanverification'
)
->
where
(
'id'
,
$id
)
->
first
();
}
else
if
(
$user
->
locked
!==
1
){
$unusedResultPages
=
intval
(
$user
->
unusedResultPages
);
...
...
@@ -50,6 +52,8 @@ class HumanVerification
$locked
=
true
;
}
DB
::
table
(
'humanverification'
)
->
where
(
'id'
,
$id
)
->
update
([
'unusedResultPages'
=>
$unusedResultPages
,
'locked'
=>
$locked
,
'updated_at'
=>
$createdAt
]);
# Insert the URL the user tries to reach
DB
::
table
(
'usedurls'
)
->
insert
([
'user_id'
=>
$id
,
'url'
=>
$request
->
url
()]);
}
$request
->
request
->
add
([
'verification_id'
=>
$id
,
'verification_count'
=>
$unusedResultPages
]);
...
...
This diff is collapsed.
Click to expand it.
database/migrations/2018_05_03_101301_usedurls.php
0 → 100644
+
34
−
0
View file @
7784d87d
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
Usedurls
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'usedurls'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
)
->
unique
();
$table
->
string
(
'user_id'
);
$table
->
string
(
'url'
);
$table
->
timestamp
(
'created_at'
);
$table
->
foreign
(
'user_id'
)
->
references
(
'id'
)
->
on
(
'humanverification'
)
->
onDelete
(
'cascade'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
drop
(
'usedurls'
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment