From a962653e04e8b1d06b36224bf20e85b3462197db Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 10 Jan 2008 04:37:03 +0000 Subject: * After fighting with it a bit more, Opensim is now compatible with the most recent release client(RC) on the linden labs download page. * Don't forget, you need -loginuri *and* -loginpage * Ex: -loginpage http://10.1.1.2:8002/?method=login -loginuri http://10.1.1.2:8002/ * The ?method=login is important, don't forget to add it * If you customize your http_loginform.html file, be sure to keep the form post address as is. --- OpenSim/Framework/Communications/LoginService.cs | 61 ++++++++++++------------ OpenSim/Framework/Servers/BaseHttpServer.cs | 39 ++++++++++----- bin/http_loginform.html.example | 2 +- 3 files changed, 57 insertions(+), 45 deletions(-) diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 04b8501..8317073 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -421,45 +421,44 @@ namespace OpenSim.Framework.UserManagement if (keysvals.ContainsKey("show_login_form")) { - if ((string)keysvals["show_login_form"] == "TRUE") + + UserProfileData user = GetTheUser(firstname, lastname); + bool goodweblogin = false; + + if (user != null) + goodweblogin = AuthenticateUser(user, password); + + if (goodweblogin) { + LLUUID webloginkey = LLUUID.Random(); + m_userManager.StoreWebLoginKey(user.UUID, webloginkey); + statuscode = 301; + + string redirectURL = "about:blank?redirect-http-hack=" + System.Web.HttpUtility.UrlEncode("secondlife:///app/login?first_name=" + firstname + "&last_name=" + + lastname + + "&location=" + location + "&grid=Other&web_login_key=" + webloginkey.ToString()); + //MainLog.Instance.Verbose("WEB", "R:" + redirectURL); returnactions["int_response_code"] = statuscode; - returnactions["str_response_string"] = loginform; + returnactions["str_redirect_location"] = redirectURL; + returnactions["str_response_string"] = "
GoodLogin"; } else { - UserProfileData user = GetTheUser(firstname, lastname); - bool goodweblogin = false; - - if (user != null) - goodweblogin = AuthenticateUser(user, password); + errormessages = "The Username and password supplied did not match our records. Check your caps lock and try again"; - if (goodweblogin) - { - LLUUID webloginkey = LLUUID.Random(); - m_userManager.StoreWebLoginKey(user.UUID, webloginkey); - statuscode = 301; - - string redirectURL = "secondlife:///app/login?first_name=" + firstname + "&last_name=" + - lastname + - "&location=" + location + "&grid=Other&web_login_key=" + webloginkey.ToString(); - - returnactions["int_response_code"] = statuscode; - returnactions["str_redirect_location"] = redirectURL; - returnactions["str_response_string"] = "GoodLogin"; - } - else - { - errormessages = "The Username and password supplied did not match our records. Check your caps lock and try again"; - - loginform = GetLoginForm(firstname, lastname, location, region, grid, channel, version, lang, password, errormessages); - returnactions["int_response_code"] = statuscode; - returnactions["str_response_string"] = loginform; - - } + loginform = GetLoginForm(firstname, lastname, location, region, grid, channel, version, lang, password, errormessages); + returnactions["int_response_code"] = statuscode; + returnactions["str_response_string"] = loginform; } + + + } + else + { + returnactions["int_response_code"] = statuscode; + returnactions["str_response_string"] = loginform; } return returnactions; @@ -511,7 +510,7 @@ namespace OpenSim.Framework.UserManagement responseString = responseString + "