aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/UserAccountService/UserAccountService.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-05-28 21:14:15 +0100
committerJustin Clark-Casey (justincc)2010-05-28 21:14:15 +0100
commit505cb82dee27fc1b681fd7c4b6f904ef18315995 (patch)
tree1499973e425cd2ef08d8e7227e8efa511a03e955 /OpenSim/Services/UserAccountService/UserAccountService.cs
parentIf a command has descriptive help, add a line above and below the print out f... (diff)
downloadopensim-SC-505cb82dee27fc1b681fd7c4b6f904ef18315995.zip
opensim-SC-505cb82dee27fc1b681fd7c4b6f904ef18315995.tar.gz
opensim-SC-505cb82dee27fc1b681fd7c4b6f904ef18315995.tar.bz2
opensim-SC-505cb82dee27fc1b681fd7c4b6f904ef18315995.tar.xz
fission UserAccountService.HandleCreateUser() into two methods, one which handles user command parsing and another which actually does the work
Diffstat (limited to 'OpenSim/Services/UserAccountService/UserAccountService.cs')
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs18
1 files changed, 14 insertions, 4 deletions
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index 6923293..3f1744d 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -277,8 +277,9 @@ namespace OpenSim.Services.UserAccountService
277 #endregion 277 #endregion
278 278
279 #region Console commands 279 #region Console commands
280
280 /// <summary> 281 /// <summary>
281 /// Create a new user 282 /// Handle the create user command from the console.
282 /// </summary> 283 /// </summary>
283 /// <param name="cmdparams">string array with parameters: firstname, lastname, password, locationX, locationY, email</param> 284 /// <param name="cmdparams">string array with parameters: firstname, lastname, password, locationX, locationY, email</param>
284 protected void HandleCreateUser(string module, string[] cmdparams) 285 protected void HandleCreateUser(string module, string[] cmdparams)
@@ -304,6 +305,18 @@ namespace OpenSim.Services.UserAccountService
304 email = MainConsole.Instance.CmdPrompt("Email", ""); 305 email = MainConsole.Instance.CmdPrompt("Email", "");
305 else email = cmdparams[5]; 306 else email = cmdparams[5];
306 307
308 CreateUser(firstName, lastName, password, email);
309 }
310
311 /// <summary>
312 /// Create a user
313 /// </summary>
314 /// <param name="firstName"></param>
315 /// <param name="lastName"></param>
316 /// <param name="password"></param>
317 /// <param name="email"></param>
318 public void CreateUser(string firstName, string lastName, string password, string email)
319 {
307 UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); 320 UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName);
308 if (null == account) 321 if (null == account)
309 { 322 {
@@ -338,7 +351,6 @@ namespace OpenSim.Services.UserAccountService
338 else 351 else
339 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set home for account {0} {1}.", 352 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set home for account {0} {1}.",
340 firstName, lastName); 353 firstName, lastName);
341
342 } 354 }
343 else 355 else
344 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to retrieve home region for account {0} {1}.", 356 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to retrieve home region for account {0} {1}.",
@@ -350,7 +362,6 @@ namespace OpenSim.Services.UserAccountService
350 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.", 362 m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.",
351 firstName, lastName); 363 firstName, lastName);
352 364
353
354 m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", firstName, lastName); 365 m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", firstName, lastName);
355 } 366 }
356 } 367 }
@@ -358,7 +369,6 @@ namespace OpenSim.Services.UserAccountService
358 { 369 {
359 m_log.ErrorFormat("[USER ACCOUNT SERVICE]: A user with the name {0} {1} already exists!", firstName, lastName); 370 m_log.ErrorFormat("[USER ACCOUNT SERVICE]: A user with the name {0} {1} already exists!", firstName, lastName);
360 } 371 }
361
362 } 372 }
363 373
364 protected void HandleResetUserPassword(string module, string[] cmdparams) 374 protected void HandleResetUserPassword(string module, string[] cmdparams)