* Modify SQLite implementation of UpdateUserProfile() to allow modifications where the name has not been changed

0.6.2-post-fixes
Justin Clarke Casey 2008-12-23 18:56:56 +00:00
parent 690d190783
commit f49daf9708
1 changed files with 21 additions and 16 deletions

View File

@ -483,10 +483,8 @@ namespace OpenSim.Data.SQLite
user.WebLoginKey = WebLoginKey;
fillUserRow(row, user);
da.Update(ds, "users");
}
}
}
private bool ExistsFirstLastName(String fname, String lname)
@ -539,15 +537,16 @@ namespace OpenSim.Data.SQLite
row = users.NewRow();
fillUserRow(row, user);
users.Rows.Add(row);
m_log.Debug("[USER DB]: Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored");
// save changes off to disk
da.Update(ds, "users");
}
else
{
fillUserRow(row, user);
m_log.Warn("[USER DB]: Ignoring add since user with id {0} already exists", user.ID);
}
m_log.Info("[USER DB]: Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored");
// save changes off to disk
da.Update(ds, "users");
}
}
@ -558,15 +557,23 @@ namespace OpenSim.Data.SQLite
/// <returns>True on success, false on error</returns>
override public bool UpdateUserProfile(UserProfileData user)
{
try
DataTable users = ds.Tables["users"];
lock (ds)
{
AddNewUserProfile(user);
return true;
}
catch (Exception)
{
return false;
DataRow row = users.Rows.Find(Util.ToRawUuidString(user.ID));
if (row == null)
{
return false;
}
else
{
fillUserRow(row, user);
da.Update(ds, "users");
}
}
//AddNewUserProfile(user);
return true;
}
/// <summary>
@ -598,7 +605,6 @@ namespace OpenSim.Data.SQLite
// save changes off to disk
dua.Update(ds, "useragents");
}
}
/// <summary>
@ -859,7 +865,6 @@ namespace OpenSim.Data.SQLite
row["passwordHash"] = user.PasswordHash;
row["passwordSalt"] = user.PasswordSalt;
row["homeRegionX"] = user.HomeRegionX;
row["homeRegionY"] = user.HomeRegionY;
row["homeRegionID"] = user.HomeRegionID;