aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer.Modules/UserManager.cs
diff options
context:
space:
mode:
authorMelanie2009-10-02 08:23:38 +0100
committerMelanie2009-10-02 08:23:38 +0100
commit31d8cec0f8cd47ff445edc7771e5e73825a57927 (patch)
treea2d60604317739fa530502c40ffc71bab2a5c494 /OpenSim/Grid/UserServer.Modules/UserManager.cs
parentRestore the missing image handling to the image manager. The missing (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-31d8cec0f8cd47ff445edc7771e5e73825a57927.zip
opensim-SC_OLD-31d8cec0f8cd47ff445edc7771e5e73825a57927.tar.gz
opensim-SC_OLD-31d8cec0f8cd47ff445edc7771e5e73825a57927.tar.bz2
opensim-SC_OLD-31d8cec0f8cd47ff445edc7771e5e73825a57927.tar.xz
Merge branch 'master' into diva-textures
Diffstat (limited to 'OpenSim/Grid/UserServer.Modules/UserManager.cs')
-rw-r--r--OpenSim/Grid/UserServer.Modules/UserManager.cs56
1 files changed, 55 insertions, 1 deletions
diff --git a/OpenSim/Grid/UserServer.Modules/UserManager.cs b/OpenSim/Grid/UserServer.Modules/UserManager.cs
index 002f232..36c6297 100644
--- a/OpenSim/Grid/UserServer.Modules/UserManager.cs
+++ b/OpenSim/Grid/UserServer.Modules/UserManager.cs
@@ -108,6 +108,9 @@ namespace OpenSim.Grid.UserServer.Modules
108 m_httpServer.AddXmlRPCHandler("get_user_by_uuid", XmlRPCGetUserMethodUUID); 108 m_httpServer.AddXmlRPCHandler("get_user_by_uuid", XmlRPCGetUserMethodUUID);
109 m_httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", XmlRPCGetAvatarPickerAvatar); 109 m_httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", XmlRPCGetAvatarPickerAvatar);
110 110
111 // Used by IAR module to do password checks
112 m_httpServer.AddXmlRPCHandler("authenticate_user_by_password", XmlRPCAuthenticateUserMethodPassword);
113
111 m_httpServer.AddXmlRPCHandler("update_user_current_region", XmlRPCAtRegion); 114 m_httpServer.AddXmlRPCHandler("update_user_current_region", XmlRPCAtRegion);
112 m_httpServer.AddXmlRPCHandler("logout_of_simulator", XmlRPCLogOffUserMethodUUID); 115 m_httpServer.AddXmlRPCHandler("logout_of_simulator", XmlRPCLogOffUserMethodUUID);
113 m_httpServer.AddXmlRPCHandler("get_agent_by_uuid", XmlRPCGetAgentMethodUUID); 116 m_httpServer.AddXmlRPCHandler("get_agent_by_uuid", XmlRPCGetAgentMethodUUID);
@@ -203,6 +206,57 @@ namespace OpenSim.Grid.UserServer.Modules
203 206
204 #region XMLRPC User Methods 207 #region XMLRPC User Methods
205 208
209 /// <summary>
210 /// Authenticate a user using their password
211 /// </summary>
212 /// <param name="request">Must contain values for "user_uuid" and "password" keys</param>
213 /// <param name="remoteClient"></param>
214 /// <returns></returns>
215 public XmlRpcResponse XmlRPCAuthenticateUserMethodPassword(XmlRpcRequest request, IPEndPoint remoteClient)
216 {
217// m_log.DebugFormat("[USER MANAGER]: Received authenticated user by password request from {0}", remoteClient);
218
219 Hashtable requestData = (Hashtable)request.Params[0];
220 string userUuidRaw = (string)requestData["user_uuid"];
221 string password = (string)requestData["password"];
222
223 if (null == userUuidRaw)
224 return Util.CreateUnknownUserErrorResponse();
225
226 UUID userUuid;
227 if (!UUID.TryParse(userUuidRaw, out userUuid))
228 return Util.CreateUnknownUserErrorResponse();
229
230 UserProfileData userProfile = m_userDataBaseService.GetUserProfile(userUuid);
231 if (null == userProfile)
232 return Util.CreateUnknownUserErrorResponse();
233
234 string authed;
235
236 if (null == password)
237 {
238 authed = "FALSE";
239 }
240 else
241 {
242 if (m_userDataBaseService.AuthenticateUserByPassword(userUuid, password))
243 authed = "TRUE";
244 else
245 authed = "FALSE";
246 }
247
248// m_log.DebugFormat(
249// "[USER MANAGER]: Authentication by password result from {0} for {1} is {2}",
250// remoteClient, userUuid, authed);
251
252 XmlRpcResponse response = new XmlRpcResponse();
253 Hashtable responseData = new Hashtable();
254 responseData["auth_user"] = authed;
255 response.Value = responseData;
256
257 return response;
258 }
259
206 public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request, IPEndPoint remoteClient) 260 public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request, IPEndPoint remoteClient)
207 { 261 {
208 // XmlRpcResponse response = new XmlRpcResponse(); 262 // XmlRpcResponse response = new XmlRpcResponse();
@@ -246,10 +300,10 @@ namespace OpenSim.Grid.UserServer.Modules
246 m_userDataBaseService.CommitAgent(ref userProfile); 300 m_userDataBaseService.CommitAgent(ref userProfile);
247 //setUserProfile(userProfile); 301 //setUserProfile(userProfile);
248 302
249
250 returnstring = "TRUE"; 303 returnstring = "TRUE";
251 } 304 }
252 } 305 }
306
253 responseData.Add("returnString", returnstring); 307 responseData.Add("returnString", returnstring);
254 response.Value = responseData; 308 response.Value = responseData;
255 return response; 309 return response;