X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=blobdiff_plain;f=authserver%2Fauthd%2Fauthd.php;h=3f723e59ab546a20939c46d62ff73f4bd4dc5981;hp=3a52041300055545c97062ecb0ea632c9aa4b6a1;hb=e2e22b45b14cae630587bc662a8bfcda98b04510;hpb=0938694abe67f09a9a21f922a3178a6be9e59e63 diff --git a/authserver/authd/authd.php b/authserver/authd/authd.php index 3a52041..3f723e5 100644 --- a/authserver/authd/authd.php +++ b/authserver/authd/authd.php @@ -50,27 +50,28 @@ if($pid == -1) { break; case MSG_GET_OTK_PNG: - if(!isset($msg["username"])) { + if(!isset($msg["otk"])) { msg_send($cl_queue, MSG_GET_OTK_PNG, false); } else { - $username = $msg["username"]; - $sql = "select users_otk from users where users_username='$username'"; + $otk = $msg["otk"]; + $sql = "select users_username from users where users_otk='$otk'"; $dbo = getDatabase(); $res = $dbo->query($sql); - $otk = ""; + $username = ""; foreach($res as $row) { - $otk = $row["users_otk"]; + $username = $row["users_username"]; } - if($otk == "") { + if($username == "") { msg_send($cl_queue, MSG_GET_OTK_PNG, false); } else { $hand = fopen("otks/$otk.png", "rb"); $data = fread($hand, filesize("otks/$otk.png")); fclose($hand); - unlink("otks/$otk.png"); - $sql = "update users set users_otk='' where users_username='$username'"; - $dbo->query($sql); + //unlink("otks/$otk.png"); + //$sql = "update users set users_otk='' where users_username='$username'"; + //$dbo->query($sql); + error_log("senting otk, fsize: ".filesize("otks/$otk.png")." $otk "); msg_send($cl_queue, MSG_GET_OTK_PNG, $data); } }