aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r--OpenSim/Framework/Communications/Clients/AuthClient.cs24
1 files changed, 24 insertions, 0 deletions
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 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using Nwc.XmlRpc; 31using Nwc.XmlRpc;
31using OpenMetaverse; 32using OpenMetaverse;
@@ -114,5 +115,28 @@ namespace OpenSim.Framework.Communications.Clients
114 return false; 115 return false;
115 } 116 }
116 } 117 }
118
119 public static bool VerifySession(string authurl, UUID userID, UUID sessionID)
120 {
121 Hashtable requestData = new Hashtable();
122 requestData["avatar_uuid"] = userID.ToString();
123 requestData["session_id"] = sessionID.ToString();
124 ArrayList SendParams = new ArrayList();
125 SendParams.Add(requestData);
126 XmlRpcRequest UserReq = new XmlRpcRequest("check_auth_session", SendParams);
127 XmlRpcResponse UserResp = UserReq.Send(authurl, 3000);
128
129 Hashtable responseData = (Hashtable)UserResp.Value;
130 if (responseData.ContainsKey("auth_session") && responseData["auth_session"].ToString() == "TRUE")
131 {
132 System.Console.WriteLine("[Authorization]: userserver reported authorized session for user " + userID);
133 return true;
134 }
135 else
136 {
137 System.Console.WriteLine("[Authorization]: userserver reported unauthorized session for user " + userID);
138 return false;
139 }
140 }
117 } 141 }
118} 142}