aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/LoginService.cs
diff options
context:
space:
mode:
authorSean Dague2008-04-10 13:53:06 +0000
committerSean Dague2008-04-10 13:53:06 +0000
commitc176caeb05c2264654b764e4d010561da60c24fc (patch)
tree87e0cab128ecaac57c5995df4cf5048185fe383f /OpenSim/Framework/Communications/LoginService.cs
parent* Brings back map tile generation based on the terrain. The algorithm produc... (diff)
downloadopensim-SC_OLD-c176caeb05c2264654b764e4d010561da60c24fc.zip
opensim-SC_OLD-c176caeb05c2264654b764e4d010561da60c24fc.tar.gz
opensim-SC_OLD-c176caeb05c2264654b764e4d010561da60c24fc.tar.bz2
opensim-SC_OLD-c176caeb05c2264654b764e4d010561da60c24fc.tar.xz
moved fields to properties for UserDataProfile, which was
actually a little more work than I expected given the copious use of out params.
Diffstat (limited to 'OpenSim/Framework/Communications/LoginService.cs')
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs46
1 files changed, 23 insertions, 23 deletions
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index 6f558a0..e5ad7a0 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -184,13 +184,13 @@ namespace OpenSim.Framework.UserManagement
184 else 184 else
185 { 185 {
186 // If we already have a session... 186 // If we already have a session...
187 if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) 187 if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline)
188 { 188 {
189 //TODO: The following statements can cause trouble: 189 //TODO: The following statements can cause trouble:
190 // If agentOnline could not turn from true back to false normally 190 // If agentOnline could not turn from true back to false normally
191 // because of some problem, for instance, the crashment of server or client, 191 // because of some problem, for instance, the crashment of server or client,
192 // the user cannot log in any longer. 192 // the user cannot log in any longer.
193 userProfile.currentAgent.agentOnline = false; 193 userProfile.CurrentAgent.agentOnline = false;
194 m_userManager.CommitAgent(ref userProfile); 194 m_userManager.CommitAgent(ref userProfile);
195 195
196 // Reject the login 196 // Reject the login
@@ -207,7 +207,7 @@ namespace OpenSim.Framework.UserManagement
207 207
208 try 208 try
209 { 209 {
210 LLUUID agentID = userProfile.UUID; 210 LLUUID agentID = userProfile.Id;
211 211
212 // Inventory Library Section 212 // Inventory Library Section
213 InventoryData inventData = GetInventorySkeleton(agentID); 213 InventoryData inventData = GetInventorySkeleton(agentID);
@@ -217,16 +217,16 @@ namespace OpenSim.Framework.UserManagement
217 InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); 217 InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString();
218 ArrayList InventoryRoot = new ArrayList(); 218 ArrayList InventoryRoot = new ArrayList();
219 InventoryRoot.Add(InventoryRootHash); 219 InventoryRoot.Add(InventoryRootHash);
220 userProfile.rootInventoryFolderID = inventData.RootFolderID; 220 userProfile.RootInventoryFolderID = inventData.RootFolderID;
221 221
222 // Circuit Code 222 // Circuit Code
223 uint circode = (uint) (Util.RandomClass.Next()); 223 uint circode = (uint) (Util.RandomClass.Next());
224 224
225 logResponse.Lastname = userProfile.surname; 225 logResponse.Lastname = userProfile.SurName;
226 logResponse.Firstname = userProfile.username; 226 logResponse.Firstname = userProfile.FirstName;
227 logResponse.AgentID = agentID.ToString(); 227 logResponse.AgentID = agentID.ToString();
228 logResponse.SessionID = userProfile.currentAgent.sessionID.ToString(); 228 logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString();
229 logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToString(); 229 logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString();
230 logResponse.InventoryRoot = InventoryRoot; 230 logResponse.InventoryRoot = InventoryRoot;
231 logResponse.InventorySkeleton = AgentInventoryArray; 231 logResponse.InventorySkeleton = AgentInventoryArray;
232 logResponse.InventoryLibrary = GetInventoryLibrary(); 232 logResponse.InventoryLibrary = GetInventoryLibrary();
@@ -334,9 +334,9 @@ namespace OpenSim.Framework.UserManagement
334 else 334 else
335 { 335 {
336 // If we already have a session... 336 // If we already have a session...
337 if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) 337 if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline)
338 { 338 {
339 userProfile.currentAgent = null; 339 userProfile.CurrentAgent = null;
340 m_userManager.CommitAgent(ref userProfile); 340 m_userManager.CommitAgent(ref userProfile);
341 341
342 // Reject the login 342 // Reject the login
@@ -349,7 +349,7 @@ namespace OpenSim.Framework.UserManagement
349 349
350 try 350 try
351 { 351 {
352 LLUUID agentID = userProfile.UUID; 352 LLUUID agentID = userProfile.Id;
353 353
354 // Inventory Library Section 354 // Inventory Library Section
355 InventoryData inventData = GetInventorySkeleton(agentID); 355 InventoryData inventData = GetInventorySkeleton(agentID);
@@ -359,16 +359,16 @@ namespace OpenSim.Framework.UserManagement
359 InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); 359 InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString();
360 ArrayList InventoryRoot = new ArrayList(); 360 ArrayList InventoryRoot = new ArrayList();
361 InventoryRoot.Add(InventoryRootHash); 361 InventoryRoot.Add(InventoryRootHash);
362 userProfile.rootInventoryFolderID = inventData.RootFolderID; 362 userProfile.RootInventoryFolderID = inventData.RootFolderID;
363 363
364 // Circuit Code 364 // Circuit Code
365 uint circode = (uint)(Util.RandomClass.Next()); 365 uint circode = (uint)(Util.RandomClass.Next());
366 366
367 logResponse.Lastname = userProfile.surname; 367 logResponse.Lastname = userProfile.SurName;
368 logResponse.Firstname = userProfile.username; 368 logResponse.Firstname = userProfile.FirstName;
369 logResponse.AgentID = agentID.ToString(); 369 logResponse.AgentID = agentID.ToString();
370 logResponse.SessionID = userProfile.currentAgent.sessionID.ToString(); 370 logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString();
371 logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToString(); 371 logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString();
372 logResponse.InventoryRoot = InventoryRoot; 372 logResponse.InventoryRoot = InventoryRoot;
373 logResponse.InventorySkeleton = AgentInventoryArray; 373 logResponse.InventorySkeleton = AgentInventoryArray;
374 logResponse.InventoryLibrary = GetInventoryLibrary(); 374 logResponse.InventoryLibrary = GetInventoryLibrary();
@@ -491,7 +491,7 @@ namespace OpenSim.Framework.UserManagement
491 if (goodweblogin) 491 if (goodweblogin)
492 { 492 {
493 LLUUID webloginkey = LLUUID.Random(); 493 LLUUID webloginkey = LLUUID.Random();
494 m_userManager.StoreWebLoginKey(user.UUID, webloginkey); 494 m_userManager.StoreWebLoginKey(user.Id, webloginkey);
495 statuscode = 301; 495 statuscode = 301;
496 496
497 string redirectURL = "about:blank?redirect-http-hack=" + 497 string redirectURL = "about:blank?redirect-http-hack=" +
@@ -639,7 +639,7 @@ namespace OpenSim.Framework.UserManagement
639 public virtual bool AuthenticateUser(UserProfileData profile, string password) 639 public virtual bool AuthenticateUser(UserProfileData profile, string password)
640 { 640 {
641 bool passwordSuccess = false; 641 bool passwordSuccess = false;
642 m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); 642 m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.FirstName, profile.SurName, profile.Id);
643 643
644 // Web Login method seems to also occasionally send the hashed password itself 644 // Web Login method seems to also occasionally send the hashed password itself
645 645
@@ -650,13 +650,13 @@ namespace OpenSim.Framework.UserManagement
650 650
651 password = password.Remove(0, 3); //remove $1$ 651 password = password.Remove(0, 3); //remove $1$
652 652
653 string s = Util.Md5Hash(password + ":" + profile.passwordSalt); 653 string s = Util.Md5Hash(password + ":" + profile.PasswordSalt);
654 // Testing... 654 // Testing...
655 //m_log.Info("[LOGIN]: SubHash:" + s + " userprofile:" + profile.passwordHash); 655 //m_log.Info("[LOGIN]: SubHash:" + s + " userprofile:" + profile.passwordHash);
656 //m_log.Info("[LOGIN]: userprofile:" + profile.passwordHash + " SubCT:" + password); 656 //m_log.Info("[LOGIN]: userprofile:" + profile.passwordHash + " SubCT:" + password);
657 657
658 passwordSuccess = (profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) 658 passwordSuccess = (profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase)
659 || profile.passwordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase)); 659 || profile.PasswordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase));
660 660
661 return passwordSuccess; 661 return passwordSuccess;
662 } 662 }
@@ -664,10 +664,10 @@ namespace OpenSim.Framework.UserManagement
664 public virtual bool AuthenticateUser(UserProfileData profile, LLUUID webloginkey) 664 public virtual bool AuthenticateUser(UserProfileData profile, LLUUID webloginkey)
665 { 665 {
666 bool passwordSuccess = false; 666 bool passwordSuccess = false;
667 m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); 667 m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.FirstName, profile.SurName, profile.Id);
668 668
669 // Match web login key unless it's the default weblogin key LLUUID.Zero 669 // Match web login key unless it's the default weblogin key LLUUID.Zero
670 passwordSuccess = ((profile.webLoginKey==webloginkey) && profile.webLoginKey != LLUUID.Zero); 670 passwordSuccess = ((profile.WebLoginKey==webloginkey) && profile.WebLoginKey != LLUUID.Zero);
671 671
672 return passwordSuccess; 672 return passwordSuccess;
673 } 673 }