mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
* 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!
This commit is contained in:
@@ -95,6 +95,22 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
MainLog.Instance.Verbose("DATASTORE", "MSSQL Database doesn't exist... creating");
|
||||
InitDB(conn);
|
||||
}
|
||||
cmd = Query("select top 1 webLoginKey from users", new Dictionary<string, string>());
|
||||
try
|
||||
{
|
||||
conn.Open();
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd.Dispose();
|
||||
conn.Close();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
conn.Open();
|
||||
cmd = Query("alter table users add column [webLoginKey] varchar(36) default NULL", new Dictionary<string, string>());
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd.Dispose();
|
||||
conn.Close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -380,6 +396,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
|
||||
retval.profileImage = new LLUUID((string) reader["profileImage"]);
|
||||
retval.profileFirstImage = new LLUUID((string) reader["profileFirstImage"]);
|
||||
retval.webLoginKey = new LLUUID((string)reader["webLoginKey"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -595,7 +612,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
|
||||
string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
|
||||
string aboutText, string firstText,
|
||||
LLUUID profileImage, LLUUID firstImage)
|
||||
LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey)
|
||||
{
|
||||
string sql = "INSERT INTO users ";
|
||||
sql += "([UUID], [username], [lastname], [passwordHash], [passwordSalt], [homeRegion], ";
|
||||
@@ -603,14 +620,14 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
"[homeLocationX], [homeLocationY], [homeLocationZ], [homeLookAtX], [homeLookAtY], [homeLookAtZ], [created], ";
|
||||
sql +=
|
||||
"[lastLogin], [userInventoryURI], [userAssetURI], [profileCanDoMask], [profileWantDoMask], [profileAboutText], ";
|
||||
sql += "[profileFirstText], [profileImage], [profileFirstImage]) VALUES ";
|
||||
sql += "[profileFirstText], [profileImage], [profileFirstImage], [webLoginKey]) VALUES ";
|
||||
|
||||
sql += "(@UUID, @username, @lastname, @passwordHash, @passwordSalt, @homeRegion, ";
|
||||
sql +=
|
||||
"@homeLocationX, @homeLocationY, @homeLocationZ, @homeLookAtX, @homeLookAtY, @homeLookAtZ, @created, ";
|
||||
sql +=
|
||||
"@lastLogin, @userInventoryURI, @userAssetURI, @profileCanDoMask, @profileWantDoMask, @profileAboutText, ";
|
||||
sql += "@profileFirstText, @profileImage, @profileFirstImage);";
|
||||
sql += "@profileFirstText, @profileImage, @profileFirstImage, @webLoginKey);";
|
||||
|
||||
Dictionary<string, string> parameters = new Dictionary<string, string>();
|
||||
parameters["UUID"] = uuid.ToString();
|
||||
@@ -635,6 +652,7 @@ namespace OpenSim.Framework.Data.MSSQL
|
||||
parameters["profileFirstText"] = "";
|
||||
parameters["profileImage"] = LLUUID.Zero.ToString();
|
||||
parameters["profileFirstImage"] = LLUUID.Zero.ToString();
|
||||
parameters["webLoginKey"] = LLUUID.Random().ToString();
|
||||
|
||||
bool returnval = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user