X-Git-Url: http://git.pjr.cc/?a=blobdiff_plain;f=authserver%2Fauthd%2Fauthd.php;h=3f723e59ab546a20939c46d62ff73f4bd4dc5981;hb=e2e22b45b14cae630587bc662a8bfcda98b04510;hp=bd102671f08be372522e883e8dc04d7f7de3a6c3;hpb=34cbcba6d0f7c0a92c849545712cc5ce7ec03f97;p=ga4php.git diff --git a/authserver/authd/authd.php b/authserver/authd/authd.php index bd10267..3f723e5 100644 --- a/authserver/authd/authd.php +++ b/authserver/authd/authd.php @@ -1,5 +1,7 @@ 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); + error_log("senting otk, fsize: ".filesize("otks/$otk.png")." $otk "); msg_send($cl_queue, MSG_GET_OTK_PNG, $data); - unlink("otks/$otk.png"); - $sql = "update users set users_otk='' where users_username='$username'"; - $dbo->query($sql); } } @@ -155,23 +155,29 @@ if($pid == -1) { break; case MSG_SET_USER_PASSWORD: - echo "Call to set user pass\n"; + echo "how on earth is that happening Call to set user pass, wtf?\n"; // TODO + print_r($msg); if(!isset($msg["username"])) { msg_send($cl_queue, MSG_SET_USER_PASSWORD, false); + echo "in break 1\n"; break; } if(!isset($msg["password"])) { msg_send($cl_queue, MSG_SET_USER_PASSWORD, false); + echo "in break 1\n"; break; } $username = $msg["username"]; $password = $msg["password"]; - $pass = hash('sha512', $password); + echo "would set pass for $username, to $password\n"; + if($password == "") $pass = ""; + else $pass = hash('sha512', $password); $dbo = getDatabase(); + echo "in set user pass for $username, $pass\n"; $sql = "update users set users_password='$pass' where users_username='$username'"; $dbo->query($sql); @@ -267,6 +273,12 @@ if($pid == -1) { } else { $users[$i]["hastoken"] = false; } + + if($row["users_otk"]!="") { + $users[$i]["otk"] = $row["users_otk"]; + } else { + $users[$i]["otk"] = ""; + } $i++; } msg_send($cl_queue, MSG_GET_USERS, $users);