aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/CommunicationsManager.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-02-18 15:50:18 +0000
committerJustin Clarke Casey2008-02-18 15:50:18 +0000
commit500d259c252f8c4f75c6f37e1067d57811426ddd (patch)
tree778ae131f7fdb01678f82cf8b94a25992e722390 /OpenSim/Framework/Communications/CommunicationsManager.cs
parenta new attempt at converting to the right types (diff)
downloadopensim-SC_OLD-500d259c252f8c4f75c6f37e1067d57811426ddd.zip
opensim-SC_OLD-500d259c252f8c4f75c6f37e1067d57811426ddd.tar.gz
opensim-SC_OLD-500d259c252f8c4f75c6f37e1067d57811426ddd.tar.bz2
opensim-SC_OLD-500d259c252f8c4f75c6f37e1067d57811426ddd.tar.xz
* Do not allow a user to be created if one with the same name already exists
Diffstat (limited to 'OpenSim/Framework/Communications/CommunicationsManager.cs')
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index eb820c1..4ad808a 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -131,11 +131,27 @@ namespace OpenSim.Framework.Communications
131 regY = Convert.ToUInt32(cmmdParams[5]); 131 regY = Convert.ToUInt32(cmmdParams[5]);
132 } 132 }
133 133
134 AddUser(firstName, lastName, password, regX, regY); 134 if (null == m_userService.GetUserProfile(firstName, lastName))
135 {
136 AddUser(firstName, lastName, password, regX, regY);
137 }
138 else
139 {
140 m_log.ErrorFormat("[USERS]: A user with the name {0} {1} already exists!", firstName, lastName);
141 }
135 break; 142 break;
136 } 143 }
137 } 144 }
138 145
146 /// <summary>
147 /// Persistently adds a user to OpenSim.
148 /// </summary>
149 /// <param name="firstName"></param>
150 /// <param name="lastName"></param>
151 /// <param name="password"></param>
152 /// <param name="regX"></param>
153 /// <param name="regY"></param>
154 /// <returns>The UUID of the added user. Returns null if the add was unsuccessful</returns>
139 public LLUUID AddUser(string firstName, string lastName, string password, uint regX, uint regY) 155 public LLUUID AddUser(string firstName, string lastName, string password, uint regX, uint regY)
140 { 156 {
141 string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); 157 string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty);
@@ -149,7 +165,7 @@ namespace OpenSim.Framework.Communications
149 else 165 else
150 { 166 {
151 m_inventoryService.CreateNewUserInventory(userProf.UUID); 167 m_inventoryService.CreateNewUserInventory(userProf.UUID);
152 System.Console.WriteLine("Created new inventory set for " + firstName + " " + lastName); 168 System.Console.WriteLine("[USERS]: Created new inventory set for " + firstName + " " + lastName);
153 return userProf.UUID; 169 return userProf.UUID;
154 } 170 }
155 } 171 }