aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.MySQL
diff options
context:
space:
mode:
authorTeravus Ovares2008-01-09 04:13:04 +0000
committerTeravus Ovares2008-01-09 04:13:04 +0000
commite1aa83e965440b3e830d599e18ff078104e8a886 (patch)
treeb6f97c44228c41736a7145e8943d4b7c8d535983 /OpenSim/Framework/Data.MySQL
parentdump_assets_to_file=true will now cause the asset to go into a UserAssets sub... (diff)
downloadopensim-SC_OLD-e1aa83e965440b3e830d599e18ff078104e8a886.zip
opensim-SC_OLD-e1aa83e965440b3e830d599e18ff078104e8a886.tar.gz
opensim-SC_OLD-e1aa83e965440b3e830d599e18ff078104e8a886.tar.bz2
opensim-SC_OLD-e1aa83e965440b3e830d599e18ff078104e8a886.tar.xz
* Added a hashtable based HTTP processor in preparation of the web_login_key
* Added the web_login_key to the users table * Added happy configurable http error message pages * This update is large enough to have 'awe' value.. so backup your users or weep. * Not tested on MSSQL, even though I added code to update the tables!
Diffstat (limited to 'OpenSim/Framework/Data.MySQL')
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLManager.cs8
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLUserData.cs8
-rw-r--r--OpenSim/Framework/Data.MySQL/Resources/CreateUsersTable.sql3
-rw-r--r--OpenSim/Framework/Data.MySQL/Resources/UpgradeUsersTableToVersion2.sql3
4 files changed, 17 insertions, 5 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLManager.cs b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
index 9532f21..223d902 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLManager.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
@@ -446,6 +446,7 @@ namespace OpenSim.Framework.Data.MySQL
446 446
447 retval.profileImage = new LLUUID((string) reader["profileImage"]); 447 retval.profileImage = new LLUUID((string) reader["profileImage"]);
448 retval.profileFirstImage = new LLUUID((string) reader["profileFirstImage"]); 448 retval.profileFirstImage = new LLUUID((string) reader["profileFirstImage"]);
449 retval.webLoginKey = new LLUUID((string)reader["webLoginKey"]);
449 } 450 }
450 else 451 else
451 { 452 {
@@ -531,7 +532,7 @@ namespace OpenSim.Framework.Data.MySQL
531 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, 532 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
532 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, 533 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
533 string aboutText, string firstText, 534 string aboutText, string firstText,
534 LLUUID profileImage, LLUUID firstImage) 535 LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey)
535 { 536 {
536 string sql = 537 string sql =
537 "INSERT INTO users (`UUID`, `username`, `lastname`, `passwordHash`, `passwordSalt`, `homeRegion`, "; 538 "INSERT INTO users (`UUID`, `username`, `lastname`, `passwordHash`, `passwordSalt`, `homeRegion`, ";
@@ -539,14 +540,14 @@ namespace OpenSim.Framework.Data.MySQL
539 "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, "; 540 "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, ";
540 sql += 541 sql +=
541 "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, "; 542 "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, ";
542 sql += "`profileFirstText`, `profileImage`, `profileFirstImage`) VALUES "; 543 sql += "`profileFirstText`, `profileImage`, `profileFirstImage`, `webLoginKey`) VALUES ";
543 544
544 sql += "(?UUID, ?username, ?lastname, ?passwordHash, ?passwordSalt, ?homeRegion, "; 545 sql += "(?UUID, ?username, ?lastname, ?passwordHash, ?passwordSalt, ?homeRegion, ";
545 sql += 546 sql +=
546 "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, "; 547 "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, ";
547 sql += 548 sql +=
548 "?lastLogin, ?userInventoryURI, ?userAssetURI, ?profileCanDoMask, ?profileWantDoMask, ?profileAboutText, "; 549 "?lastLogin, ?userInventoryURI, ?userAssetURI, ?profileCanDoMask, ?profileWantDoMask, ?profileAboutText, ";
549 sql += "?profileFirstText, ?profileImage, ?profileFirstImage)"; 550 sql += "?profileFirstText, ?profileImage, ?profileFirstImage, ?webLoginKey)";
550 551
551 Dictionary<string, string> parameters = new Dictionary<string, string>(); 552 Dictionary<string, string> parameters = new Dictionary<string, string>();
552 parameters["?UUID"] = uuid.ToString(); 553 parameters["?UUID"] = uuid.ToString();
@@ -571,6 +572,7 @@ namespace OpenSim.Framework.Data.MySQL
571 parameters["?profileFirstText"] = ""; 572 parameters["?profileFirstText"] = "";
572 parameters["?profileImage"] = LLUUID.Zero.ToString(); 573 parameters["?profileImage"] = LLUUID.Zero.ToString();
573 parameters["?profileFirstImage"] = LLUUID.Zero.ToString(); 574 parameters["?profileFirstImage"] = LLUUID.Zero.ToString();
575 parameters["?webLoginKey"] = LLUUID.Random().ToString();
574 576
575 bool returnval = false; 577 bool returnval = false;
576 578
diff --git a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
index 7e2d4f0..e53ab18 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
@@ -114,6 +114,12 @@ namespace OpenSim.Framework.Data.MySQL
114 database.ExecuteResourceSql("CreateUsersTable.sql"); 114 database.ExecuteResourceSql("CreateUsersTable.sql");
115 return; 115 return;
116 } 116 }
117 else if (oldVersion.Contains("Rev. 1"))
118 {
119 database.ExecuteResourceSql("UpgradeUsersTableToVersion2.sql");
120 return;
121 }
122 //MainLog.Instance.Verbose("DB","DBVers:" + oldVersion);
117 } 123 }
118 124
119 /// <summary> 125 /// <summary>
@@ -512,7 +518,7 @@ namespace OpenSim.Framework.Data.MySQL
512 user.lastLogin, user.userInventoryURI, user.userAssetURI, 518 user.lastLogin, user.userInventoryURI, user.userAssetURI,
513 user.profileCanDoMask, user.profileWantDoMask, 519 user.profileCanDoMask, user.profileWantDoMask,
514 user.profileAboutText, user.profileFirstText, user.profileImage, 520 user.profileAboutText, user.profileFirstText, user.profileImage,
515 user.profileFirstImage); 521 user.profileFirstImage, user.webLoginKey);
516 } 522 }
517 } 523 }
518 catch (Exception e) 524 catch (Exception e)
diff --git a/OpenSim/Framework/Data.MySQL/Resources/CreateUsersTable.sql b/OpenSim/Framework/Data.MySQL/Resources/CreateUsersTable.sql
index faac541..d9e8ae2 100644
--- a/OpenSim/Framework/Data.MySQL/Resources/CreateUsersTable.sql
+++ b/OpenSim/Framework/Data.MySQL/Resources/CreateUsersTable.sql
@@ -25,9 +25,10 @@ CREATE TABLE `users` (
25 `profileFirstText` text, 25 `profileFirstText` text,
26 `profileImage` varchar(36) default NULL, 26 `profileImage` varchar(36) default NULL,
27 `profileFirstImage` varchar(36) default NULL, 27 `profileFirstImage` varchar(36) default NULL,
28 `webLoginKey` varchar(36) default NULL,
28 PRIMARY KEY (`UUID`), 29 PRIMARY KEY (`UUID`),
29 UNIQUE KEY `usernames` (`username`,`lastname`) 30 UNIQUE KEY `usernames` (`username`,`lastname`)
30) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1'; 31) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 2';
31 32
32-- ---------------------------- 33-- ----------------------------
33-- Records 34-- Records
diff --git a/OpenSim/Framework/Data.MySQL/Resources/UpgradeUsersTableToVersion2.sql b/OpenSim/Framework/Data.MySQL/Resources/UpgradeUsersTableToVersion2.sql
new file mode 100644
index 0000000..99a84a8
--- /dev/null
+++ b/OpenSim/Framework/Data.MySQL/Resources/UpgradeUsersTableToVersion2.sql
@@ -0,0 +1,3 @@
1ALTER TABLE `users`
2 ADD COLUMN `webLoginKey` varchar(36) default NULL,
3COMMENT='Rev. 2'; \ No newline at end of file