Commit 32e54282 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

fixed cache key

parent 2268f8b6
......@@ -8,12 +8,11 @@ class AgentVerification extends Verification
public function __construct($id = null, $uid = null)
{
$this->cache_prefix = "humanverification.ip";
$request = \request();
$ip = $request->ip();
$this->cache_prefix = "humanverification.agent";
if (empty($id) || empty($uid)) {
$request = \request();
$ip = $request->ip();
$id = hash("sha1", $_SERVER["AGENT"]);
$uid = hash("sha1", $_SERVER["AGENT"] . $ip . "uid");
}
......@@ -23,6 +22,6 @@ class AgentVerification extends Verification
public static function impersonate($id, $uid)
{
return new IPVerification($id, $uid);
return new AgentVerification($id, $uid);
}
}
......@@ -10,10 +10,9 @@ class IPVerification extends Verification
{
$this->cache_prefix = "humanverification.ip";
$request = \request();
$ip = $request->ip();
if (empty($id) || empty($uid)) {
$request = \request();
$ip = $request->ip();
$id = hash("sha1", $ip);
$uid = hash("sha1", $ip . $_SERVER["AGENT"] . "uid");
}
......
Supports Markdown
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