aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs71
1 files changed, 35 insertions, 36 deletions
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index 3f1744d..eb588f0 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -308,6 +308,40 @@ namespace OpenSim.Services.UserAccountService
308 CreateUser(firstName, lastName, password, email); 308 CreateUser(firstName, lastName, password, email);
309 } 309 }
310 310
311 protected void HandleResetUserPassword(string module, string[] cmdparams)
312 {
313 string firstName;
314 string lastName;
315 string newPassword;
316
317 if (cmdparams.Length < 4)
318 firstName = MainConsole.Instance.CmdPrompt("First name");
319 else firstName = cmdparams[3];
320
321 if (cmdparams.Length < 5)
322 lastName = MainConsole.Instance.CmdPrompt("Last name");
323 else lastName = cmdparams[4];
324
325 if (cmdparams.Length < 6)
326 newPassword = MainConsole.Instance.PasswdPrompt("New password");
327 else newPassword = cmdparams[5];
328
329 UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName);
330 if (account == null)
331 m_log.ErrorFormat("[USER ACCOUNT SERVICE]: No such user");
332
333 bool success = false;
334 if (m_AuthenticationService != null)
335 success = m_AuthenticationService.SetPassword(account.PrincipalID, newPassword);
336 if (!success)
337 m_log.ErrorFormat("[USER ACCOUNT SERVICE]: Unable to reset password for account {0} {1}.",
338 firstName, lastName);
339 else
340 m_log.InfoFormat("[USER ACCOUNT SERVICE]: Password reset for user {0} {1}", firstName, lastName);
341 }
342
343 #endregion
344
311 /// <summary> 345 /// <summary>
312 /// Create a user 346 /// Create a user
313 /// </summary> 347 /// </summary>
@@ -369,41 +403,6 @@ namespace OpenSim.Services.UserAccountService
369 { 403 {
370 m_log.ErrorFormat("[USER ACCOUNT SERVICE]: A user with the name {0} {1} already exists!", firstName, lastName); 404 m_log.ErrorFormat("[USER ACCOUNT SERVICE]: A user with the name {0} {1} already exists!", firstName, lastName);
371 } 405 }
372 } 406 }
373
374 protected void HandleResetUserPassword(string module, string[] cmdparams)
375 {
376 string firstName;
377 string lastName;
378 string newPassword;
379
380 if (cmdparams.Length < 4)
381 firstName = MainConsole.Instance.CmdPrompt("First name");
382 else firstName = cmdparams[3];
383
384 if (cmdparams.Length < 5)
385 lastName = MainConsole.Instance.CmdPrompt("Last name");
386 else lastName = cmdparams[4];
387
388 if (cmdparams.Length < 6)
389 newPassword = MainConsole.Instance.PasswdPrompt("New password");
390 else newPassword = cmdparams[5];
391
392 UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName);
393 if (account == null)
394 m_log.ErrorFormat("[USER ACCOUNT SERVICE]: No such user");
395
396 bool success = false;
397 if (m_AuthenticationService != null)
398 success = m_AuthenticationService.SetPassword(account.PrincipalID, newPassword);
399 if (!success)
400 m_log.ErrorFormat("[USER ACCOUNT SERVICE]: Unable to reset password for account {0} {1}.",
401 firstName, lastName);
402 else
403 m_log.InfoFormat("[USER ACCOUNT SERVICE]: Password reset for user {0} {1}", firstName, lastName);
404 }
405
406 #endregion
407
408 } 407 }
409} 408}