From 6204f23230734a81d483f7a2da8d73a37c56a2a6 Mon Sep 17 00:00:00 2001 From: diva Date: Tue, 14 Apr 2009 03:00:17 +0000 Subject: This was needed for the prior commit. --- .../Framework/Communications/Clients/AuthClient.cs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Communications/Clients/AuthClient.cs b/OpenSim/Framework/Communications/Clients/AuthClient.cs index 39a886c..6111aee 100644 --- a/OpenSim/Framework/Communications/Clients/AuthClient.cs +++ b/OpenSim/Framework/Communications/Clients/AuthClient.cs @@ -26,6 +26,7 @@ */ using System; +using System.Collections; using System.Collections.Generic; using Nwc.XmlRpc; using OpenMetaverse; @@ -114,5 +115,28 @@ namespace OpenSim.Framework.Communications.Clients return false; } } + + public static bool VerifySession(string authurl, UUID userID, UUID sessionID) + { + Hashtable requestData = new Hashtable(); + requestData["avatar_uuid"] = userID.ToString(); + requestData["session_id"] = sessionID.ToString(); + ArrayList SendParams = new ArrayList(); + SendParams.Add(requestData); + XmlRpcRequest UserReq = new XmlRpcRequest("check_auth_session", SendParams); + XmlRpcResponse UserResp = UserReq.Send(authurl, 3000); + + Hashtable responseData = (Hashtable)UserResp.Value; + if (responseData.ContainsKey("auth_session") && responseData["auth_session"].ToString() == "TRUE") + { + System.Console.WriteLine("[Authorization]: userserver reported authorized session for user " + userID); + return true; + } + else + { + System.Console.WriteLine("[Authorization]: userserver reported unauthorized session for user " + userID); + return false; + } + } } } -- cgit v1.1