X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=blobdiff_plain;f=authserver%2Flib%2FauthClient.php;h=ba6c2ff83c0cf0bb4984ffaed6602bc8e5eb74e9;hp=735c8a1dcd3c372cb5471c7e2caf96fc692623a8;hb=2d6b0d3ff36c0e388ea51163cb2ebee072a03dab;hpb=491639811383704f32a0e5614e6d62fea2105878 diff --git a/authserver/lib/authClient.php b/authserver/lib/authClient.php index 735c8a1..ba6c2ff 100644 --- a/authserver/lib/authClient.php +++ b/authserver/lib/authClient.php @@ -30,6 +30,29 @@ class GAAuthClient { } + function getUserTokenType($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_TOKEN_TYPE, $message, true, true, $msg_err); + + msg_receive($cl_queue, 0, $msg_type, 16384, $msg); + return $msg; + } + function setUserToken($username, $token) { global $MSG_QUEUE_KEY_ID_SERVER, $MSG_QUEUE_KEY_ID_CLIENT;