aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2009-09-24 15:19:47 +0100
committerJustin Clark-Casey (justincc)2009-09-24 15:19:47 +0100
commitf62b5e6cec31fe496ec4b9f7dcd6ae1f4063bead (patch)
tree2a66b92715f0faa4e624cbfcef0db24b8feb795e
parentminor: replace xmlprc 'no method found' magic number with constant from xmlrp... (diff)
downloadopensim-SC_OLD-f62b5e6cec31fe496ec4b9f7dcd6ae1f4063bead.zip
opensim-SC_OLD-f62b5e6cec31fe496ec4b9f7dcd6ae1f4063bead.tar.gz
opensim-SC_OLD-f62b5e6cec31fe496ec4b9f7dcd6ae1f4063bead.tar.bz2
opensim-SC_OLD-f62b5e6cec31fe496ec4b9f7dcd6ae1f4063bead.tar.xz
Produce a different error message if the user service does not have the authenticate method available
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs46
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs29
2 files changed, 41 insertions, 34 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index 89b3e42..a55b62e 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -144,16 +144,25 @@ namespace OpenSim.Region.Communications.OGS1
144 144
145 public override bool AuthenticateUserByPassword(UUID userID, string password) 145 public override bool AuthenticateUserByPassword(UUID userID, string password)
146 { 146 {
147 try 147 Hashtable param = new Hashtable();
148 param["user_uuid"] = userID.ToString();
149 param["password"] = password;
150 IList parameters = new ArrayList();
151 parameters.Add(param);
152 XmlRpcRequest req = new XmlRpcRequest("authenticate_user_by_password", parameters);
153 XmlRpcResponse resp = req.Send(m_commsManager.NetworkServersInfo.UserURL, 30000);
154
155 // Temporary measure to deal with older services
156 if (resp.IsFault && resp.FaultCode == XmlRpcErrorCodes.SERVER_ERROR_METHOD)
157 //if ((string)respData["fault_code"] != null && (string)respData["fault_code"] ==
148 { 158 {
149 Hashtable param = new Hashtable(); 159 throw new Exception(
150 param["user_uuid"] = userID.ToString(); 160 String.Format(
151 param["password"] = password; 161 "XMLRPC method 'authenticate_user_by_password' not yet implemented by user service at {0}",
152 IList parameters = new ArrayList(); 162 m_commsManager.NetworkServersInfo.UserURL));
153 parameters.Add(param); 163 }
154 XmlRpcRequest req = new XmlRpcRequest("authenticate_user_by_password", parameters); 164
155 XmlRpcResponse resp = req.Send(m_commsManager.NetworkServersInfo.UserURL, 30000); 165 Hashtable respData = (Hashtable)resp.Value;
156 Hashtable respData = (Hashtable)resp.Value;
157 166
158// foreach (object key in respData.Keys) 167// foreach (object key in respData.Keys)
159// { 168// {
@@ -164,23 +173,14 @@ namespace OpenSim.Region.Communications.OGS1
164// "[OGS1 USER SERVICES]: AuthenticatedUserByPassword response for {0} is [{1}]", 173// "[OGS1 USER SERVICES]: AuthenticatedUserByPassword response for {0} is [{1}]",
165// userID, respData["auth_user"]); 174// userID, respData["auth_user"]);
166 175
167 if ((string)respData["auth_user"] == "TRUE") 176 if ((string)respData["auth_user"] == "TRUE")
168 { 177 {
169 return true; 178 return true;
170 }
171 else
172 {
173 return false;
174 }
175 } 179 }
176 catch (Exception e) 180 else
177 { 181 {
178 m_log.ErrorFormat(
179 "[OGS1 USER SERVICES]: Error when trying to authenticate user by password from remote user server: {0}",
180 e);
181
182 return false; 182 return false;
183 } 183 }
184 } 184 }
185 } 185 }
186} \ No newline at end of file 186} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index b82b940..55dce05 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -333,16 +333,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
333 return null; 333 return null;
334 } 334 }
335 335
336 if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass)) 336 try
337 { 337 {
338 return userInfo; 338 if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
339 {
340 return userInfo;
341 }
342 else
343 {
344 m_log.ErrorFormat(
345 "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
346 firstName, lastName);
347 return null;
348 }
339 } 349 }
340 else 350 catch (Exception e)
341 { 351 {
342 m_log.ErrorFormat( 352 m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message);
343 "[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
344 firstName, lastName);
345
346 return null; 353 return null;
347 } 354 }
348 } 355 }
@@ -364,9 +371,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
364 { 371 {
365 foreach (InventoryNodeBase node in loadedNodes) 372 foreach (InventoryNodeBase node in loadedNodes)
366 { 373 {
367 m_log.DebugFormat( 374// m_log.DebugFormat(
368 "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}", 375// "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
369 user.Name, node.Name); 376// user.Name, node.Name);
370 377
371 user.ControllingClient.SendBulkUpdateInventory(node); 378 user.ControllingClient.SendBulkUpdateInventory(node);
372 } 379 }