diff options
author | diva | 2009-04-14 03:00:17 +0000 |
---|---|---|
committer | diva | 2009-04-14 03:00:17 +0000 |
commit | 6204f23230734a81d483f7a2da8d73a37c56a2a6 (patch) | |
tree | 3b0303858f766b618308bacb7f46edd7f85115f0 /OpenSim/Framework/Communications | |
parent | Making OGS1UserServices friendly to subclassing. (diff) | |
download | opensim-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.cs | 24 |
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 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | ||
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using Nwc.XmlRpc; | 31 | using Nwc.XmlRpc; |
31 | using OpenMetaverse; | 32 | using 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 | } |