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
f5815d8e
Commit
f5815d8e
authored
Aug 09, 2016
by
Dominik Hebeler
Browse files
Merge branch '179-confidential-issue' into 'development'
Weitere anonymisierungen durchgeführt Closes #179 See merge request
!258
parents
7dbe8b1a
526b6b43
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/MetaGer.php
View file @
f5815d8e
...
...
@@ -162,25 +162,13 @@ class MetaGer
{
$logEntry
=
""
;
$logEntry
.
=
"["
.
date
(
DATE_RFC822
,
mktime
(
date
(
"H"
),
date
(
"i"
),
date
(
"s"
),
date
(
"m"
),
date
(
"d"
),
date
(
"Y"
)))
.
"]"
;
$logEntry
.
=
" From="
.
$this
->
ip
;
$logEntry
.
=
" pid="
.
getmypid
();
$anonId
=
md5
(
"MySeCrEtSeEdFoRmd5"
.
$this
->
request
->
header
(
'Accept'
)
.
$this
->
request
->
header
(
'Accept-Charset'
)
.
$this
->
request
->
header
(
'Accept-Encoding'
)
.
$this
->
request
->
header
(
'HTTP_LANGUAGE'
)
.
$this
->
request
->
header
(
'User-Agent'
)
.
$this
->
request
->
header
(
'Keep-Alive'
)
.
$this
->
request
->
header
(
'X-Forwarded-For'
)
.
date
(
"H"
));
# Wichtig!! Den Parameter um die aktuelle Stunde erweitern. Ansonsten wäre die anonId dauerhaft einem Nutzer zuzuordnen.
$logEntry
.
=
" anonId=
$anonId
"
;
$logEntry
.
=
" ref="
.
$this
->
request
->
header
(
'Referer'
);
$useragent
=
$this
->
request
->
header
(
'User-Agent'
);
$useragent
=
str_replace
(
"("
,
" "
,
$useragent
);
$useragent
=
str_replace
(
")"
,
" "
,
$useragent
);
$useragent
=
str_replace
(
" "
,
""
,
$useragent
);
$logEntry
.
=
" ua="
.
$useragent
;
$logEntry
.
=
" iter= mm= time="
.
round
((
microtime
(
true
)
-
$this
->
starttime
),
2
)
.
" serv="
.
$this
->
fokus
.
" which= hits= stringSearch= QuickTips= SSS= check="
;
$logEntry
.
=
" time="
.
round
((
microtime
(
true
)
-
$this
->
starttime
),
2
)
.
" serv="
.
$this
->
fokus
;
$logEntry
.
=
" search="
.
$this
->
eingabe
;
$redis
->
rpush
(
'logs.search'
,
$logEntry
);
}
catch
(
\
Exception
$e
)
...
...
app/Models/Searchengine.php
View file @
f5815d8e
...
...
@@ -55,13 +55,7 @@ abstract class Searchengine
}
# User-Agent definieren:
if
(
isset
(
$_SERVER
[
'HTTP_USER_AGENT'
]))
{
$this
->
useragent
=
$_SERVER
[
'HTTP_USER_AGENT'
];
}
else
{
$this
->
useragent
=
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"
;
}
$this
->
useragent
=
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"
;
$this
->
ip
=
$metager
->
getIp
();
$this
->
gefVon
=
"<a href=
\"
"
.
$this
->
homepage
.
"
\"
target=
\"
_blank
\"
>"
.
$this
->
displayName
.
"</a>"
;
$this
->
startTime
=
microtime
();
...
...
Write
Preview
Supports
Markdown
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