diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | 61 |
1 files changed, 37 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 88ed763..0d94baa 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -164,7 +164,11 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
164 | AddUser(sog.RootPart.CreatorID, sog.RootPart.CreatorData); | 164 | AddUser(sog.RootPart.CreatorID, sog.RootPart.CreatorData); |
165 | 165 | ||
166 | foreach (SceneObjectPart sop in sog.Parts) | 166 | foreach (SceneObjectPart sop in sog.Parts) |
167 | { | ||
167 | AddUser(sop.CreatorID, sop.CreatorData); | 168 | AddUser(sop.CreatorID, sop.CreatorData); |
169 | foreach (TaskInventoryItem item in sop.TaskInventory.Values) | ||
170 | AddUser(item.CreatorID, item.CreatorData); | ||
171 | } | ||
168 | } | 172 | } |
169 | 173 | ||
170 | 174 | ||
@@ -226,40 +230,49 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
226 | UserData user = new UserData(); | 230 | UserData user = new UserData(); |
227 | user.Id = id; | 231 | user.Id = id; |
228 | 232 | ||
229 | if (creatorData != null && creatorData != string.Empty) | 233 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id); |
230 | { | ||
231 | //creatorData = <endpoint>;<name> | ||
232 | 234 | ||
233 | string[] parts = creatorData.Split(';'); | 235 | if (account != null) |
234 | if (parts.Length >= 1) | ||
235 | { | ||
236 | user.ProfileURL = parts[0]; | ||
237 | try | ||
238 | { | ||
239 | Uri uri = new Uri(parts[0]); | ||
240 | user.LastName = "@" + uri.Authority; | ||
241 | } | ||
242 | catch | ||
243 | { | ||
244 | m_log.DebugFormat("[SCENE]: Unable to parse Uri {0}", parts[0]); | ||
245 | user.LastName = "@unknown"; | ||
246 | } | ||
247 | } | ||
248 | if (parts.Length >= 2) | ||
249 | user.FirstName = parts[1].Replace(' ', '.'); | ||
250 | } | ||
251 | else | ||
252 | { | 236 | { |
253 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id); | ||
254 | user.FirstName = account.FirstName; | 237 | user.FirstName = account.FirstName; |
255 | user.LastName = account.LastName; | 238 | user.LastName = account.LastName; |
256 | // user.ProfileURL = we should initialize this to the default | 239 | // user.ProfileURL = we should initialize this to the default |
257 | } | 240 | } |
241 | else | ||
242 | { | ||
243 | if (creatorData != null && creatorData != string.Empty) | ||
244 | { | ||
245 | //creatorData = <endpoint>;<name> | ||
246 | |||
247 | string[] parts = creatorData.Split(';'); | ||
248 | if (parts.Length >= 1) | ||
249 | { | ||
250 | user.ProfileURL = parts[0]; | ||
251 | try | ||
252 | { | ||
253 | Uri uri = new Uri(parts[0]); | ||
254 | user.LastName = "@" + uri.Authority; | ||
255 | } | ||
256 | catch | ||
257 | { | ||
258 | m_log.DebugFormat("[SCENE]: Unable to parse Uri {0}", parts[0]); | ||
259 | user.LastName = "@unknown"; | ||
260 | } | ||
261 | } | ||
262 | if (parts.Length >= 2) | ||
263 | user.FirstName = parts[1].Replace(' ', '.'); | ||
264 | } | ||
265 | else | ||
266 | { | ||
267 | user.FirstName = "Unknown"; | ||
268 | user.LastName = "User"; | ||
269 | } | ||
270 | } | ||
258 | 271 | ||
259 | lock (m_UserCache) | 272 | lock (m_UserCache) |
260 | m_UserCache[id] = user; | 273 | m_UserCache[id] = user; |
261 | 274 | ||
262 | //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); | 275 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); |
263 | } | 276 | } |
264 | 277 | ||
265 | //public void AddUser(UUID uuid, string userData) | 278 | //public void AddUser(UUID uuid, string userData) |