X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=blobdiff_plain;f=authserver%2Flib%2FauthClient.php;h=58de4ec023c8e407d7b501a71be2f8363653bfe4;hp=a29af89bddead7d2d01ceb12a0964a93a95ad70a;hb=34cbcba6d0f7c0a92c849545712cc5ce7ec03f97;hpb=07e42724b584df5d317a72b0e0ed1bafbc744b8f diff --git a/authserver/lib/authClient.php b/authserver/lib/authClient.php index a29af89..58de4ec 100644 --- a/authserver/lib/authClient.php +++ b/authserver/lib/authClient.php @@ -55,6 +55,31 @@ class GAAuthClient { return $msg; } + function getOtkPng($username) { + global $MSG_QUEUE_KEY_ID_SERVER, $MSG_QUEUE_KEY_ID_CLIENT; + + + if(!msg_queue_exists($MSG_QUEUE_KEY_ID_SERVER)) { + return false; + } + + if(!msg_queue_exists($MSG_QUEUE_KEY_ID_CLIENT)) { + return false; + } + // TODO we need to setup a client queue sem lock here + + $cl_queue = msg_get_queue($MSG_QUEUE_KEY_ID_CLIENT); + $sr_queue = msg_get_queue($MSG_QUEUE_KEY_ID_SERVER); + + $message["username"] = $username; + msg_send($sr_queue, MSG_GET_OTK_PNG, $message, true, true, $msg_err); + + msg_receive($cl_queue, 0, $msg_type, 16384, $msg); + + return $msg; + + } + function authUserPass($username, $password) { global $MSG_QUEUE_KEY_ID_SERVER, $MSG_QUEUE_KEY_ID_CLIENT;