aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authordiva2009-03-08 23:17:49 +0000
committerdiva2009-03-08 23:17:49 +0000
commit6f4051c93251c4c8a1cff91b3b449f1f25c94382 (patch)
treef42aa100f378a6a2726a942da10f7031f96c9df3
parentThank you tlaukkan for a patch that: Upgraded to MXP 0.4 version and cleaned ... (diff)
downloadopensim-SC-6f4051c93251c4c8a1cff91b3b449f1f25c94382.zip
opensim-SC-6f4051c93251c4c8a1cff91b3b449f1f25c94382.tar.gz
opensim-SC-6f4051c93251c4c8a1cff91b3b449f1f25c94382.tar.bz2
opensim-SC-6f4051c93251c4c8a1cff91b3b449f1f25c94382.tar.xz
Making the web_login_key code work, even if the LL Viewer doesn't support it. Other clients can launch the LL Viewer with something like this, for example:
Process.Start("C:\\Program Files\\SecondLife\\SecondLife.exe", "-loginuri " + loginuri + "?web_login_key=" + web_login_key + " -login " + firstName + " " + lastName + " -multiple"); This requires a prior step for actually getting the key, which can be done like this: http://localhost:9000/?method=login&firstname=barak&lastname=obama&password=123&show_login_form=FALSE
-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}