Compare commits

..

No commits in common. 'master' and 'v0.2.1' have entirely different histories.

10
.env

@ -1,10 +0,0 @@
SUBNET=172.16.28
EXPOSE_APACHE_WEB_SERVER_ON_PORT=8787
EXPOSE_APACHE_WEB_SERVER_ONLY_ON_IP_ADDRESS_COLON=
EXPOSE_MARIADB_ON_PORT=3386
MARIADB_ROOT_PASSWORD=qwerty
MARIADB_USERNAME=root
MARIADB_PASSWORD=qwerty
MARIADB_HOSTNAME=mariadb
MARIADB_PORT=3306
MARIADB_DATABASE_NAME=captcheck

@ -1,2 +0,0 @@
RewriteEngine On
RewriteRule ^captcheck.dist.js captcheck.min.js [L]

@ -1,23 +1,9 @@
Copyright (C) 2017-2021 Netsyms Technologies.
Copyright (C) 2017 Netsyms Technologies.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
NETSYMS TECHNOLOGIES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL NETSYMS TECHNOLOGIES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name and other identifying marks of
Netsyms Technologies shall not be used in advertising or otherwise to promote
the sale, use or other dealings in this Software without prior written
authorization from Netsyms Technologies.
Except as contained in this notice, the name and other identifying marks of Netsyms Technologies shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Netsyms Technologies.

@ -1,17 +1,14 @@
<?php
require __DIR__ . '/required.php';
use Medoo\Medoo;
header("Content-Type: application/json");
// Oldest session allowed
$session_min_date = date("Y-m-d H:i:s", strtotime("-" . SESSION_EXPIRE_MINUTES . " minutes"));
// Delete old sessions
$old_sessions = $database->select("sessions", "sid", ["timestamp[<]" => $session_min_date]);
foreach ($old_sessions as $sid) {
$database->delete("scrambled_answers", ["sid" => $sid]);
$database->delete("sessions", ["sid" => $sid]);
}
$database->delete("scrambled_answers", ["sid" => $old_sessions]);
$database->delete("sessions", ["sid" => $old_sessions]);
switch ($VARS['action']) {
case "ping":
@ -21,47 +18,26 @@ switch ($VARS['action']) {
// generate unique session ID that has an essentially zero chance of being a duplicate.
// Contains a hash of a secure random number, a hash of the user's IP, and 23 uniqid() characters.
$skey = uniqid(substr(hash("md5", mt_rand()), 3, 5) . hash("md5", getUserIP()), true);
// Image problem
//
// Get five random options
$answer_count = $database->count('answers');
$answers = $database->select('answers', ['aid', 'aname'], ["LIMIT" => [mt_rand(0, $answer_count - 6), 5]]);
$answers = $database->select('answers', ['aid', 'aname']);
shuffle($answers);
// Pick a correct one at random
$answers = array_slice($answers, 0, 5);
//var_dump($answers);
$correct_answer = $answers[mt_rand(0, count($answers) - 1)];
// Scramble the answer names so the client doesn't know the real answers.
$scrambled = ["real" => [], "fake" => []];
foreach ($answers as $a) {
$scrambled["real"][] = $a['aid'];
$scrambled["fake"][] = substr(hash("md5", mt_rand()), 0, 20);
}
// Text problem
//
// Get random question
$access_count = $database->count('access_questions');
$access_question = $database->select('access_questions', ['acqid', 'acqtext'], ["LIMIT" => [mt_rand(0, $access_count - 1), 1]])[0];
// Save the session data
$database->insert("sessions", ["skey" => $skey, "aid" => $correct_answer['aid'], "acqid" => $access_question['acqid'], "expired" => 0, "timestamp" => Medoo::raw("NOW()"), "ipaddr" => getUserIP()]);
$database->insert("sessions", ["skey" => $skey, "aid" => $correct_answer['aid'], "expired" => 0, "#timestamp" => "NOW()", "ipaddr" => getUserIP()]);
$sid = $database->id();
// Save the answer data
$scrambled_insert = [];
for ($i = 0; $i < count($scrambled['real']); $i++) {
$scrambled_insert[] = ["sid" => $sid, "aid" => $scrambled['real'][$i], "acode" => $scrambled['fake'][$i]];
}
$database->insert("scrambled_answers", $scrambled_insert);
// Vary question wording a little
$questions = ["Please click on the [].", "Click the [].", "Find the []."];
shuffle($questions);
$resp = [
"session" => $skey,
"id_prefix" => substr(hash("md5", mt_rand()), 3, 5),
"question_i" => str_replace("[]", $correct_answer['aname'], $questions[0]),
"question_a" => $access_question['acqtext'],
"question" => $correct_answer['aname'],
"answers" => $scrambled["fake"]
];
exit(json_encode($resp));
@ -112,28 +88,15 @@ switch ($VARS['action']) {
echo json_encode(["session" => $VARS['session_id'], "result" => false, "msg" => "Session key already used."]);
exit();
}
$image = false;
if ($database->has("scrambled_answers", ["AND" => ["sid" => $sid, "acode" => $VARS['answer_id']]])) {
// Image maybe correct
$image = true;
} else if ($database->has("sessions", ["[>]access_answers" => ["acqid" => "acqid"]], ["AND" => ["sid" => $sid, "OR" => ["acatext" => strtolower($VARS['answer_id']), "acahash" => hash('md5', strtolower($VARS['answer_id']))]]])) {
// Accessible text correct
$image = false;
} else {
// Invalid answer
if (!$database->has("scrambled_answers", ["AND" => ["sid" => $sid, "acode" => $VARS['answer_id']]])) {
echo json_encode(["session" => $VARS['session_id'], "result" => false, "msg" => "Answer invalid."]);
exit();
}
if ($image) {
$aid = $database->get('scrambled_answers', 'aid', ["AND" => ["sid" => $sid, "acode" => $VARS['answer_id']]]);
if ($database->has('sessions', ["AND" => ["sid" => $sid, "aid" => $aid]])) {
echo json_encode(["session" => $VARS['session_id'], "result" => true]);
} else {
echo json_encode(["session" => $VARS['session_id'], "result" => false, "msg" => "Answer incorrect."]);
}
} else {
$aid = $database->get('scrambled_answers', 'aid', ["AND" => ["sid" => $sid, "acode" => $VARS['answer_id']]]);
if ($database->has('sessions', ["AND" => ["sid" => $sid, "aid" => $aid]])) {
echo json_encode(["session" => $VARS['session_id'], "result" => true]);
} else {
echo json_encode(["session" => $VARS['session_id'], "result" => false, "msg" => "Answer incorrect."]);
}
$database->update("sessions", ['expired' => 1], ["sid" => $sid]);
exit();

@ -1,75 +0,0 @@
/**
CSS code that captcheck.js injects into the page.
Don't use this file in your site; captcheck.js contains it.
*/
.captcheck_box {
font-family: Ubuntu, Arial, sans-serif;
color: black;
border: 1px solid #e0e0e0;
border-radius: 3px;
display: inline-block;
padding: 3px;
margin: 5px 2px 5px 1px;
background-color: #f5f5f5;
text-decoration: none;
}
.captcheck_label_message,
.captcheck_label_message b {
color: black;
font-family: Ubuntu, Roboto, Arial, sans-serif;
}
.captcheck_answer_label {
border: 0px;
}
.captcheck_answer_label > input {
visibility: hidden;
position: absolute;
}
.captcheck_answer_label > input + img {
cursor: pointer;
border: 2px solid transparent;
border-radius: 3px;
min-width: 32px;
width: 18%;
max-width: 64px;
}
.captcheck_answer_label > input:checked + img {
cursor: pointer;
border: 2px solid #424242;
border-radius: 3px;
}
.captcheck_error_message {
color: red;
}
.captcheck_question_image {
display: initial;
}
.captcheck_question_access {
display: none;
}
.captcheck_alt_question_button {
float: right;
font-size: 80%;
cursor: pointer;
color: inherit;
text-decoration: inherit;
border: 0px;
}
.captcheck_answer_images {
display: initial;
}
.captcheck_answer_access {
display: none;
}

@ -1,123 +1,59 @@
window.onload = function () {
var api_url = "https://captcheck.netsyms.com/api.php";
function chooseAnswer(idp, ans) {
var box = document.getElementById("captcheck_" + idp + "_answer_" + ans);
box.checked = true;
return false;
}
function switchMode(idp) {
var switch_label = document.getElementById("captcheck_" + idp + "_alt_question_button");
var img_q = document.getElementById("captcheck_" + idp + "_question_image");
var acc_q = document.getElementById("captcheck_" + idp + "_question_access");
var img_a = document.getElementById("captcheck_" + idp + "_answer_images");
var acc_a = document.getElementById("captcheck_" + idp + "_answer_access");
if (switch_label.innerHTML == "&gt; Text mode") {
switch_label.innerHTML = "&gt; Image mode";
img_q.style.display = "none";
acc_q.style.display = "initial";
img_a.style.display = "none";
acc_a.style.display = "initial";
acc_a.innerHTML = "<input type='text' name='captcheck_selected_answer' aria-label='Type your answer here.' autocomplete='off' autofill='off'/>";
} else {
switch_label.innerHTML = "&gt; Text mode";
img_q.style.display = "initial";
acc_q.style.display = "none";
img_a.style.display = "initial";
acc_a.style.display = "none";
acc_a.innerHTML = "";
}
}
var nonce = "";
/* Loop over all the CAPTCHA containers on the page, setting up a different CAPTCHA in each */
Array.prototype.forEach.call(document.getElementsByClassName("captcheck_container"), function (container) {
if (container.dataset.stylenonce) {
nonce = container.dataset.stylenonce;
}
var getJSON = function (url, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', api_url + "?action=new", true);
xhr.open('GET', url, true);
xhr.onreadystatechange = function () {
if (this.readyState == 4) {
var status = this.status;
var json = this.responseText;
/* Prevent rare bug where two CAPTCHAs appear in one container */
if (container.innerHTML.trim() != "") {
return;
}
/* Create captcha div */
var captcha = document.createElement("div");
captcha.setAttribute("class", "captcheck_box");
container.appendChild(captcha);
if (status == 200) {
var data = JSON.parse(json);
// ID prefix to use for this instance
var idp = data.id_prefix;
/* Create answer buttons */
var answers = "<div class='captcheck_answer_images' id='captcheck_" + idp + "_answer_images'>";
for (var i = 0, len = data.answers.length; i < len; i++) {
var src = api_url + "?action=img&s=" + data.session + "&c=" + data.answers[i];
answers += "<a class='captcheck_answer_label' href='' data-prefix='" + idp + "' data-answer='" + data.answers[i] + "' tabindex='0' aria-role='button'><input id='captcheck_" + idp + "_answer_" + data.answers[i] + "' type='radio' name='captcheck_selected_answer' value='" + data.answers[i] + "' data-prefix='" + idp + "' data-answer='" + data.answers[i] + "' /><img src='" + src + "' data-prefix='" + idp + "' data-answer='" + data.answers[i] + "'/></a>";
}
answers += "</div>";
var answer_div = document.createElement("div");
answer_div.innerHTML = answers + "<div class='captcheck_answer_access' id='captcheck_" + idp + "_answer_access'></div>";
/* Create question */
var question_div = document.createElement("div");
question_div.setAttribute("class", "captcheck_label_message");
question_div.setAttribute("id", "captcheck_" + idp + "_label_message")
question_div.innerHTML = "<span class='captcheck_question_image' id='captcheck_" + idp + "_question_image'>" + data.question_i + "</span><span class='captcheck_question_access' id='captcheck_" + idp + "_question_access'>" + data.question_a + "</span><a href='' class='captcheck_alt_question_button' data-prefix='" + idp + "' id='captcheck_" + idp + "_alt_question_button' aria-role='button' aria-label='Switch between image and text question' tabindex='0'>&gt; Text mode</a>";
/* Add question and answers */
captcha.appendChild(question_div);
captcha.appendChild(answer_div);
/* Add hidden session ID element */
var skey_input = document.createElement("span");
skey_input.innerHTML = "<input type='hidden' name='captcheck_session_code' value='" + data.session + "' />";
captcha.appendChild(skey_input);
var answer_buttons = document.querySelectorAll(".captcheck_answer_label[data-prefix=\"" + idp + "\"]");
for (var i = 0; i < answer_buttons.length; i++) {
answer_buttons[i].addEventListener("click", function (ev) {
chooseAnswer(ev.target.getAttribute("data-prefix"), ev.target.getAttribute("data-answer"));
ev.preventDefault();
});
answer_buttons[i].addEventListener('keydown', function (ev) {
if (ev.key === "Enter" || ev.which === 13 || ev.keyCode === 13 || ev.key === ' ' || ev.which === 32 || ev.keyCode === 32) {
chooseAnswer(ev.target.getAttribute("data-prefix"), ev.target.getAttribute("data-answer"));
ev.preventDefault();
}
});
}
document.querySelector(".captcheck_alt_question_button[data-prefix=\"" + idp + "\"]").addEventListener("click", function (ev) {
switchMode(ev.target.getAttribute("data-prefix"));
ev.preventDefault();
});
document.querySelector(".captcheck_alt_question_button[data-prefix=\"" + idp + "\"]").addEventListener('keydown', function (ev) {
if (ev.key === "Enter" || ev.which === 13 || ev.keyCode === 13 || ev.key === ' ' || ev.which === 32 || ev.keyCode === 32) {
switchMode(ev.target.getAttribute("data-prefix"));
ev.preventDefault();
}
});
} else {
/* Add error message */
captcha.innerHTML = "<span class='captcheck_error_message'>There was a problem loading the CAPTCHA.</span>";
}
callback(this.status, this.responseText);
}
};
xhr.send();
};
getJSON(api_url + "?action=new", function (status, json) {
/* Add custom styles */
var styles = document.createElement('style');
styles.innerHTML = ".captcheck_box {font-family: Ubuntu, Arial, sans-serif; color: black; border: 1px solid #e0e0e0; border-radius: 3px; display: inline-block; padding: 3px; margin: 5px 2px 5px 1px; background-color: #f5f5f5;} .captcheck_label_message, .captcheck_label_message b {color: black; font-family: Ubuntu, Arial, sans-serif;} .captcheck_answer_label > input {visibility: hidden; position: absolute;} .captcheck_answer_label > input + img {cursor: pointer; border: 2px solid transparent; border-radius: 3px; min-width: 32px; width: 18%; max-width: 64px;} .captcheck_answer_label > input:checked + img {cursor: pointer; border: 2px solid #424242; border-radius: 3px;} .captcheck_error_message {color: red;}";
document.body.appendChild(styles);
/* Get captcha container div */
var container = document.getElementById("captcheck_container");
/* Create captcha div */
var captcha = document.createElement("div");
captcha.setAttribute("class", "captcheck_box");
container.appendChild(captcha);
if (status == 200) {
var data = JSON.parse(json);
/* Create answer buttons */
var answers = "";
for (var i = 0, len = data.answers.length; i < len; i++) {
var src = api_url + "?action=img&s=" + data.session + "&c=" + data.answers[i];
answers += "<span class='captcheck_answer_label' onclick='chooseAnswer(\"" + data.answers[i] + "\")'><input id='captcheck_answer_" + data.answers[i] + "' type='radio' name='captcheck_selected_answer' value='" + data.answers[i] + "' /><img src='" + src + "' /></span>";
}
var answer_div = document.createElement("div");
answer_div.innerHTML = answers;
/* Create question */
var question_div = document.createElement("div");
question_div.setAttribute("class", "captcheck_label_message");
question_div.innerHTML = "Click on the <b>" + data.question + "</b>:";
/* Add question and answers */
captcha.appendChild(question_div);
captcha.appendChild(answer_div);
/* Add hidden session ID element */
var skey_input = document.createElement("span");
skey_input.innerHTML = "<input type='hidden' name='captcheck_session_code' value='" + data.session + "' />";
captcha.appendChild(skey_input);
} else {
/* Add error message */
captcha.innerHTML = "<span class='captcheck_error_message'>There was a problem loading the CAPTCHA.</span>";
}
});
}
/* Add custom styles */
var styles = document.createElement('style');
if (nonce != "") {
styles.setAttribute("nonce", nonce);
}
/* Remove newlines/comments from captcheck.css and put it here */
styles.innerHTML = ".captcheck_box{font-family:Ubuntu,Arial,sans-serif;color:black;border:1px solid #e0e0e0;border-radius:3px;display:inline-block;padding:3px;margin:5px 2px 5px 1px;background-color:#f5f5f5;text-decoration:none}.captcheck_label_message,.captcheck_label_message b{color:black;font-family:Ubuntu,Roboto,Arial,sans-serif}.captcheck_answer_label{border:0}.captcheck_answer_label>input{visibility:hidden;position:absolute}.captcheck_answer_label>input+img{cursor:pointer;border:2px solid transparent;border-radius:3px;min-width:32px;width:18%;max-width:64px}.captcheck_answer_label>input:checked+img{cursor:pointer;border:2px solid #424242;border-radius:3px}.captcheck_error_message{color:red}.captcheck_question_image{display:initial}.captcheck_question_access{display:none}.captcheck_alt_question_button{float:right;font-size:80%;cursor:pointer;color:inherit;text-decoration:inherit;border:0}.captcheck_answer_images{display:initial}.captcheck_answer_access{display:none}";
document.body.appendChild(styles);
function chooseAnswer(ans) {
var box = document.getElementById("captcheck_answer_" + ans);
box.checked = true;
}

9
captcheck.min.js vendored

@ -1,9 +0,0 @@
window.onload=function(){function m(c,g){document.getElementById("captcheck_"+c+"_answer_"+g).checked=!0;return!1}function n(c){var g=document.getElementById("captcheck_"+c+"_alt_question_button"),b=document.getElementById("captcheck_"+c+"_question_image"),d=document.getElementById("captcheck_"+c+"_question_access"),f=document.getElementById("captcheck_"+c+"_answer_images");c=document.getElementById("captcheck_"+c+"_answer_access");"&gt; Text mode"==g.innerHTML?(g.innerHTML="&gt; Image mode",b.style.display=
"none",d.style.display="initial",f.style.display="none",c.style.display="initial",c.innerHTML="<input type='text' name='captcheck_selected_answer' aria-label='Type your answer here.' autocomplete='off' autofill='off'/>"):(g.innerHTML="&gt; Text mode",b.style.display="initial",d.style.display="none",f.style.display="initial",c.style.display="none",c.innerHTML="")}var k="";Array.prototype.forEach.call(document.getElementsByClassName("captcheck_container"),function(c){c.dataset.stylenonce&&(k=c.dataset.stylenonce);
var g=new XMLHttpRequest;g.open("GET","https://captcheck.netsyms.com/api.php?action=new",!0);g.onreadystatechange=function(){if(4==this.readyState){var b=this.status,d=this.responseText;if(""==c.innerHTML.trim()){var f=document.createElement("div");f.setAttribute("class","captcheck_box");c.appendChild(f);if(200==b){d=JSON.parse(d);b=d.id_prefix;for(var h="<div class='captcheck_answer_images' id='captcheck_"+b+"_answer_images'>",e=0,g=d.answers.length;e<g;e++)h+="<a class='captcheck_answer_label' href='' data-prefix='"+
b+"' data-answer='"+d.answers[e]+"' tabindex='0' aria-role='button'><input id='captcheck_"+b+"_answer_"+d.answers[e]+"' type='radio' name='captcheck_selected_answer' value='"+d.answers[e]+"' data-prefix='"+b+"' data-answer='"+d.answers[e]+"' /><img src='"+("https://captcheck.netsyms.com/api.php?action=img&s="+d.session+"&c="+d.answers[e])+"' data-prefix='"+b+"' data-answer='"+d.answers[e]+"'/></a>";h+="</div>";e=document.createElement("div");e.innerHTML=h+"<div class='captcheck_answer_access' id='captcheck_"+
b+"_answer_access'></div>";h=document.createElement("div");h.setAttribute("class","captcheck_label_message");h.setAttribute("id","captcheck_"+b+"_label_message");h.innerHTML="<span class='captcheck_question_image' id='captcheck_"+b+"_question_image'>"+d.question_i+"</span><span class='captcheck_question_access' id='captcheck_"+b+"_question_access'>"+d.question_a+"</span><a href='' class='captcheck_alt_question_button' data-prefix='"+b+"' id='captcheck_"+b+"_alt_question_button' aria-role='button' aria-label='Switch between image and text question' tabindex='0'>&gt; Text mode</a>";
f.appendChild(h);f.appendChild(e);h=document.createElement("span");h.innerHTML="<input type='hidden' name='captcheck_session_code' value='"+d.session+"' />";f.appendChild(h);f=document.querySelectorAll('.captcheck_answer_label[data-prefix="'+b+'"]');for(e=0;e<f.length;e++)f[e].addEventListener("click",function(a){m(a.target.getAttribute("data-prefix"),a.target.getAttribute("data-answer"));a.preventDefault()}),f[e].addEventListener("keydown",function(a){if("Enter"===a.key||13===a.which||13===a.keyCode||
" "===a.key||32===a.which||32===a.keyCode)m(a.target.getAttribute("data-prefix"),a.target.getAttribute("data-answer")),a.preventDefault()});document.querySelector('.captcheck_alt_question_button[data-prefix="'+b+'"]').addEventListener("click",function(a){n(a.target.getAttribute("data-prefix"));a.preventDefault()});document.querySelector('.captcheck_alt_question_button[data-prefix="'+b+'"]').addEventListener("keydown",function(a){if("Enter"===a.key||13===a.which||13===a.keyCode||" "===a.key||32===
a.which||32===a.keyCode)n(a.target.getAttribute("data-prefix")),a.preventDefault()})}else f.innerHTML="<span class='captcheck_error_message'>There was a problem loading the CAPTCHA.</span>"}}};g.send()});var l=document.createElement("style");""!=k&&l.setAttribute("nonce",k);l.innerHTML=".captcheck_box{font-family:Ubuntu,Arial,sans-serif;color:black;border:1px solid #e0e0e0;border-radius:3px;display:inline-block;padding:3px;margin:5px 2px 5px 1px;background-color:#f5f5f5;text-decoration:none}.captcheck_label_message,.captcheck_label_message b{color:black;font-family:Ubuntu,Roboto,Arial,sans-serif}.captcheck_answer_label{border:0}.captcheck_answer_label>input{visibility:hidden;position:absolute}.captcheck_answer_label>input+img{cursor:pointer;border:2px solid transparent;border-radius:3px;min-width:32px;width:18%;max-width:64px}.captcheck_answer_label>input:checked+img{cursor:pointer;border:2px solid #424242;border-radius:3px}.captcheck_error_message{color:red}.captcheck_question_image{display:initial}.captcheck_question_access{display:none}.captcheck_alt_question_button{float:right;font-size:80%;cursor:pointer;color:inherit;text-decoration:inherit;border:0}.captcheck_answer_images{display:initial}.captcheck_answer_access{display:none}";
document.body.appendChild(l)};

24
composer.lock generated

@ -1,23 +1,23 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "3d60b6d6d1ba750afa45d307e067f006",
"packages": [
{
"name": "catfan/medoo",
"version": "v1.7.10",
"version": "v1.4.4",
"source": {
"type": "git",
"url": "https://github.com/catfan/Medoo.git",
"reference": "2d675f73e23f63bbaeb9a8aa33318659a3d3c32f"
"reference": "bcabbef4d8355d52fc4d19f17463e5e816c9ef44"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/catfan/Medoo/zipball/2d675f73e23f63bbaeb9a8aa33318659a3d3c32f",
"reference": "2d675f73e23f63bbaeb9a8aa33318659a3d3c32f",
"url": "https://api.github.com/repos/catfan/Medoo/zipball/bcabbef4d8355d52fc4d19f17463e5e816c9ef44",
"reference": "bcabbef4d8355d52fc4d19f17463e5e816c9ef44",
"shasum": ""
},
"require": {
@ -31,7 +31,7 @@
"ext-pdo_oci8": "For Oracle version 8 database",
"ext-pdo_pqsql": "For PostgreSQL database",
"ext-pdo_sqlite": "For SQLite database",
"ext-pdo_sqlsrv": "For MSSQL database on both Window/Liunx platform"
"ext-pdo_sqlsrv": "For MSSQL database on Windows platform"
},
"type": "framework",
"autoload": {
@ -49,11 +49,10 @@
"email": "angel@catfan.me"
}
],
"description": "The lightweight PHP database framework to accelerate development",
"description": "The lightest PHP database framework to accelerate development",
"homepage": "https://medoo.in",
"keywords": [
"database",
"database library",
"lightweight",
"mariadb",
"mssql",
@ -64,11 +63,7 @@
"sql",
"sqlite"
],
"support": {
"issues": "https://github.com/catfan/Medoo/issues",
"source": "https://github.com/catfan/Medoo"
},
"time": "2020-02-11T08:20:42+00:00"
"time": "2017-06-02T15:25:04+00:00"
}
],
"packages-dev": [],
@ -78,6 +73,5 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.0.0"
"platform-dev": []
}

Binary file not shown.

@ -1,3 +1,8 @@
-- MySQL Script generated by MySQL Workbench
-- Fri 09 Jun 2017 01:26:04 PM MDT
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
@ -24,17 +29,6 @@ CREATE TABLE IF NOT EXISTS `captcheck`.`answers` (
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `captcheck`.`access_questions`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `captcheck`.`access_questions` (
`acqid` INT NOT NULL AUTO_INCREMENT,
`acqtext` VARCHAR(255) NOT NULL,
PRIMARY KEY (`acqid`),
UNIQUE INDEX `qaid_UNIQUE` (`acqid` ASC))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `captcheck`.`sessions`
-- -----------------------------------------------------
@ -42,23 +36,16 @@ CREATE TABLE IF NOT EXISTS `captcheck`.`sessions` (
`sid` INT NOT NULL AUTO_INCREMENT,
`skey` VARCHAR(60) NOT NULL,
`aid` INT NOT NULL,
`acqid` INT NOT NULL,
`expired` TINYINT(1) NOT NULL DEFAULT 0,
`timestamp` DATETIME NOT NULL,
`ipaddr` VARCHAR(45) NULL,
PRIMARY KEY (`sid`),
UNIQUE INDEX `sid_UNIQUE` (`sid` ASC),
INDEX `fk_sessions_answers1_idx` (`aid` ASC),
INDEX `fk_sessions_access_qa1_idx` (`acqid` ASC),
CONSTRAINT `fk_sessions_answers1`
FOREIGN KEY (`aid`)
REFERENCES `captcheck`.`answers` (`aid`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_sessions_access_qa1`
FOREIGN KEY (`acqid`)
REFERENCES `captcheck`.`access_questions` (`acqid`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
@ -85,25 +72,6 @@ CREATE TABLE IF NOT EXISTS `captcheck`.`scrambled_answers` (
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `captcheck`.`access_answers`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `captcheck`.`access_answers` (
`acaid` INT NOT NULL AUTO_INCREMENT,
`acqid` INT NOT NULL,
`acatext` VARCHAR(45) NULL,
`acahash` VARCHAR(32) NULL,
PRIMARY KEY (`acaid`, `acqid`),
UNIQUE INDEX `acaid_UNIQUE` (`acaid` ASC),
INDEX `fk_access_answers_access_questions1_idx` (`acqid` ASC),
CONSTRAINT `fk_access_answers_access_questions1`
FOREIGN KEY (`acqid`)
REFERENCES `captcheck`.`access_questions` (`acqid`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
@ -146,125 +114,3 @@ INSERT INTO `captcheck`.`answers` (`aid`, `aname`, `aimg`) VALUES (30, 'gear', '
COMMIT;
-- -----------------------------------------------------
-- Data for table `captcheck`.`access_questions`
-- -----------------------------------------------------
START TRANSACTION;
USE `captcheck`;
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (1, 'The list pink, yellow, library and purple contains how many colours?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (2, 'If the sock is black, what colour is it?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (3, 'Rice, bee and green: how many colours in the list?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (4, 'Enter the lowest number of seventy four, six or 73:');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (5, '67, twelve, fifty, 34, thirty or thirteen: which of these is the largest?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (6, '48, sixty six, eighty seven, sixty nine, twenty seven or 69: the largest is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (7, '39, twenty two, thirteen and 19: the 3rd number is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (8, 'What number is 1st in the series fourteen, 34, 1, 24 and thirty six?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (9, 'Enter the number eighty three thousand six hundred and thirty one in digits:');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (10, 'Enter the number seventy seven thousand and fifty in digits:');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (11, 'What is the 7th digit in 5044750?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (12, 'Which digit is 7th in the number 6172149?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (13, 'What is the 2nd colour in the list black, rice, sock, tongue and green?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (14, 'What is sixty seven thousand one hundred and eighty six as digits?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (15, 'Which of ten, fifty nine or fifty four is the highest?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (16, 'The list rainjacket, hand, brown and tracksuit contains how many colours?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (17, 'The list thumb, bread, arm, church, glove and shark contains how many body parts?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (18, 'The 1st number from 32, 5 and twenty three is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (19, 'What is seventy four thousand and three as digits?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (20, 'Fifteen - four equals ?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (21, 'Enter the biggest number of eleven, ninety, 58 or 84:');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (22, 'If the trousers is green, what colour is it?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (23, 'The 1st number from six, twenty four and twenty two is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (24, 'Enter the number twenty thousand six hundred and five in digits:');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (25, 'If a person is called Elizabeth, what is their name?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (26, 'If tomorrow is Tuesday, what day is today?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (27, 'Six plus 10 is what?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (28, '83, seventy seven or forty one: the smallest is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (29, 'In the number 2244803, what is the 1st digit?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (30, 'Steven\'s name is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (31, 'The list house, finger, eye and stomach contains how many body parts?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (32, 'What is the 2nd digit in 3658990?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (33, 'If the rainjacket is red, what colour is it?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (34, 'Of the numbers fifty nine, 21, 51, fourteen or 6, which is the biggest?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (35, 'The name of Elizabeth is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (36, 'The purple cake is what colour?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (37, 'The 2nd colour in white, ear, pink, red, fruit and brown is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (38, 'What is the 1st colour in the list butter, red, purple and snake?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (39, 'What is the 3rd digit in 8705374?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (40, 'What is fifty nine thousand five hundred and seven as a number?');
COMMIT;
-- -----------------------------------------------------
-- Data for table `captcheck`.`access_answers`
-- -----------------------------------------------------
START TRANSACTION;
USE `captcheck`;
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (1, 1, 'NULL', 'eccbc87e4b5ce2fe28308fd9f2a7baf3');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (2, 1, 'NULL', '35d6d33467aae9a2e3dccb4b6b027878');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (3, 2, 'NULL', '1ffd9e753c8054cc61456ac7fac1ac89');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (4, 3, 'NULL', 'c4ca4238a0b923820dcc509a6f75849b');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (5, 3, 'NULL', 'f97c5d29941bfb1b2fdab0874906ab82');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (6, 4, 'NULL', '1679091c5a880faf6fb5e6087eb1b2dc');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (7, 4, 'NULL', 'f52b5e449a2303c031a0c3a1109360bf');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (8, 5, 'NULL', '735b90b4568125ed6c3f678819b6e058');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (9, 5, 'NULL', 'bd8c596e0540a2e53362ffd8e83c0af1');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (10, 6, 'NULL', 'c7e1249ffc03eb9ded908c236bd1996d');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (11, 6, 'NULL', 'a3862f91f724b3ba93c0d29d596091aa');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (12, 7, 'NULL', 'c51ce410c124a10e0db5e4b97fc2af39');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (13, 7, 'NULL', '422ecc084f2458defc620ecebf2a6448');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (14, 8, 'NULL', 'aab3238922bcc25a6f606eb525ffdc56');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (15, 8, 'NULL', '279e962ea623aa2a3a86739622772e1f');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (16, 9, 'NULL', '99e8619d83ef705cde096f1413284f9d');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (17, 10, 'NULL', '2c078e4b2c48fa83a11b825008177059');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (18, 11, 'NULL', 'cfcd208495d565ef66e7dff9f98764da');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (19, 11, 'NULL', 'd02c4c4cde7ae76252540d116a40f23a');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (20, 12, 'NULL', '45c48cce2e2d7fbdea1afc51c7c6ad26');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (21, 12, 'NULL', 'c785e1ed2950e3e36b1e2ca01f299a54');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (22, 13, 'NULL', '9f27410725ab8cc8854a2769c7a516b8');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (23, 14, 'NULL', '2a21883121a4da3cb0c12e42bf1ab4f9');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (24, 15, 'NULL', '093f65e080a295f8076b1c5722a46aa2');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (25, 15, 'NULL', '674573a74de9d057c6c5a70819b12f5f');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (26, 16, 'NULL', 'c4ca4238a0b923820dcc509a6f75849b');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (27, 16, 'NULL', 'f97c5d29941bfb1b2fdab0874906ab82');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (28, 17, 'NULL', 'c81e728d9d4c2f636f067f89cc14862c');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (29, 17, 'NULL', 'b8a9f715dbb64fd5c56e7783c6820a61');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (30, 18, 'NULL', '6364d3f0f495b6ab9dcf8d3b5c6e0b01');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (31, 18, 'NULL', '8cb16a6da2f0587a3a2b614040dbd2cf');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (32, 19, 'NULL', '1180362fa4d3626eec0aacebeafbe5fc');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (33, 20, 'NULL', '6512bd43d9caa6e02c990b0a82652dca');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (34, 20, 'NULL', '9c8454ddf7aa50116496bac348d7550d');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (35, 21, 'NULL', '8613985ec49eb8f757ae6439e879bb2a');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (36, 21, 'NULL', '2a08e96cadfba8bfb49c392bd4ec27a7');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (37, 22, 'NULL', '9f27410725ab8cc8854a2769c7a516b8');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (38, 23, 'NULL', '1679091c5a880faf6fb5e6087eb1b2dc');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (39, 23, 'NULL', 'f52b5e449a2303c031a0c3a1109360bf');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (40, 24, 'NULL', '1b4f877baadb44b36ff73a44e05ebd4c');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (41, 25, 'NULL', '4af09080574089cbece43db636e2025f');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (42, 26, 'NULL', '944ba223a5c1b5f4b495708e7cd5ee37');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (43, 26, 'NULL', '197639b278057c519189add5413712e3');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (44, 27, 'NULL', 'c74d97b01eae257e44aa9d5bade97baf');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (45, 27, 'NULL', 'bd2c775d9eaf5f71da52b55ade9989a4');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (46, 28, 'NULL', '3416a75f4cea9109507cacd8e2f2aefc');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (47, 28, 'NULL', '7b6cd20827f5a8a4576ef68f45a4ef32');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (48, 29, 'NULL', 'c81e728d9d4c2f636f067f89cc14862c');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (49, 29, 'NULL', 'b8a9f715dbb64fd5c56e7783c6820a61');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (50, 30, 'NULL', '6ed61d4b80bb0f81937b32418e98adca');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (51, 31, 'NULL', 'eccbc87e4b5ce2fe28308fd9f2a7baf3');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (52, 31, 'NULL', '35d6d33467aae9a2e3dccb4b6b027878');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (53, 32, 'NULL', '1679091c5a880faf6fb5e6087eb1b2dc');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (54, 32, 'NULL', 'f52b5e449a2303c031a0c3a1109360bf');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (55, 33, 'NULL', 'bda9643ac6601722a28f238714274da4');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (56, 34, 'NULL', '093f65e080a295f8076b1c5722a46aa2');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (57, 34, 'NULL', '674573a74de9d057c6c5a70819b12f5f');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (58, 35, 'NULL', '4af09080574089cbece43db636e2025f');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (59, 36, 'NULL', 'bb7aedfa61007447dd6efaf9f37641e3');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (60, 37, 'NULL', '4a0b0dcedd48f780778d1cd1bb8f9877');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (61, 38, 'NULL', 'bda9643ac6601722a28f238714274da4');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (62, 39, 'NULL', 'cfcd208495d565ef66e7dff9f98764da');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (63, 39, 'NULL', 'd02c4c4cde7ae76252540d116a40f23a');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (64, 40, 'NULL', '454cba7bd267c3f60d982416d06516f6');
COMMIT;

@ -1,164 +0,0 @@
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
ALTER TABLE `captcheck`.`sessions`
ADD COLUMN `acqid` INT(11) NOT NULL AFTER `aid`,
ADD INDEX `fk_sessions_access_qa1_idx` (`acqid` ASC);
CREATE TABLE IF NOT EXISTS `captcheck`.`access_questions` (
`acqid` INT(11) NOT NULL AUTO_INCREMENT,
`acqtext` VARCHAR(255) NOT NULL,
PRIMARY KEY (`acqid`),
UNIQUE INDEX `qaid_UNIQUE` (`acqid` ASC))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
CREATE TABLE IF NOT EXISTS `captcheck`.`access_answers` (
`acaid` INT(11) NOT NULL AUTO_INCREMENT,
`acqid` INT(11) NOT NULL,
`acatext` VARCHAR(45) NULL DEFAULT NULL,
`acahash` VARCHAR(32) NULL DEFAULT NULL,
PRIMARY KEY (`acaid`, `acqid`),
UNIQUE INDEX `acaid_UNIQUE` (`acaid` ASC),
INDEX `fk_access_answers_access_questions1_idx` (`acqid` ASC),
CONSTRAINT `fk_access_answers_access_questions1`
FOREIGN KEY (`acqid`)
REFERENCES `captcheck`.`access_questions` (`acqid`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
ALTER TABLE `captcheck`.`sessions`
ADD CONSTRAINT `fk_sessions_access_qa1`
FOREIGN KEY (`acqid`)
REFERENCES `captcheck`.`access_questions` (`acqid`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-- -----------------------------------------------------
-- Data for table `captcheck`.`access_questions`
-- -----------------------------------------------------
START TRANSACTION;
USE `captcheck`;
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (1, 'The list pink, yellow, library and purple contains how many colours?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (2, 'If the sock is black, what colour is it?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (3, 'Rice, bee and green: how many colours in the list?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (4, 'Enter the lowest number of seventy four, six or 73:');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (5, '67, twelve, fifty, 34, thirty or thirteen: which of these is the largest?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (6, '48, sixty six, eighty seven, sixty nine, twenty seven or 69: the largest is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (7, '39, twenty two, thirteen and 19: the 3rd number is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (8, 'What number is 1st in the series fourteen, 34, 1, 24 and thirty six?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (9, 'Enter the number eighty three thousand six hundred and thirty one in digits:');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (10, 'Enter the number seventy seven thousand and fifty in digits:');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (11, 'What is the 7th digit in 5044750?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (12, 'Which digit is 7th in the number 6172149?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (13, 'What is the 2nd colour in the list black, rice, sock, tongue and green?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (14, 'What is sixty seven thousand one hundred and eighty six as digits?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (15, 'Which of ten, fifty nine or fifty four is the highest?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (16, 'The list rainjacket, hand, brown and tracksuit contains how many colours?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (17, 'The list thumb, bread, arm, church, glove and shark contains how many body parts?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (18, 'The 1st number from 32, 5 and twenty three is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (19, 'What is seventy four thousand and three as digits?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (20, 'Fifteen - four equals ?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (21, 'Enter the biggest number of eleven, ninety, 58 or 84:');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (22, 'If the trousers is green, what colour is it?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (23, 'The 1st number from six, twenty four and twenty two is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (24, 'Enter the number twenty thousand six hundred and five in digits:');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (25, 'If a person is called Elizabeth, what is their name?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (26, 'If tomorrow is Tuesday, what day is today?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (27, 'Six plus 10 is what?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (28, '83, seventy seven or forty one: the smallest is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (29, 'In the number 2244803, what is the 1st digit?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (30, 'Steven\'s name is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (31, 'The list house, finger, eye and stomach contains how many body parts?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (32, 'What is the 2nd digit in 3658990?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (33, 'If the rainjacket is red, what colour is it?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (34, 'Of the numbers fifty nine, 21, 51, fourteen or 6, which is the biggest?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (35, 'The name of Elizabeth is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (36, 'The purple cake is what colour?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (37, 'The 2nd colour in white, ear, pink, red, fruit and brown is?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (38, 'What is the 1st colour in the list butter, red, purple and snake?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (39, 'What is the 3rd digit in 8705374?');
INSERT INTO `captcheck`.`access_questions` (`acqid`, `acqtext`) VALUES (40, 'What is fifty nine thousand five hundred and seven as a number?');
COMMIT;
-- -----------------------------------------------------
-- Data for table `captcheck`.`access_answers`
-- -----------------------------------------------------
START TRANSACTION;
USE `captcheck`;
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (1, 1, 'NULL', 'eccbc87e4b5ce2fe28308fd9f2a7baf3');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (2, 1, 'NULL', '35d6d33467aae9a2e3dccb4b6b027878');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (3, 2, 'NULL', '1ffd9e753c8054cc61456ac7fac1ac89');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (4, 3, 'NULL', 'c4ca4238a0b923820dcc509a6f75849b');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (5, 3, 'NULL', 'f97c5d29941bfb1b2fdab0874906ab82');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (6, 4, 'NULL', '1679091c5a880faf6fb5e6087eb1b2dc');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (7, 4, 'NULL', 'f52b5e449a2303c031a0c3a1109360bf');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (8, 5, 'NULL', '735b90b4568125ed6c3f678819b6e058');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (9, 5, 'NULL', 'bd8c596e0540a2e53362ffd8e83c0af1');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (10, 6, 'NULL', 'c7e1249ffc03eb9ded908c236bd1996d');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (11, 6, 'NULL', 'a3862f91f724b3ba93c0d29d596091aa');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (12, 7, 'NULL', 'c51ce410c124a10e0db5e4b97fc2af39');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (13, 7, 'NULL', '422ecc084f2458defc620ecebf2a6448');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (14, 8, 'NULL', 'aab3238922bcc25a6f606eb525ffdc56');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (15, 8, 'NULL', '279e962ea623aa2a3a86739622772e1f');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (16, 9, 'NULL', '99e8619d83ef705cde096f1413284f9d');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (17, 10, 'NULL', '2c078e4b2c48fa83a11b825008177059');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (18, 11, 'NULL', 'cfcd208495d565ef66e7dff9f98764da');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (19, 11, 'NULL', 'd02c4c4cde7ae76252540d116a40f23a');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (20, 12, 'NULL', '45c48cce2e2d7fbdea1afc51c7c6ad26');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (21, 12, 'NULL', 'c785e1ed2950e3e36b1e2ca01f299a54');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (22, 13, 'NULL', '9f27410725ab8cc8854a2769c7a516b8');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (23, 14, 'NULL', '2a21883121a4da3cb0c12e42bf1ab4f9');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (24, 15, 'NULL', '093f65e080a295f8076b1c5722a46aa2');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (25, 15, 'NULL', '674573a74de9d057c6c5a70819b12f5f');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (26, 16, 'NULL', 'c4ca4238a0b923820dcc509a6f75849b');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (27, 16, 'NULL', 'f97c5d29941bfb1b2fdab0874906ab82');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (28, 17, 'NULL', 'c81e728d9d4c2f636f067f89cc14862c');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (29, 17, 'NULL', 'b8a9f715dbb64fd5c56e7783c6820a61');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (30, 18, 'NULL', '6364d3f0f495b6ab9dcf8d3b5c6e0b01');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (31, 18, 'NULL', '8cb16a6da2f0587a3a2b614040dbd2cf');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (32, 19, 'NULL', '1180362fa4d3626eec0aacebeafbe5fc');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (33, 20, 'NULL', '6512bd43d9caa6e02c990b0a82652dca');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (34, 20, 'NULL', '9c8454ddf7aa50116496bac348d7550d');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (35, 21, 'NULL', '8613985ec49eb8f757ae6439e879bb2a');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (36, 21, 'NULL', '2a08e96cadfba8bfb49c392bd4ec27a7');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (37, 22, 'NULL', '9f27410725ab8cc8854a2769c7a516b8');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (38, 23, 'NULL', '1679091c5a880faf6fb5e6087eb1b2dc');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (39, 23, 'NULL', 'f52b5e449a2303c031a0c3a1109360bf');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (40, 24, 'NULL', '1b4f877baadb44b36ff73a44e05ebd4c');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (41, 25, 'NULL', '4af09080574089cbece43db636e2025f');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (42, 26, 'NULL', '944ba223a5c1b5f4b495708e7cd5ee37');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (43, 26, 'NULL', '197639b278057c519189add5413712e3');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (44, 27, 'NULL', 'c74d97b01eae257e44aa9d5bade97baf');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (45, 27, 'NULL', 'bd2c775d9eaf5f71da52b55ade9989a4');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (46, 28, 'NULL', '3416a75f4cea9109507cacd8e2f2aefc');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (47, 28, 'NULL', '7b6cd20827f5a8a4576ef68f45a4ef32');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (48, 29, 'NULL', 'c81e728d9d4c2f636f067f89cc14862c');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (49, 29, 'NULL', 'b8a9f715dbb64fd5c56e7783c6820a61');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (50, 30, 'NULL', '6ed61d4b80bb0f81937b32418e98adca');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (51, 31, 'NULL', 'eccbc87e4b5ce2fe28308fd9f2a7baf3');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (52, 31, 'NULL', '35d6d33467aae9a2e3dccb4b6b027878');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (53, 32, 'NULL', '1679091c5a880faf6fb5e6087eb1b2dc');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (54, 32, 'NULL', 'f52b5e449a2303c031a0c3a1109360bf');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (55, 33, 'NULL', 'bda9643ac6601722a28f238714274da4');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (56, 34, 'NULL', '093f65e080a295f8076b1c5722a46aa2');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (57, 34, 'NULL', '674573a74de9d057c6c5a70819b12f5f');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (58, 35, 'NULL', '4af09080574089cbece43db636e2025f');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (59, 36, 'NULL', 'bb7aedfa61007447dd6efaf9f37641e3');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (60, 37, 'NULL', '4a0b0dcedd48f780778d1cd1bb8f9877');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (61, 38, 'NULL', 'bda9643ac6601722a28f238714274da4');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (62, 39, 'NULL', 'cfcd208495d565ef66e7dff9f98764da');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (63, 39, 'NULL', 'd02c4c4cde7ae76252540d116a40f23a');
INSERT INTO `captcheck`.`access_answers` (`acaid`, `acqid`, `acatext`, `acahash`) VALUES (64, 40, 'NULL', '454cba7bd267c3f60d982416d06516f6');
COMMIT;

@ -1,26 +0,0 @@
version: "3.6"
services:
web:
build: ./docker-web
restart: always
ports:
- ${EXPOSE_APACHE_WEB_SERVER_ONLY_ON_IP_ADDRESS_COLON}${EXPOSE_APACHE_WEB_SERVER_ON_PORT}:80
volumes:
- .:/var/www/html
environment:
MARIADB_USERNAME: ${MARIADB_USERNAME}
MARIADB_PASSWORD: ${MARIADB_PASSWORD}
MARIADB_HOSTNAME: ${MARIADB_HOSTNAME}
MARIADB_PORT: ${MARIADB_PORT}
MARIADB_DATABASE_NAME: ${MARIADB_DATABASE_NAME}
mariadb:
image: mariadb:10.4
restart: always
volumes:
- ./data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
ports:
- 127.0.0.1:${EXPOSE_MARIADB_ON_PORT}:${MARIADB_PORT}

@ -1,13 +0,0 @@
FROM php:7.2-apache
RUN docker-php-ext-install mysqli pdo pdo_mysql
RUN docker-php-ext-enable mysqli
RUN a2enmod rewrite
RUN apt-get update && apt-get install -y zlib1g-dev libpng-dev libfreetype6-dev
RUN docker-php-ext-configure gd --with-gd --with-zlib-dir --with-png-dir --with-freetype-dir
RUN docker-php-ext-install gd

@ -1,143 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<meta content="width=device-width,initial-scale=1" name=viewport>
<title>Captcheck</title>
<link rel="stylesheet" href="https://static.netsyms.net/bootstrap/4/bootstrap.materia.min.css" />
<link rel="stylesheet" href="https://static.netsyms.net/prism/prism.css" />
<script async src="https://static.netsyms.net/fontawesome/5.2/js/all.min.js"></script>
<script defer async src="https://static.netsyms.net/prism/prism.js"></script>
<style>
h2, h3, p {
text-align: center;
}
pre {
padding-left: 5px;
}
.bg-minty {
background-color: #7dffd2;
}
@media only screen and (min-width: 768px) and (max-width: 991px) {
h2, h3 {
text-align: left;
}
.site-icon {
margin-top: 18px;
}
}
@media only screen and (min-width: 992px) and (max-width: 1199px) {
h2, h3 {
text-align: left;
}
.site-icon {
margin-top: 14px;
}
}
@media only screen and (min-width: 1200px) {
h2, h3 {
text-align: left;
}
.site-icon {
margin-top: 0px;
}
}
</style>
<div class="container">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-12" style="text-align: center;" >
<img src="logo.png" class="site-icon" style="width: 400px; max-width: 100%;" />
</div>
</div>
<p style="font-size: 15px; line-height: 20px;">Open source reCAPTCHA alternative</p>
<div class="d-flex">
<ul class="nav nav-pills mx-auto">
<li class="nav-item">
<span class="nav-link">
<i class="fab fa-php"></i> PHP 7
</span>
</li>
<li class="nav-item">
<span class="nav-link">
<i class="fas fa-database"></i> MySQL
</span>
</li>
<li class="nav-item">
<a class="nav-link" href="https://source.netsyms.com/Netsyms/Captcheck/src/branch/master/LICENSE" style="color: #444;">
<i class="fas fa-file-contract"></i> MIT
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://source.netsyms.com/Netsyms/Captcheck" style="color: #444;">
<i class="fas fa-code-branch"></i> Git
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="row my-4">
<div class="col-12 col-md-6">
<div class="card">
<div class="card-header bg-minty">
<h4 class="card-heading d-flex mb-0"><span class="mr-auto">Demo</span> <a onclick="document.getElementById('demoframe').src = document.getElementById('demoframe').src" title="Reset demo"><i class="fas fa-sync-alt"></i></a></h4>
</div>
<div class="card-body">
<iframe style="border: 0px solid white; width: 100%; height: 100%; height: 350px;" src="test.html" id="demoframe"></iframe>
</div>
</div>
</div>
<div class="col-12 col-md-6">
<div class="card">
<div class="card-header bg-minty">
<h4 class="card-heading mb-0">Use</h4>
</div>
<div class="card-body">
<b>Put this in your page somewhere:</b>
<pre><code class="language-html">&lt;script src="https://captcheck.netsyms.com/captcheck.min.js">&lt;/script></code></pre>
<b>Put this in your form where you want the CAPTCHA:</b>
<pre><code class="language-html">&lt;div class="captcheck_container">&lt;/div></code></pre>
<b>Put this in your server-side form validation (PHP example):</b>
<pre><code class="language-php">
$url = 'https://captcheck.netsyms.com/api.php';
$data = [
'session_id' => $_POST['captcheck_session_code'],
'answer_id' => $_POST['captcheck_selected_answer'],
'action' => "verify"
];
$options = [
'http' => [
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
]
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
$resp = json_decode($result, TRUE);
if (!$resp['result']) {
// Replace with error-handling code
exit("CAPTCHA did not verify:" . $resp['msg']);
} else {
// The CAPTCHA is valid.
exit("CAPTCHA verified!");
}
</code></pre>
<b>If you have a strict Content Security Policy, change your div to this:</b>
<pre><code class="language-html">&lt;div class="captcheck_container" data-stylenonce="your nonce here">&lt;/div></code></pre>
Note: by using this hosted service, you agree to <a href="https://netsyms.com/legal">these terms</a>. If you don't like them, feel free to host Captcheck on your own server.
Popular sites should self-host as well just to be nice.
</div>
</div>
</div>
</div>
<div class="footer"><p>Copyright &copy; 2018 <a href="https://netsyms.com">Netsyms Technologies</a>. MIT License.<br /><a href="https://source.netsyms.com/Netsyms/Captcheck">Get the source</a> and run your own CAPTCHA service.</p></div>
</div>

@ -0,0 +1,2 @@
<?php
header("Location: test.html");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

@ -1,17 +1,15 @@
<img src="https://source.netsyms.com/Netsyms/Captcheck/raw/master/logo.png" alt="Captcheck" style="max-width: 50%;" />
Captcheck
=========
Easy, light, self-hostable CAPTCHA service. Works on all modern browsers and
IE9+. Uses icons from Font-Awesome.
Easy, light, self-hostable CAPTCHA service. Works on modern browsers (and
IE9+). Uses a selection of icons from Font-Awesome. Text-only accessibility
mode and support for keyboard-only operation.
Thanks to textcaptcha.com for supplying the data for the text CAPTCHA.
How to use
----------
In your form, put an empty div with the class "captcheck_container".
Add `captcheck.js` (or `captcheck.min.js`) into your page.
In your form, put an empty div with the ID "captcheck_container".
Add `captcheck.js` into your page.
<!DOCTYPE html>
<html>
@ -24,35 +22,29 @@ Add `captcheck.js` (or `captcheck.min.js`) into your page.
<body>
<form action="submit.php">
<input type="text" name="form_field" placeholder="Some random form field" />
<div class="captcheck_container">
<div id="captcheck_container">
</div>
<button type="submit">Submit Form</button>
</form>
</body>
</html>
When the form is submitted, your server will receive two extra form fields:
When the form is submitted, your server will receive two extra form fields:
`captcheck_session_code` and `captcheck_selected_answer`.
In your form handling code, send a request to `http(s)://captcheck-url/api.php`.
Pass the variables `session_id` and `answer_id` with the values sent with the form,
and also pass the variable `action` with the value `verify`.
You will receive a JSON response with (among other things) `"result": true` or
`"result": false`. If result is false, the user failed the test, and another
In your form handling code, send a request to `http(s)://captcheck-url/api.php`.
Pass the variables `session_id` and `answer_id` with the values sent with the form,
and also pass the variable `action` with the value `verify`.
You will receive a JSON response with (among other things) `"result": true` or
`"result": false`. If result is false, the user failed the test, and another
variable `msg` is available with an explanation.
Example URL:
Example URL:
`http(s)://captcheck-url/api.php?action=verify&session_id=<captcheck_session_code>&answer_id=<captcheck_selected_answer>`
Example responses:
`{"session":"some_session_id","result":true}`
Example responses:
`{"session":"some_session_id","result":true}`
`{"session":"some_session_id","result":false,"msg":"Answer incorrect."}`
### Content-Security-Policy and Nonces
Add `data-stylenonce="nonce_here"` to the `.captcheck_container` div.
If you have multiple CAPTCHAs on one page, only one of them needs the nonce
specified.
Installation
------------
@ -67,13 +59,13 @@ Installation
Execution Flow
--------------
JS = captcheck.js, API = api.php, FORM = parent form,
JS = captcheck.js, API = api.php, FORM = parent form,
SITE = form processing code, -> = some action taken on the right by the left
JS -> API: Request session ID, question, and answers (with scrambled random codes)
API -> JS: Sends info, saves session ID, correct answer, and scrambled answer codes in DB
JS -> API: Requests answer images by sending scrambled value and session ID
JS -> FORM: Adds hidden field with value=session ID, displays question and images (or text box)
JS -> FORM: Adds hidden field with value=session ID, displays question and images
[USER SUBMITS FORM]
SITE -> API: Sends session ID and answer
SITE -> API: Sends session ID and scrambled answer
API -> SITE: Responds with true/false to indicate if the answer is valid, marks session as expired to prevent CAPTCHA reuse

@ -1,33 +0,0 @@
<?php
/**
* A simple script to scrape text CAPTCHAs from an online service.
*
* Set your email address and the number of CAPTCHAs to download.
*
* For security, this script will by default terminate itself, so comment out
* the die() command if you want to use it.
*/
die("Access denied.");
require __DIR__ . '/required.php';
header('Content-Type: text/plain');
$email = "changeme@example.com";
$rows = 20;
$url = "http://api.textcaptcha.com/$email.json";
for ($i = 0; $i < $rows; $i++) {
$data = json_decode(file_get_contents($url), TRUE);
$database->insert('access_questions', ["acqtext" => $data['q']]);
$id = $database->id();
foreach ($data['a'] as $a) {
$database->insert('access_answers', ["acqid" => $id, "acahash" => $a]);
}
echo ".";
ob_flush();
sleep(1);
}
echo "\ndone\n";

@ -1,12 +1,17 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>Captcheck Sample Form</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="captcheck.js"></script>
<form action="test.php" method="POST">
<input type="text" name="form_field" placeholder="Some random form field" />
<div class="captcheck_container">
</div>
<button type="submit">Submit Form</button>
</form>
<html>
<head>
<title>Captcheck Sample Form</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="captcheck.js"></script>
</head>
<body>
<form action="submit.php" method="POST">
<input type="text" name="form_field" placeholder="Some random form field" />
<div id="captcheck_container">
</div>
<button type="submit">Submit Form</button>
</form>
</body>
</html>

@ -2,6 +2,10 @@
header("Content-Type: text/plain");
var_dump($_POST);
$url = 'https://captcheck.netsyms.com/api.php';
$data = [
'session_id' => $_POST['captcheck_session_code'],
@ -18,16 +22,8 @@ $options = [
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
$resp = json_decode($result, TRUE);
echo "Form fields:\n";
var_export($_POST);
echo "\n\nAPI request fields:\n";
var_export($data);
echo "\n\nAPI response (JSON):\n";
echo json_encode(json_decode($result, TRUE), JSON_PRETTY_PRINT);
if (!$resp['result']) {
exit("\n\nCAPTCHA did not verify: " . $resp['msg']);
exit("\n\nCAPTCHA did not verify:" . $resp['msg']);
} else {
exit("\n\nCAPTCHA verified!");
}

Loading…
Cancel
Save