aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorSean Dague2008-11-04 14:54:42 +0000
committerSean Dague2008-11-04 14:54:42 +0000
commit702249358badda5413e67ee0267063c2e2a61498 (patch)
tree42775e792f77d391e5ad730b2bb15f65da3e96d1 /OpenSim/Data/MySQL
parentPrefix LSL variables which are C# keywords with @ instead of _ when translati... (diff)
downloadopensim-SC_OLD-702249358badda5413e67ee0267063c2e2a61498.zip
opensim-SC_OLD-702249358badda5413e67ee0267063c2e2a61498.tar.gz
opensim-SC_OLD-702249358badda5413e67ee0267063c2e2a61498.tar.bz2
opensim-SC_OLD-702249358badda5413e67ee0267063c2e2a61498.tar.xz
implement email field for MySQL and SQLite
From: Sean Dague <sdague@gmail.com>
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs29
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs4
-rw-r--r--OpenSim/Data/MySQL/Resources/007_UserStore.sql5
3 files changed, 23 insertions, 15 deletions
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index 5f830bb..7096efa 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -540,6 +540,7 @@ namespace OpenSim.Data.MySQL
540 retval.ID = id; 540 retval.ID = id;
541 retval.FirstName = (string) reader["username"]; 541 retval.FirstName = (string) reader["username"];
542 retval.SurName = (string) reader["lastname"]; 542 retval.SurName = (string) reader["lastname"];
543 retval.Email = (string) reader["email"];
543 544
544 retval.PasswordHash = (string) reader["passwordHash"]; 545 retval.PasswordHash = (string) reader["passwordHash"];
545 retval.PasswordSalt = (string) reader["passwordSalt"]; 546 retval.PasswordSalt = (string) reader["passwordSalt"];
@@ -768,7 +769,7 @@ namespace OpenSim.Data.MySQL
768 /// <param name="firstImage">UUID for firstlife image</param> 769 /// <param name="firstImage">UUID for firstlife image</param>
769 /// <param name="webLoginKey">Ignored</param> 770 /// <param name="webLoginKey">Ignored</param>
770 /// <returns>Success?</returns> 771 /// <returns>Success?</returns>
771 public bool insertUserRow(UUID uuid, string username, string lastname, string passwordHash, 772 public bool insertUserRow(UUID uuid, string username, string lastname, string email, string passwordHash,
772 string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, 773 string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ,
773 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, 774 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
774 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, 775 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
@@ -777,14 +778,14 @@ namespace OpenSim.Data.MySQL
777 { 778 {
778 m_log.Debug("[MySQLManager]: Fetching profile for " + uuid.ToString()); 779 m_log.Debug("[MySQLManager]: Fetching profile for " + uuid.ToString());
779 string sql = 780 string sql =
780 "INSERT INTO users (`UUID`, `username`, `lastname`, `passwordHash`, `passwordSalt`, `homeRegion`, "; 781 "INSERT INTO users (`UUID`, `username`, `lastname`, `email`, `passwordHash`, `passwordSalt`, `homeRegion`, ";
781 sql += 782 sql +=
782 "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, "; 783 "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, ";
783 sql += 784 sql +=
784 "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, "; 785 "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, ";
785 sql += "`profileFirstText`, `profileImage`, `profileFirstImage`, `webLoginKey`, `userFlags`, `godLevel`, `customType`, `partner`) VALUES "; 786 sql += "`profileFirstText`, `profileImage`, `profileFirstImage`, `webLoginKey`, `userFlags`, `godLevel`, `customType`, `partner`) VALUES ";
786 787
787 sql += "(?UUID, ?username, ?lastname, ?passwordHash, ?passwordSalt, ?homeRegion, "; 788 sql += "(?UUID, ?username, ?lastname, ?email, ?passwordHash, ?passwordSalt, ?homeRegion, ";
788 sql += 789 sql +=
789 "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, "; 790 "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, ";
790 sql += 791 sql +=
@@ -793,10 +794,11 @@ namespace OpenSim.Data.MySQL
793 794
794 Dictionary<string, string> parameters = new Dictionary<string, string>(); 795 Dictionary<string, string> parameters = new Dictionary<string, string>();
795 parameters["?UUID"] = uuid.ToString(); 796 parameters["?UUID"] = uuid.ToString();
796 parameters["?username"] = username.ToString(); 797 parameters["?username"] = username;
797 parameters["?lastname"] = lastname.ToString(); 798 parameters["?lastname"] = lastname;
798 parameters["?passwordHash"] = passwordHash.ToString(); 799 parameters["?email"] = email;
799 parameters["?passwordSalt"] = passwordSalt.ToString(); 800 parameters["?passwordHash"] = passwordHash;
801 parameters["?passwordSalt"] = passwordSalt;
800 parameters["?homeRegion"] = homeRegion.ToString(); 802 parameters["?homeRegion"] = homeRegion.ToString();
801 parameters["?homeLocationX"] = homeLocX.ToString(); 803 parameters["?homeLocationX"] = homeLocX.ToString();
802 parameters["?homeLocationY"] = homeLocY.ToString(); 804 parameters["?homeLocationY"] = homeLocY.ToString();
@@ -869,14 +871,14 @@ namespace OpenSim.Data.MySQL
869 /// <param name="firstImage">UUID for firstlife image</param> 871 /// <param name="firstImage">UUID for firstlife image</param>
870 /// <param name="webLoginKey">UUID for weblogin Key</param> 872 /// <param name="webLoginKey">UUID for weblogin Key</param>
871 /// <returns>Success?</returns> 873 /// <returns>Success?</returns>
872 public bool updateUserRow(UUID uuid, string username, string lastname, string passwordHash, 874 public bool updateUserRow(UUID uuid, string username, string lastname, string email, string passwordHash,
873 string passwordSalt, UInt64 homeRegion, UUID homeRegionID, float homeLocX, float homeLocY, float homeLocZ, 875 string passwordSalt, UInt64 homeRegion, UUID homeRegionID, float homeLocX, float homeLocY, float homeLocZ,
874 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, 876 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
875 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, 877 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
876 string aboutText, string firstText, 878 string aboutText, string firstText,
877 UUID profileImage, UUID firstImage, UUID webLoginKey, int userFlags, int godLevel, string customType, UUID partner) 879 UUID profileImage, UUID firstImage, UUID webLoginKey, int userFlags, int godLevel, string customType, UUID partner)
878 { 880 {
879 string sql = "UPDATE users SET `username` = ?username , `lastname` = ?lastname "; 881 string sql = "UPDATE users SET `username` = ?username , `lastname` = ?lastname, `email` = ?email ";
880 sql += ", `passwordHash` = ?passwordHash , `passwordSalt` = ?passwordSalt , "; 882 sql += ", `passwordHash` = ?passwordHash , `passwordSalt` = ?passwordSalt , ";
881 sql += "`homeRegion` = ?homeRegion , `homeRegionID` = ?homeRegionID, `homeLocationX` = ?homeLocationX , "; 883 sql += "`homeRegion` = ?homeRegion , `homeRegionID` = ?homeRegionID, `homeLocationX` = ?homeLocationX , ";
882 sql += "`homeLocationY` = ?homeLocationY , `homeLocationZ` = ?homeLocationZ , "; 884 sql += "`homeLocationY` = ?homeLocationY , `homeLocationZ` = ?homeLocationZ , ";
@@ -892,10 +894,11 @@ namespace OpenSim.Data.MySQL
892 894
893 Dictionary<string, string> parameters = new Dictionary<string, string>(); 895 Dictionary<string, string> parameters = new Dictionary<string, string>();
894 parameters["?UUID"] = uuid.ToString(); 896 parameters["?UUID"] = uuid.ToString();
895 parameters["?username"] = username.ToString(); 897 parameters["?username"] = username;
896 parameters["?lastname"] = lastname.ToString(); 898 parameters["?lastname"] = lastname;
897 parameters["?passwordHash"] = passwordHash.ToString(); 899 parameters["?email"] = email;
898 parameters["?passwordSalt"] = passwordSalt.ToString(); 900 parameters["?passwordHash"] = passwordHash;
901 parameters["?passwordSalt"] = passwordSalt;
899 parameters["?homeRegion"] = homeRegion.ToString(); 902 parameters["?homeRegion"] = homeRegion.ToString();
900 parameters["?homeRegionID"] = homeRegionID.ToString(); 903 parameters["?homeRegionID"] = homeRegionID.ToString();
901 parameters["?homeLocationX"] = homeLocX.ToString(); 904 parameters["?homeLocationX"] = homeLocX.ToString();
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index 6baf4b6..47670d2 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -642,7 +642,7 @@ namespace OpenSim.Data.MySQL
642 642
643 try 643 try
644 { 644 {
645 dbm.Manager.insertUserRow(user.ID, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt, 645 dbm.Manager.insertUserRow(user.ID, user.FirstName, user.SurName, user.Email, user.PasswordHash, user.PasswordSalt,
646 user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, 646 user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y,
647 user.HomeLocation.Z, 647 user.HomeLocation.Z,
648 user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, 648 user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created,
@@ -697,7 +697,7 @@ namespace OpenSim.Data.MySQL
697 MySQLSuperManager dbm = GetLockedConnection("UpdateUserProfile"); 697 MySQLSuperManager dbm = GetLockedConnection("UpdateUserProfile");
698 try 698 try
699 { 699 {
700 dbm.Manager.updateUserRow(user.ID, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt, 700 dbm.Manager.updateUserRow(user.ID, user.FirstName, user.SurName, user.Email, user.PasswordHash, user.PasswordSalt,
701 user.HomeRegion, user.HomeRegionID, user.HomeLocation.X, user.HomeLocation.Y, 701 user.HomeRegion, user.HomeRegionID, user.HomeLocation.X, user.HomeLocation.Y,
702 user.HomeLocation.Z, user.HomeLookAt.X, 702 user.HomeLocation.Z, user.HomeLookAt.X,
703 user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, 703 user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin,
diff --git a/OpenSim/Data/MySQL/Resources/007_UserStore.sql b/OpenSim/Data/MySQL/Resources/007_UserStore.sql
new file mode 100644
index 0000000..3ab5261
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/007_UserStore.sql
@@ -0,0 +1,5 @@
1BEGIN;
2
3ALTER TABLE users add email varchar(250);
4
5COMMIT;