From 76e74a7667867932ef08c0f402dcfc424fb51b0c Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Sun, 30 Dec 2007 19:40:44 +0000
Subject: Add an extra check that we don't create new inventory folders for a
user that already has a root folder
---
.../Communications/InventoryServiceBase.cs | 26 ++++++++++++++++++----
OpenSim/Framework/Communications/LoginService.cs | 3 ++-
2 files changed, 24 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 098d08e..2f466a3 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -112,8 +112,10 @@ namespace OpenSim.Framework.Communications
}
///
- ///
+ /// Get the root folder for a user
///
+ ///
+ /// null if no root folder was found
public InventoryFolderBase RequestUsersRoot(LLUUID userID)
{
foreach (KeyValuePair plugin in m_plugins)
@@ -204,11 +206,27 @@ namespace OpenSim.Framework.Communications
}
}
+ ///
+ /// Create a new set of inventory folders for the given user.
+ ///
+ ///
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
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index a284910..bef20f7 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -214,7 +214,8 @@ namespace OpenSim.Framework.UserManagement
/// Authenticated?
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$
--
cgit v1.1