X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=blobdiff_plain;f=authserver%2Flib%2FauthClient.php;h=c5ef6dd15eaba37eb583367e6558ccf72d4eff92;hp=62419bd6a650db35d43076bdee89f2b6eab3e9ab;hb=d4590a3f34021216c9da29786922fddaf804d113;hpb=1438f7f5c47f3f5c55bc8e13aa566530840e0310 diff --git a/authserver/lib/authClient.php b/authserver/lib/authClient.php index 62419bd..c5ef6dd 100644 --- a/authserver/lib/authClient.php +++ b/authserver/lib/authClient.php @@ -233,6 +233,33 @@ class GAAuthClient { return $msg; } + function deleteUserToken($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_DELETE_USER_TOKEN, $message, true, true, $msg_err); + + msg_receive($cl_queue, 0, $msg_type, 16384, $msg); + + return $msg; + } + function addUser($username, $tokentype="", $hexkey="") { global $MSG_QUEUE_KEY_ID_SERVER, $MSG_QUEUE_KEY_ID_CLIENT;