aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteUserData.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-12-23 18:56:56 +0000
committerJustin Clarke Casey2008-12-23 18:56:56 +0000
commitf49daf97086902ca1ac1221daf6522832b4f74c4 (patch)
tree827680b58565e261a08d66c49a305297966bd2ea /OpenSim/Data/SQLite/SQLiteUserData.cs
parent* minor: small documentation comment (diff)
downloadopensim-SC_OLD-f49daf97086902ca1ac1221daf6522832b4f74c4.zip
opensim-SC_OLD-f49daf97086902ca1ac1221daf6522832b4f74c4.tar.gz
opensim-SC_OLD-f49daf97086902ca1ac1221daf6522832b4f74c4.tar.bz2
opensim-SC_OLD-f49daf97086902ca1ac1221daf6522832b4f74c4.tar.xz
* Modify SQLite implementation of UpdateUserProfile() to allow modifications where the name has not been changed
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteUserData.cs')
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserData.cs37
1 files changed, 21 insertions, 16 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs
index ebc58c1..d37c75d 100644
--- a/OpenSim/Data/SQLite/SQLiteUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserData.cs
@@ -483,10 +483,8 @@ namespace OpenSim.Data.SQLite
483 user.WebLoginKey = WebLoginKey; 483 user.WebLoginKey = WebLoginKey;
484 fillUserRow(row, user); 484 fillUserRow(row, user);
485 da.Update(ds, "users"); 485 da.Update(ds, "users");
486
487 } 486 }
488 } 487 }
489
490 } 488 }
491 489
492 private bool ExistsFirstLastName(String fname, String lname) 490 private bool ExistsFirstLastName(String fname, String lname)
@@ -539,15 +537,16 @@ namespace OpenSim.Data.SQLite
539 row = users.NewRow(); 537 row = users.NewRow();
540 fillUserRow(row, user); 538 fillUserRow(row, user);
541 users.Rows.Add(row); 539 users.Rows.Add(row);
540
541 m_log.Debug("[USER DB]: Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored");
542
543 // save changes off to disk
544 da.Update(ds, "users");
542 } 545 }
543 else 546 else
544 { 547 {
545 fillUserRow(row, user); 548 m_log.Warn("[USER DB]: Ignoring add since user with id {0} already exists", user.ID);
546
547 } 549 }
548 m_log.Info("[USER DB]: Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored");
549 // save changes off to disk
550 da.Update(ds, "users");
551 } 550 }
552 } 551 }
553 552
@@ -558,15 +557,23 @@ namespace OpenSim.Data.SQLite
558 /// <returns>True on success, false on error</returns> 557 /// <returns>True on success, false on error</returns>
559 override public bool UpdateUserProfile(UserProfileData user) 558 override public bool UpdateUserProfile(UserProfileData user)
560 { 559 {
561 try 560 DataTable users = ds.Tables["users"];
562 { 561 lock (ds)
563 AddNewUserProfile(user);
564 return true;
565 }
566 catch (Exception)
567 { 562 {
568 return false; 563 DataRow row = users.Rows.Find(Util.ToRawUuidString(user.ID));
564 if (row == null)
565 {
566 return false;
567 }
568 else
569 {
570 fillUserRow(row, user);
571 da.Update(ds, "users");
572 }
569 } 573 }
574
575 //AddNewUserProfile(user);
576 return true;
570 } 577 }
571 578
572 /// <summary> 579 /// <summary>
@@ -598,7 +605,6 @@ namespace OpenSim.Data.SQLite
598 // save changes off to disk 605 // save changes off to disk
599 dua.Update(ds, "useragents"); 606 dua.Update(ds, "useragents");
600 } 607 }
601
602 } 608 }
603 609
604 /// <summary> 610 /// <summary>
@@ -859,7 +865,6 @@ namespace OpenSim.Data.SQLite
859 row["passwordHash"] = user.PasswordHash; 865 row["passwordHash"] = user.PasswordHash;
860 row["passwordSalt"] = user.PasswordSalt; 866 row["passwordSalt"] = user.PasswordSalt;
861 867
862
863 row["homeRegionX"] = user.HomeRegionX; 868 row["homeRegionX"] = user.HomeRegionX;
864 row["homeRegionY"] = user.HomeRegionY; 869 row["homeRegionY"] = user.HomeRegionY;
865 row["homeRegionID"] = user.HomeRegionID; 870 row["homeRegionID"] = user.HomeRegionID;