Commit 07c25bbd authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch '67-anonymisierung-der-nutzerdaten-abschliessen' into 'master'

Resolve "Anonymisierung der Nutzerdaten abschließen"

Closes #67

See merge request !71
parents 8859f7fc f96d1fe1
...@@ -15,6 +15,7 @@ class MetaGerSearch extends Controller ...@@ -15,6 +15,7 @@ class MetaGerSearch extends Controller
{ {
public function search(Request $request, MetaGer $metager) public function search(Request $request, MetaGer $metager)
{ {
#die($request->header('User-Agent'));
$time = microtime(); $time = microtime();
# Mit gelieferte Formulardaten parsen und abspeichern: # Mit gelieferte Formulardaten parsen und abspeichern:
$metager->parseFormData($request); $metager->parseFormData($request);
......
...@@ -491,6 +491,8 @@ class MetaGer ...@@ -491,6 +491,8 @@ class MetaGer
} }
$this->agent = new Agent(); $this->agent = new Agent();
$this->mobile = $this->agent->isMobile(); $this->mobile = $this->agent->isMobile();
if($this->mobile)
die("test");
#Sprüche #Sprüche
$this->sprueche = $request->input('sprueche', 'off'); $this->sprueche = $request->input('sprueche', 'off');
if($this->sprueche === "off" ) if($this->sprueche === "off" )
......
...@@ -11,9 +11,19 @@ ...@@ -11,9 +11,19 @@
# nicht einmal wir selbst noch Zugriff auf die Daten haben: # nicht einmal wir selbst noch Zugriff auf die Daten haben:
if( !isset($_SERVER['HTTP_X_FORWARDED_FOR'] )) if( !isset($_SERVER['HTTP_X_FORWARDED_FOR'] ))
{ {
$_SERVER['REMOTE_ADDR'] = substr($_SERVER['REMOTE_ADDR'], 0, strrpos($_SERVER['REMOTE_ADDR'], ".")) . ".0"; $_SERVER['REMOTE_ADDR'] = preg_replace("/(\d+)\.(\d+)\.\d+.\d+/s", "$1.$2.0.0", $_SERVER['REMOTE_ADDR']);
#$_SERVER['HTTP_USER_AGENT'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 23); }else
{
$_SERVER['HTTP_X_FORWARDED_FOR'] = preg_replace("/(\d+)\.(\d+)\.\d+.\d+/s", "$1.$2.0.0", $_SERVER['HTTP_X_FORWARDED_FOR']);
}
$agentPieces = explode(" ", $_SERVER['HTTP_USER_AGENT']);
for($i = 0; $i < count($agentPieces); $i++)
{
$agentPieces[$i] = preg_replace("/(\d+\.\d+)/s", "0.0", $agentPieces[$i]);
$agentPieces[$i] = preg_replace("/([^\/]*)\/\w+/s", "$1/0.0", $agentPieces[$i]);
} }
$_SERVER['HTTP_USER_AGENT'] = implode(" ", $agentPieces);
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
......
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