Add an extra check that we don't create new inventory folders for a user that already has a root folder
parent
c084c54fb5
commit
76e74a7667
|
@ -112,8 +112,10 @@ namespace OpenSim.Framework.Communications
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Get the root folder for a user
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="userID"></param>
|
||||||
|
/// <returns>null if no root folder was found</returns>
|
||||||
public InventoryFolderBase RequestUsersRoot(LLUUID userID)
|
public InventoryFolderBase RequestUsersRoot(LLUUID userID)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
|
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
|
||||||
|
@ -204,11 +206,27 @@ namespace OpenSim.Framework.Communications
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a new set of inventory folders for the given user.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user"></param>
|
||||||
public void CreateNewUserInventory(LLUUID user)
|
public void CreateNewUserInventory(LLUUID user)
|
||||||
{
|
{
|
||||||
UsersInventory inven = new UsersInventory();
|
InventoryFolderBase existingRootFolder = RequestUsersRoot(user);
|
||||||
inven.CreateNewInventorySet(user);
|
|
||||||
AddNewInventorySet(inven);
|
if (null != existingRootFolder)
|
||||||
|
{
|
||||||
|
MainLog.Instance.Error(
|
||||||
|
"AGENTINVENTORY",
|
||||||
|
"Did not create a new inventory for user {0} since they already have "
|
||||||
|
+ "a root inventory folder with id {1}", user, existingRootFolder);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UsersInventory inven = new UsersInventory();
|
||||||
|
inven.CreateNewInventorySet(user);
|
||||||
|
AddNewInventorySet(inven);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UsersInventory
|
public class UsersInventory
|
||||||
|
|
|
@ -214,7 +214,8 @@ namespace OpenSim.Framework.UserManagement
|
||||||
/// <returns>Authenticated?</returns>
|
/// <returns>Authenticated?</returns>
|
||||||
public virtual bool AuthenticateUser(UserProfileData profile, string password)
|
public virtual bool AuthenticateUser(UserProfileData profile, string password)
|
||||||
{
|
{
|
||||||
MainLog.Instance.Verbose("LOGIN", "Authenticating " + profile.username + " " + profile.surname);
|
MainLog.Instance.Verbose(
|
||||||
|
"LOGIN", "Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID);
|
||||||
|
|
||||||
password = password.Remove(0, 3); //remove $1$
|
password = password.Remove(0, 3); //remove $1$
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue