From 500d259c252f8c4f75c6f37e1067d57811426ddd Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 18 Feb 2008 15:50:18 +0000 Subject: * Do not allow a user to be created if one with the same name already exists --- OpenSim/Grid/UserServer/Main.cs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 8c05d86..3500665 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -148,6 +148,12 @@ namespace OpenSim.Grid.UserServer regX = Convert.ToUInt32(m_console.CmdPrompt("Start Region X")); regY = Convert.ToUInt32(m_console.CmdPrompt("Start Region Y")); + if (null != m_userManager.GetUserProfile(tempfirstname, templastname)) + { + m_log.ErrorFormat("[USERS]: A user with the name {0} {1} already exists!", tempfirstname, templastname); + break; + } + tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); LLUUID userID = new LLUUID(); @@ -157,7 +163,7 @@ namespace OpenSim.Grid.UserServer m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); } catch (Exception ex) { - m_log.ErrorFormat("[SERVER]: Error creating user: {0}", ex.ToString()); + m_log.ErrorFormat("[USERS]: Error creating user: {0}", ex.ToString()); } try @@ -167,7 +173,7 @@ namespace OpenSim.Grid.UserServer } catch (Exception ex) { - m_log.ErrorFormat("[SERVER]: Error creating inventory for user: {0}", ex.ToString()); + m_log.ErrorFormat("[USERS]: Error creating inventory for user: {0}", ex.ToString()); } m_lastCreatedUser = userID; break; @@ -204,13 +210,12 @@ namespace OpenSim.Grid.UserServer // RestObjectPosterResponse> requester = new RestObjectPosterResponse>(); // requester.ReturnResponseVal = TestResponse; // requester.BeginPostObject(m_userManager._config.InventoryUrl + "RootFolders/", m_lastCreatedUser); - List folders = - SynchronousRestObjectPoster.BeginPostObject>("POST", - m_userManager. - _config. - InventoryUrl + - "RootFolders/", - m_lastCreatedUser); + SynchronousRestObjectPoster.BeginPostObject>("POST", + m_userManager. + _config. + InventoryUrl + + "RootFolders/", + m_lastCreatedUser); break; } } -- cgit v1.1