aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs23
1 files changed, 19 insertions, 4 deletions
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index 454197a..1c72b79 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -116,6 +116,8 @@ namespace OpenSim.Framework.Communications
116 XmlRpcResponse response = new XmlRpcResponse(); 116 XmlRpcResponse response = new XmlRpcResponse();
117 Hashtable requestData = (Hashtable) request.Params[0]; 117 Hashtable requestData = (Hashtable) request.Params[0];
118 118
119 SniffLoginKey((Uri)request.Params[2], requestData);
120
119 bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && 121 bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") &&
120 (requestData.Contains("passwd") || requestData.Contains("web_login_key"))); 122 (requestData.Contains("passwd") || requestData.Contains("web_login_key")));
121 123
@@ -303,7 +305,7 @@ namespace OpenSim.Framework.Communications
303 string passwd = (string) requestData["passwd"]; 305 string passwd = (string) requestData["passwd"];
304 GoodLogin = AuthenticateUser(userProfile, passwd); 306 GoodLogin = AuthenticateUser(userProfile, passwd);
305 } 307 }
306 else if (requestData.Contains("web_login_key")) 308 if (!GoodLogin && (requestData.Contains("web_login_key")))
307 { 309 {
308 try 310 try
309 { 311 {
@@ -576,7 +578,7 @@ namespace OpenSim.Framework.Communications
576 { 578 {
577 UUID webloginkey = UUID.Random(); 579 UUID webloginkey = UUID.Random();
578 m_userManager.StoreWebLoginKey(user.ID, webloginkey); 580 m_userManager.StoreWebLoginKey(user.ID, webloginkey);
579 statuscode = 301; 581 //statuscode = 301;
580 582
581 string redirectURL = "about:blank?redirect-http-hack=" + 583 string redirectURL = "about:blank?redirect-http-hack=" +
582 HttpUtility.UrlEncode("secondlife:///app/login?first_name=" + firstname + "&last_name=" + 584 HttpUtility.UrlEncode("secondlife:///app/login?first_name=" + firstname + "&last_name=" +
@@ -584,8 +586,9 @@ namespace OpenSim.Framework.Communications
584 "&location=" + location + "&grid=Other&web_login_key=" + webloginkey.ToString()); 586 "&location=" + location + "&grid=Other&web_login_key=" + webloginkey.ToString());
585 //m_log.Info("[WEB]: R:" + redirectURL); 587 //m_log.Info("[WEB]: R:" + redirectURL);
586 returnactions["int_response_code"] = statuscode; 588 returnactions["int_response_code"] = statuscode;
587 returnactions["str_redirect_location"] = redirectURL; 589 //returnactions["str_redirect_location"] = redirectURL;
588 returnactions["str_response_string"] = "<HTML><BODY>GoodLogin</BODY></HTML>"; 590 //returnactions["str_response_string"] = "<HTML><BODY>GoodLogin</BODY></HTML>";
591 returnactions["str_response_string"] = webloginkey.ToString();
589 } 592 }
590 else 593 else
591 { 594 {
@@ -854,5 +857,17 @@ namespace OpenSim.Framework.Communications
854 RootFolderID = rootID; 857 RootFolderID = rootID;
855 } 858 }
856 } 859 }
860
861 protected void SniffLoginKey(Uri uri, Hashtable requestData)
862 {
863 string uri_str = uri.ToString();
864 string[] parts = uri_str.Split(new char[] { '=' });
865 if (parts.Length > 1)
866 {
867 string web_login_key = parts[1];
868 requestData.Add("web_login_key", web_login_key);
869 m_log.InfoFormat("[LOGIN]: Login with web_login_key {0}", web_login_key);
870 }
871 }
857 } 872 }
858} 873}