aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs
diff options
context:
space:
mode:
authorlbsa712008-02-13 20:20:52 +0000
committerlbsa712008-02-13 20:20:52 +0000
commitb705ba21f3a2a34c138de06ece570c31ddd2b4a5 (patch)
treee3284d3656faa12af1bc9dfbd829b82d59e41a3c /OpenSim/Framework/Data.MSSQL/MSSQLManager.cs
parent* Moved insertRegionRow into MSSQLGridData (diff)
downloadopensim-SC_OLD-b705ba21f3a2a34c138de06ece570c31ddd2b4a5.zip
opensim-SC_OLD-b705ba21f3a2a34c138de06ece570c31ddd2b4a5.tar.gz
opensim-SC_OLD-b705ba21f3a2a34c138de06ece570c31ddd2b4a5.tar.bz2
opensim-SC_OLD-b705ba21f3a2a34c138de06ece570c31ddd2b4a5.tar.xz
* Moved insertUserRow into MSSQLUserData so 'create user' works again
[Provided by openlifegrid.com]
Diffstat (limited to 'OpenSim/Framework/Data.MSSQL/MSSQLManager.cs')
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLManager.cs96
1 files changed, 1 insertions, 95 deletions
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs
index 26e8eb9..085cf57 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs
@@ -439,101 +439,7 @@ namespace OpenSim.Framework.Data.MSSQL
439 439
440 return returnval; 440 return returnval;
441 } 441 }
442 442
443
444 /// <summary>
445 /// Creates a new user and inserts it into the database
446 /// </summary>
447 /// <param name="uuid">User ID</param>
448 /// <param name="username">First part of the login</param>
449 /// <param name="lastname">Second part of the login</param>
450 /// <param name="passwordHash">A salted hash of the users password</param>
451 /// <param name="passwordSalt">The salt used for the password hash</param>
452 /// <param name="homeRegion">A regionHandle of the users home region</param>
453 /// <param name="homeLocX">Home region position vector</param>
454 /// <param name="homeLocY">Home region position vector</param>
455 /// <param name="homeLocZ">Home region position vector</param>
456 /// <param name="homeLookAtX">Home region 'look at' vector</param>
457 /// <param name="homeLookAtY">Home region 'look at' vector</param>
458 /// <param name="homeLookAtZ">Home region 'look at' vector</param>
459 /// <param name="created">Account created (unix timestamp)</param>
460 /// <param name="lastlogin">Last login (unix timestamp)</param>
461 /// <param name="inventoryURI">Users inventory URI</param>
462 /// <param name="assetURI">Users asset URI</param>
463 /// <param name="canDoMask">I can do mask</param>
464 /// <param name="wantDoMask">I want to do mask</param>
465 /// <param name="aboutText">Profile text</param>
466 /// <param name="firstText">Firstlife text</param>
467 /// <param name="profileImage">UUID for profile image</param>
468 /// <param name="firstImage">UUID for firstlife image</param>
469 /// <returns>Success?</returns>
470 public bool insertUserRow(LLUUID uuid, string username, string lastname, string passwordHash,
471 string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ,
472 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
473 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
474 string aboutText, string firstText,
475 LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey)
476 {
477 string sql = "INSERT INTO users ";
478 sql += "([UUID], [username], [lastname], [passwordHash], [passwordSalt], [homeRegion], ";
479 sql +=
480 "[homeLocationX], [homeLocationY], [homeLocationZ], [homeLookAtX], [homeLookAtY], [homeLookAtZ], [created], ";
481 sql +=
482 "[lastLogin], [userInventoryURI], [userAssetURI], [profileCanDoMask], [profileWantDoMask], [profileAboutText], ";
483 sql += "[profileFirstText], [profileImage], [profileFirstImage], [webLoginKey]) VALUES ";
484
485 sql += "(@UUID, @username, @lastname, @passwordHash, @passwordSalt, @homeRegion, ";
486 sql +=
487 "@homeLocationX, @homeLocationY, @homeLocationZ, @homeLookAtX, @homeLookAtY, @homeLookAtZ, @created, ";
488 sql +=
489 "@lastLogin, @userInventoryURI, @userAssetURI, @profileCanDoMask, @profileWantDoMask, @profileAboutText, ";
490 sql += "@profileFirstText, @profileImage, @profileFirstImage, @webLoginKey);";
491
492 Dictionary<string, string> parameters = new Dictionary<string, string>();
493 parameters["UUID"] = uuid.ToString();
494 parameters["username"] = username.ToString();
495 parameters["lastname"] = lastname.ToString();
496 parameters["passwordHash"] = passwordHash.ToString();
497 parameters["passwordSalt"] = passwordSalt.ToString();
498 parameters["homeRegion"] = homeRegion.ToString();
499 parameters["homeLocationX"] = homeLocX.ToString();
500 parameters["homeLocationY"] = homeLocY.ToString();
501 parameters["homeLocationZ"] = homeLocZ.ToString();
502 parameters["homeLookAtX"] = homeLookAtX.ToString();
503 parameters["homeLookAtY"] = homeLookAtY.ToString();
504 parameters["homeLookAtZ"] = homeLookAtZ.ToString();
505 parameters["created"] = created.ToString();
506 parameters["lastLogin"] = lastlogin.ToString();
507 parameters["userInventoryURI"] = String.Empty;
508 parameters["userAssetURI"] = String.Empty;
509 parameters["profileCanDoMask"] = "0";
510 parameters["profileWantDoMask"] = "0";
511 parameters["profileAboutText"] = String.Empty;
512 parameters["profileFirstText"] = String.Empty;
513 parameters["profileImage"] = LLUUID.Zero.ToString();
514 parameters["profileFirstImage"] = LLUUID.Zero.ToString();
515 parameters["webLoginKey"] = LLUUID.Random().ToString();
516
517 bool returnval = false;
518
519 try
520 {
521 IDbCommand result = Query(sql, parameters);
522
523 if (result.ExecuteNonQuery() == 1)
524 returnval = true;
525
526 result.Dispose();
527 }
528 catch (Exception e)
529 {
530 m_log.Error(e.ToString());
531 return false;
532 }
533
534 return returnval;
535 }
536
537 /// <summary> 443 /// <summary>
538 /// Execute a SQL statement stored in a resource, as a string 444 /// Execute a SQL statement stored in a resource, as a string
539 /// </summary> 445 /// </summary>