]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/infrastructure/php/d0_blind_id_test.php
the test case script
[xonotic/xonotic.git] / misc / infrastructure / php / d0_blind_id_test.php
diff --git a/misc/infrastructure/php/d0_blind_id_test.php b/misc/infrastructure/php/d0_blind_id_test.php
new file mode 100644 (file)
index 0000000..9d233d1
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+require("d0_blind_id.inc");
+$d0_blind_id_keygen = "/opt/d0_blind_id/bin/crypto-keygen-standalone";
+
+// read raw POST data
+list($status, $idfp) = d0_blind_id_verify();
+$version = $_GET["version"];
+$postdata = $_POST["foo"];
+
+// log access
+$ip = $_SERVER["REMOTE_ADDR"];
+if($idfp)
+       syslog(LOG_NOTICE, "update notification was called by $idfp ($status, $postdata) at $ip for version $version");
+else if($version)
+       syslog(LOG_NOTICE, "update notification was called by an unknown user at $ip for version $version");
+else
+       syslog(LOG_NOTICE, "update notification was called by an unknown user at $ip");
+
+header("Content-type: text/plain");
+echo "0\n";
+echo "file:///dev/null\n";
+
+?>