Add an extra check that we don't create new inventory folders for a user that already has a root folder

afrisby
Justin Clarke Casey 2007-12-30 19:40:44 +00:00
parent c084c54fb5
commit 76e74a7667
2 changed files with 24 additions and 5 deletions

View File

@ -112,8 +112,10 @@ namespace OpenSim.Framework.Communications
}
/// <summary>
///
/// Get the root folder for a user
/// </summary>
/// <param name="userID"></param>
/// <returns>null if no root folder was found</returns>
public InventoryFolderBase RequestUsersRoot(LLUUID userID)
{
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)
{
UsersInventory inven = new UsersInventory();
inven.CreateNewInventorySet(user);
AddNewInventorySet(inven);
InventoryFolderBase existingRootFolder = RequestUsersRoot(user);
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

View File

@ -214,7 +214,8 @@ namespace OpenSim.Framework.UserManagement
/// <returns>Authenticated?</returns>
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$