Produce a different error message if the user service does not have the authenticate method available
parent
e67341f24c
commit
f62b5e6cec
|
@ -144,16 +144,25 @@ namespace OpenSim.Region.Communications.OGS1
|
|||
|
||||
public override bool AuthenticateUserByPassword(UUID userID, string password)
|
||||
{
|
||||
try
|
||||
Hashtable param = new Hashtable();
|
||||
param["user_uuid"] = userID.ToString();
|
||||
param["password"] = password;
|
||||
IList parameters = new ArrayList();
|
||||
parameters.Add(param);
|
||||
XmlRpcRequest req = new XmlRpcRequest("authenticate_user_by_password", parameters);
|
||||
XmlRpcResponse resp = req.Send(m_commsManager.NetworkServersInfo.UserURL, 30000);
|
||||
|
||||
// Temporary measure to deal with older services
|
||||
if (resp.IsFault && resp.FaultCode == XmlRpcErrorCodes.SERVER_ERROR_METHOD)
|
||||
//if ((string)respData["fault_code"] != null && (string)respData["fault_code"] ==
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
param["user_uuid"] = userID.ToString();
|
||||
param["password"] = password;
|
||||
IList parameters = new ArrayList();
|
||||
parameters.Add(param);
|
||||
XmlRpcRequest req = new XmlRpcRequest("authenticate_user_by_password", parameters);
|
||||
XmlRpcResponse resp = req.Send(m_commsManager.NetworkServersInfo.UserURL, 30000);
|
||||
Hashtable respData = (Hashtable)resp.Value;
|
||||
throw new Exception(
|
||||
String.Format(
|
||||
"XMLRPC method 'authenticate_user_by_password' not yet implemented by user service at {0}",
|
||||
m_commsManager.NetworkServersInfo.UserURL));
|
||||
}
|
||||
|
||||
Hashtable respData = (Hashtable)resp.Value;
|
||||
|
||||
// foreach (object key in respData.Keys)
|
||||
// {
|
||||
|
@ -164,21 +173,12 @@ namespace OpenSim.Region.Communications.OGS1
|
|||
// "[OGS1 USER SERVICES]: AuthenticatedUserByPassword response for {0} is [{1}]",
|
||||
// userID, respData["auth_user"]);
|
||||
|
||||
if ((string)respData["auth_user"] == "TRUE")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
if ((string)respData["auth_user"] == "TRUE")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[OGS1 USER SERVICES]: Error when trying to authenticate user by password from remote user server: {0}",
|
||||
e);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -333,16 +333,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
return null;
|
||||
}
|
||||
|
||||
if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
|
||||
try
|
||||
{
|
||||
return userInfo;
|
||||
if (m_aScene.CommsManager.UserService.AuthenticateUserByPassword(userInfo.UserProfile.ID, pass))
|
||||
{
|
||||
return userInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
|
||||
firstName, lastName);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[INVENTORY ARCHIVER]: Password for user {0} {1} incorrect. Please try again.",
|
||||
firstName, lastName);
|
||||
|
||||
m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -364,9 +371,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
{
|
||||
foreach (InventoryNodeBase node in loadedNodes)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
|
||||
user.Name, node.Name);
|
||||
// m_log.DebugFormat(
|
||||
// "[INVENTORY ARCHIVER]: Notifying {0} of loaded inventory node {1}",
|
||||
// user.Name, node.Name);
|
||||
|
||||
user.ControllingClient.SendBulkUpdateInventory(node);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue