aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2007-12-30 19:40:44 +0000
committerJustin Clarke Casey2007-12-30 19:40:44 +0000
commit76e74a7667867932ef08c0f402dcfc424fb51b0c (patch)
treede5dcfda31943fcf175bcd516bd645d3c95c23f9
parentAdded ScriptEngine.RemoteServer module (diff)
downloadopensim-SC-76e74a7667867932ef08c0f402dcfc424fb51b0c.zip
opensim-SC-76e74a7667867932ef08c0f402dcfc424fb51b0c.tar.gz
opensim-SC-76e74a7667867932ef08c0f402dcfc424fb51b0c.tar.bz2
opensim-SC-76e74a7667867932ef08c0f402dcfc424fb51b0c.tar.xz
Add an extra check that we don't create new inventory folders for a user that already has a root folder
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs26
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs3
2 files changed, 24 insertions, 5 deletions
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
112 } 112 }
113 113
114 /// <summary> 114 /// <summary>
115 /// 115 /// Get the root folder for a user
116 /// </summary> 116 /// </summary>
117 /// <param name="userID"></param>
118 /// <returns>null if no root folder was found</returns>
117 public InventoryFolderBase RequestUsersRoot(LLUUID userID) 119 public InventoryFolderBase RequestUsersRoot(LLUUID userID)
118 { 120 {
119 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) 121 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
@@ -204,11 +206,27 @@ namespace OpenSim.Framework.Communications
204 } 206 }
205 } 207 }
206 208
209 /// <summary>
210 /// Create a new set of inventory folders for the given user.
211 /// </summary>
212 /// <param name="user"></param>
207 public void CreateNewUserInventory(LLUUID user) 213 public void CreateNewUserInventory(LLUUID user)
208 { 214 {
209 UsersInventory inven = new UsersInventory(); 215 InventoryFolderBase existingRootFolder = RequestUsersRoot(user);
210 inven.CreateNewInventorySet(user); 216
211 AddNewInventorySet(inven); 217 if (null != existingRootFolder)
218 {
219 MainLog.Instance.Error(
220 "AGENTINVENTORY",
221 "Did not create a new inventory for user {0} since they already have "
222 + "a root inventory folder with id {1}", user, existingRootFolder);
223 }
224 else
225 {
226 UsersInventory inven = new UsersInventory();
227 inven.CreateNewInventorySet(user);
228 AddNewInventorySet(inven);
229 }
212 } 230 }
213 231
214 public class UsersInventory 232 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
214 /// <returns>Authenticated?</returns> 214 /// <returns>Authenticated?</returns>
215 public virtual bool AuthenticateUser(UserProfileData profile, string password) 215 public virtual bool AuthenticateUser(UserProfileData profile, string password)
216 { 216 {
217 MainLog.Instance.Verbose("LOGIN", "Authenticating " + profile.username + " " + profile.surname); 217 MainLog.Instance.Verbose(
218 "LOGIN", "Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID);
218 219
219 password = password.Remove(0, 3); //remove $1$ 220 password = password.Remove(0, 3); //remove $1$
220 221