* Add new e-mail field to users table for MSSQL
* Thanks StrawberryFride
0.6.0-stable
Justin Clarke Casey 2008-11-04 21:44:57 +00:00
parent 41232ee921
commit 349f6ec3e5
1 changed files with 7 additions and 4 deletions

View File

@ -268,7 +268,7 @@ namespace OpenSim.Data.MSSQL
{ {
try try
{ {
InsertUserRow(user.ID, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt, InsertUserRow(user.ID, user.FirstName, user.SurName, user.Email, user.PasswordHash, user.PasswordSalt,
user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y,
user.HomeLocation.Z, user.HomeLocation.Z,
user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created,
@ -294,6 +294,7 @@ namespace OpenSim.Data.MSSQL
using (AutoClosingSqlCommand command = database.Query("UPDATE " + m_usersTableName + " set UUID = @uuid, " + using (AutoClosingSqlCommand command = database.Query("UPDATE " + m_usersTableName + " set UUID = @uuid, " +
"username = @username, " + "username = @username, " +
"lastname = @lastname," + "lastname = @lastname," +
"email = @email," +
"passwordHash = @passwordHash," + "passwordHash = @passwordHash," +
"passwordSalt = @passwordSalt," + "passwordSalt = @passwordSalt," +
"homeRegion = @homeRegion," + "homeRegion = @homeRegion," +
@ -324,6 +325,7 @@ namespace OpenSim.Data.MSSQL
command.Parameters.Add(database.CreateParameter("uuid", user.ID)); command.Parameters.Add(database.CreateParameter("uuid", user.ID));
command.Parameters.Add(database.CreateParameter("username", user.FirstName)); command.Parameters.Add(database.CreateParameter("username", user.FirstName));
command.Parameters.Add(database.CreateParameter("lastname", user.SurName)); command.Parameters.Add(database.CreateParameter("lastname", user.SurName));
command.Parameters.Add(database.CreateParameter("email", user.Email));
command.Parameters.Add(database.CreateParameter("passwordHash", user.PasswordHash)); command.Parameters.Add(database.CreateParameter("passwordHash", user.PasswordHash));
command.Parameters.Add(database.CreateParameter("passwordSalt", user.PasswordSalt)); command.Parameters.Add(database.CreateParameter("passwordSalt", user.PasswordSalt));
command.Parameters.Add(database.CreateParameter("homeRegion", user.HomeRegion)); command.Parameters.Add(database.CreateParameter("homeRegion", user.HomeRegion));
@ -1135,7 +1137,7 @@ ELSE
/// <param name="customType">unknown</param> /// <param name="customType">unknown</param>
/// <param name="partnerID">UUID of partner</param> /// <param name="partnerID">UUID of partner</param>
/// <returns>Success?</returns> /// <returns>Success?</returns>
private void InsertUserRow(UUID uuid, string username, string lastname, string passwordHash, private void InsertUserRow(UUID uuid, string username, string lastname, string email, string passwordHash,
string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ,
float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
@ -1144,13 +1146,13 @@ ELSE
int godLevel, int userFlags, string customType, UUID partnerID) int godLevel, int userFlags, string customType, UUID partnerID)
{ {
string sql = "INSERT INTO " + m_usersTableName; string sql = "INSERT INTO " + m_usersTableName;
sql += " ([UUID], [username], [lastname], [passwordHash], [passwordSalt], [homeRegion], "; sql += " ([UUID], [username], [lastname], [email], [passwordHash], [passwordSalt], [homeRegion], ";
sql += "[homeLocationX], [homeLocationY], [homeLocationZ], [homeLookAtX], [homeLookAtY], [homeLookAtZ], [created], "; sql += "[homeLocationX], [homeLocationY], [homeLocationZ], [homeLookAtX], [homeLookAtY], [homeLookAtZ], [created], ";
sql += "[lastLogin], [userInventoryURI], [userAssetURI], [profileCanDoMask], [profileWantDoMask], [profileAboutText], "; sql += "[lastLogin], [userInventoryURI], [userAssetURI], [profileCanDoMask], [profileWantDoMask], [profileAboutText], ";
sql += "[profileFirstText], [profileImage], [profileFirstImage], [webLoginKey], "; sql += "[profileFirstText], [profileImage], [profileFirstImage], [webLoginKey], ";
sql += "[homeRegionID], [userFlags], [godLevel], [customType], [partner]) VALUES "; sql += "[homeRegionID], [userFlags], [godLevel], [customType], [partner]) VALUES ";
sql += "(@UUID, @username, @lastname, @passwordHash, @passwordSalt, @homeRegion, "; sql += "(@UUID, @username, @lastname, @email, @passwordHash, @passwordSalt, @homeRegion, ";
sql += "@homeLocationX, @homeLocationY, @homeLocationZ, @homeLookAtX, @homeLookAtY, @homeLookAtZ, @created, "; sql += "@homeLocationX, @homeLocationY, @homeLocationZ, @homeLookAtX, @homeLookAtY, @homeLookAtZ, @created, ";
sql += "@lastLogin, @userInventoryURI, @userAssetURI, @profileCanDoMask, @profileWantDoMask, @profileAboutText, "; sql += "@lastLogin, @userInventoryURI, @userAssetURI, @profileCanDoMask, @profileWantDoMask, @profileAboutText, ";
sql += "@profileFirstText, @profileImage, @profileFirstImage, @webLoginKey, "; sql += "@profileFirstText, @profileImage, @profileFirstImage, @webLoginKey, ";
@ -1163,6 +1165,7 @@ ELSE
command.Parameters.Add(database.CreateParameter("UUID", uuid)); command.Parameters.Add(database.CreateParameter("UUID", uuid));
command.Parameters.Add(database.CreateParameter("username", username)); command.Parameters.Add(database.CreateParameter("username", username));
command.Parameters.Add(database.CreateParameter("lastname", lastname)); command.Parameters.Add(database.CreateParameter("lastname", lastname));
command.Parameters.Add(database.CreateParameter("email", email));
command.Parameters.Add(database.CreateParameter("passwordHash", passwordHash)); command.Parameters.Add(database.CreateParameter("passwordHash", passwordHash));
command.Parameters.Add(database.CreateParameter("passwordSalt", passwordSalt)); command.Parameters.Add(database.CreateParameter("passwordSalt", passwordSalt));
command.Parameters.Add(database.CreateParameter("homeRegion", homeRegion)); command.Parameters.Add(database.CreateParameter("homeRegion", homeRegion));