Commit bfd94902 authored by Feu's avatar Feu

test ml

parent bf467df3
...@@ -6,12 +6,18 @@ require_once($topdir. "include/mysqlae.inc.php"); ...@@ -6,12 +6,18 @@ require_once($topdir. "include/mysqlae.inc.php");
if ( $_SERVER["REMOTE_ADDR"] != "127.0.1.1" ) if ( $_SERVER["REMOTE_ADDR"] != "127.0.1.1" )
{ {
echo "ERROR: HTTPS REQUIRED"; echo "ERROR HTTPS REQUIRED";
exit(); exit();
} }
$db = new mysqlae ("rw"); $db = new mysqlae ("rw");
if ( !$db->dbh )
{
echo "ERROR DB UNAVAILABLE";
exit();
}
$valid = new requete($db, $valid = new requete($db,
"SELECT `key` ". "SELECT `key` ".
"FROM `sso_api_keys` ". "FROM `sso_api_keys` ".
...@@ -19,15 +25,26 @@ $valid = new requete($db, ...@@ -19,15 +25,26 @@ $valid = new requete($db,
if ( $valid->lines != 1 ) if ( $valid->lines != 1 )
{ {
echo "ERROR: KEY NOT VALID\n"; echo "ERROR KEY NOT VALID\n";
exit(); exit();
} }
if ( isset($_REQUEST["done"]) ) if ( isset($_REQUEST["done"]) )
{ {
$num = intval($_REQUEST["done"]); $num = intval($_REQUEST["done"]);
new requete($db,"DELETE FROM ml_todo WHERE num_todo <= $num");
echo "ACK ".$num; $req = new requete($db,"SELECT num_todo FROM num_todo <= $num ORDER BY num_todo DESC LIMIT 1");
if ($req->lines!= 1 )
{
echo "ERROR ACK NONE";
}
else
{
list($real) = $req->get_row();
new requete($db,"DELETE FROM ml_todo WHERE num_todo <= $num");
echo "ACK ".$real;
}
exit(); exit();
} }
......
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