Commit 8cab1f5b authored by Dominik Hebeler's avatar Dominik Hebeler

Bugs behoben. Zeitliche Löschung aber noch nicht eingebaut. Das kommt bald.

parent 10563bef
......@@ -38,7 +38,7 @@ class HumanVerification
DB::table('humanverification')->insert(
['id' => $id, 'unusedResultPages' => 1, 'locked' => false, 'updated_at' => now()]
);
$user = DB::table('humanverification')->where($id, $id)->first();
$user = DB::table('humanverification')->where('id', $id)->first();
}else if($user->locked !== "1"){
$unusedResultPages = intval($user->unusedResultPages);
$unusedResultPages++;
......
......@@ -14,10 +14,10 @@ class CreateHumanverificationTable extends Migration
public function up()
{
Schema::create('humanverification', function (Blueprint $table) {
$table->string('id');
$table->string('id')->unique();
$table->integer('unusedResultPages');
$table->boolean('locked');
$table->date('updated_at');
$table->timestamp('updated_at');
});
}
......
......@@ -134,7 +134,25 @@ function clickLog () {
function botProtection () {
$(".result").find("a").click(function(){
$.post('/img/cat.jpg', { mm: $("meta[name=mm]").attr("content")});
var link = $(this).attr("href");
var newtab = false;
if($(this).attr("target") == "_blank"){
newtab = true;
}
$.ajax({
url: '/img/cat.jpg',
type: "post",
data: { mm: $("meta[name=mm]").attr("content")},
timeout: 2000
})
.always(function(){
if(!newtab)
document.location.href = link;
});
if(!newtab)
return false;
else
return true;
});
}
......
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