aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
authordiva2009-04-14 03:00:17 +0000
committerdiva2009-04-14 03:00:17 +0000
commit6204f23230734a81d483f7a2da8d73a37c56a2a6 (patch)
tree3b0303858f766b618308bacb7f46edd7f85115f0 /OpenSim/Framework/Communications
parentMaking OGS1UserServices friendly to subclassing. (diff)
downloadopensim-SC_OLD-6204f23230734a81d483f7a2da8d73a37c56a2a6.zip
opensim-SC_OLD-6204f23230734a81d483f7a2da8d73a37c56a2a6.tar.gz
opensim-SC_OLD-6204f23230734a81d483f7a2da8d73a37c56a2a6.tar.bz2
opensim-SC_OLD-6204f23230734a81d483f7a2da8d73a37c56a2a6.tar.xz
This was needed for the prior commit.
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}