diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs index 0dc33387fc..bf57492ce4 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs @@ -95,6 +95,22 @@ namespace OpenSim.Framework.Data.MSSQL MainLog.Instance.Verbose("DATASTORE", "MSSQL Database doesn't exist... creating"); InitDB(conn); } + cmd = Query("select top 1 webLoginKey from users", new Dictionary()); + try + { + conn.Open(); + cmd.ExecuteNonQuery(); + cmd.Dispose(); + conn.Close(); + } + catch (Exception) + { + conn.Open(); + cmd = Query("alter table users add column [webLoginKey] varchar(36) default NULL", new Dictionary()); + cmd.ExecuteNonQuery(); + cmd.Dispose(); + conn.Close(); + } return true; } @@ -380,6 +396,7 @@ namespace OpenSim.Framework.Data.MSSQL retval.profileImage = new LLUUID((string) reader["profileImage"]); retval.profileFirstImage = new LLUUID((string) reader["profileFirstImage"]); + retval.webLoginKey = new LLUUID((string)reader["webLoginKey"]); } else { @@ -595,7 +612,7 @@ namespace OpenSim.Framework.Data.MSSQL float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, string aboutText, string firstText, - LLUUID profileImage, LLUUID firstImage) + LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey) { string sql = "INSERT INTO users "; sql += "([UUID], [username], [lastname], [passwordHash], [passwordSalt], [homeRegion], "; @@ -603,14 +620,14 @@ namespace OpenSim.Framework.Data.MSSQL "[homeLocationX], [homeLocationY], [homeLocationZ], [homeLookAtX], [homeLookAtY], [homeLookAtZ], [created], "; sql += "[lastLogin], [userInventoryURI], [userAssetURI], [profileCanDoMask], [profileWantDoMask], [profileAboutText], "; - sql += "[profileFirstText], [profileImage], [profileFirstImage]) VALUES "; + sql += "[profileFirstText], [profileImage], [profileFirstImage], [webLoginKey]) VALUES "; sql += "(@UUID, @username, @lastname, @passwordHash, @passwordSalt, @homeRegion, "; sql += "@homeLocationX, @homeLocationY, @homeLocationZ, @homeLookAtX, @homeLookAtY, @homeLookAtZ, @created, "; sql += "@lastLogin, @userInventoryURI, @userAssetURI, @profileCanDoMask, @profileWantDoMask, @profileAboutText, "; - sql += "@profileFirstText, @profileImage, @profileFirstImage);"; + sql += "@profileFirstText, @profileImage, @profileFirstImage, @webLoginKey);"; Dictionary parameters = new Dictionary(); parameters["UUID"] = uuid.ToString(); @@ -635,6 +652,7 @@ namespace OpenSim.Framework.Data.MSSQL parameters["profileFirstText"] = ""; parameters["profileImage"] = LLUUID.Zero.ToString(); parameters["profileFirstImage"] = LLUUID.Zero.ToString(); + parameters["webLoginKey"] = LLUUID.Random().ToString(); bool returnval = false; diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs index f8a951e693..db3c1d624d 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLUserData.cs @@ -315,7 +315,7 @@ namespace OpenSim.Framework.Data.MSSQL user.lastLogin, user.userInventoryURI, user.userAssetURI, user.profileCanDoMask, user.profileWantDoMask, user.profileAboutText, user.profileFirstText, user.profileImage, - user.profileFirstImage); + user.profileFirstImage,user.webLoginKey); } } catch (Exception e) diff --git a/OpenSim/Framework/Data.MSSQL/Resources/Mssql-users.sql b/OpenSim/Framework/Data.MSSQL/Resources/Mssql-users.sql index 3f5f8966aa..abcc091835 100644 --- a/OpenSim/Framework/Data.MSSQL/Resources/Mssql-users.sql +++ b/OpenSim/Framework/Data.MSSQL/Resources/Mssql-users.sql @@ -27,6 +27,7 @@ CREATE TABLE [users] ( [profileFirstText] [ntext], [profileImage] [varchar](36) default NULL, [profileFirstImage] [varchar](36) default NULL, + [webLoginKey] [varchar](36) default NULL, PRIMARY KEY CLUSTERED ( [UUID] ASC diff --git a/OpenSim/Framework/Data.MySQL/MySQLManager.cs b/OpenSim/Framework/Data.MySQL/MySQLManager.cs index 9532f21f79..223d902a1d 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLManager.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLManager.cs @@ -446,6 +446,7 @@ namespace OpenSim.Framework.Data.MySQL retval.profileImage = new LLUUID((string) reader["profileImage"]); retval.profileFirstImage = new LLUUID((string) reader["profileFirstImage"]); + retval.webLoginKey = new LLUUID((string)reader["webLoginKey"]); } else { @@ -531,7 +532,7 @@ namespace OpenSim.Framework.Data.MySQL float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, string aboutText, string firstText, - LLUUID profileImage, LLUUID firstImage) + LLUUID profileImage, LLUUID firstImage, LLUUID webLoginKey) { string sql = "INSERT INTO users (`UUID`, `username`, `lastname`, `passwordHash`, `passwordSalt`, `homeRegion`, "; @@ -539,14 +540,14 @@ namespace OpenSim.Framework.Data.MySQL "`homeLocationX`, `homeLocationY`, `homeLocationZ`, `homeLookAtX`, `homeLookAtY`, `homeLookAtZ`, `created`, "; sql += "`lastLogin`, `userInventoryURI`, `userAssetURI`, `profileCanDoMask`, `profileWantDoMask`, `profileAboutText`, "; - sql += "`profileFirstText`, `profileImage`, `profileFirstImage`) VALUES "; + sql += "`profileFirstText`, `profileImage`, `profileFirstImage`, `webLoginKey`) VALUES "; sql += "(?UUID, ?username, ?lastname, ?passwordHash, ?passwordSalt, ?homeRegion, "; sql += "?homeLocationX, ?homeLocationY, ?homeLocationZ, ?homeLookAtX, ?homeLookAtY, ?homeLookAtZ, ?created, "; sql += "?lastLogin, ?userInventoryURI, ?userAssetURI, ?profileCanDoMask, ?profileWantDoMask, ?profileAboutText, "; - sql += "?profileFirstText, ?profileImage, ?profileFirstImage)"; + sql += "?profileFirstText, ?profileImage, ?profileFirstImage, ?webLoginKey)"; Dictionary parameters = new Dictionary(); parameters["?UUID"] = uuid.ToString(); @@ -571,6 +572,7 @@ namespace OpenSim.Framework.Data.MySQL parameters["?profileFirstText"] = ""; parameters["?profileImage"] = LLUUID.Zero.ToString(); parameters["?profileFirstImage"] = LLUUID.Zero.ToString(); + parameters["?webLoginKey"] = LLUUID.Random().ToString(); bool returnval = false; diff --git a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs index 7e2d4f0cc9..e53ab189bd 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs @@ -114,6 +114,12 @@ namespace OpenSim.Framework.Data.MySQL database.ExecuteResourceSql("CreateUsersTable.sql"); return; } + else if (oldVersion.Contains("Rev. 1")) + { + database.ExecuteResourceSql("UpgradeUsersTableToVersion2.sql"); + return; + } + //MainLog.Instance.Verbose("DB","DBVers:" + oldVersion); } /// @@ -512,7 +518,7 @@ namespace OpenSim.Framework.Data.MySQL user.lastLogin, user.userInventoryURI, user.userAssetURI, user.profileCanDoMask, user.profileWantDoMask, user.profileAboutText, user.profileFirstText, user.profileImage, - user.profileFirstImage); + user.profileFirstImage, user.webLoginKey); } } catch (Exception e) diff --git a/OpenSim/Framework/Data.MySQL/Resources/CreateUsersTable.sql b/OpenSim/Framework/Data.MySQL/Resources/CreateUsersTable.sql index faac541d38..d9e8ae202b 100644 --- a/OpenSim/Framework/Data.MySQL/Resources/CreateUsersTable.sql +++ b/OpenSim/Framework/Data.MySQL/Resources/CreateUsersTable.sql @@ -25,9 +25,10 @@ CREATE TABLE `users` ( `profileFirstText` text, `profileImage` varchar(36) default NULL, `profileFirstImage` varchar(36) default NULL, + `webLoginKey` varchar(36) default NULL, PRIMARY KEY (`UUID`), UNIQUE KEY `usernames` (`username`,`lastname`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 2'; -- ---------------------------- -- Records diff --git a/OpenSim/Framework/Data.MySQL/Resources/UpgradeUsersTableToVersion2.sql b/OpenSim/Framework/Data.MySQL/Resources/UpgradeUsersTableToVersion2.sql new file mode 100644 index 0000000000..99a84a8399 --- /dev/null +++ b/OpenSim/Framework/Data.MySQL/Resources/UpgradeUsersTableToVersion2.sql @@ -0,0 +1,3 @@ +ALTER TABLE `users` + ADD COLUMN `webLoginKey` varchar(36) default NULL, +COMMENT='Rev. 2'; \ No newline at end of file diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs index e9a8eca631..cbbb3491a7 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs @@ -549,6 +549,7 @@ namespace OpenSim.Framework.Data.SQLite createCol(users, "profileFirstText", typeof (String)); createCol(users, "profileImage", typeof (String)); createCol(users, "profileFirstImage", typeof (String)); + createCol(users, "webLoginKey", typeof(String)); // Add in contraints users.PrimaryKey = new DataColumn[] {users.Columns["UUID"]}; return users; @@ -635,6 +636,8 @@ namespace OpenSim.Framework.Data.SQLite user.profileFirstText = (String) row["profileFirstText"]; user.profileImage = new LLUUID((String) row["profileImage"]); user.profileFirstImage = new LLUUID((String) row["profileFirstImage"]); + user.webLoginKey = new LLUUID((String) row["webLoginKey"]); + return user; } @@ -681,6 +684,7 @@ namespace OpenSim.Framework.Data.SQLite row["profileFirstText"] = user.profileFirstText; row["profileImage"] = user.profileImage; row["profileFirstImage"] = user.profileFirstImage; + row["webLoginKey"] = user.webLoginKey; // ADO.NET doesn't handle NULL very well foreach (DataColumn col in ds.Tables["users"].Columns) @@ -825,6 +829,23 @@ namespace OpenSim.Framework.Data.SQLite MainLog.Instance.Verbose("DATASTORE", "SQLite Database doesn't exist... creating"); InitDB(conn); } + conn.Open(); + try + { + cmd = new SqliteCommand("select webLoginKey from users limit 1;", conn); + cmd.ExecuteNonQuery(); + } + catch (SqliteSyntaxException) + { + cmd = new SqliteCommand("alter table users add column webLoginKey text default '00000000-0000-0000-0000-000000000000';", conn); + cmd.ExecuteNonQuery(); + pDa.Fill(tmpDS, "users"); + } + finally + { + conn.Close(); + } + return true; } } diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 004b330e9b..32d65af243 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -46,6 +46,8 @@ namespace OpenSim.Framework.Servers protected Dictionary m_rpcHandlers = new Dictionary(); protected LLSDMethod m_llsdHandler = null; protected Dictionary m_streamHandlers = new Dictionary(); + protected Dictionary m_HTTPHandlers = new Dictionary(); + protected uint m_port; protected bool m_ssl = false; protected bool m_firstcaps = true; @@ -92,6 +94,18 @@ namespace OpenSim.Framework.Servers return false; } + public bool AddHTTPHandler(string method, GenericHTTPMethod handler) + { + if (!m_HTTPHandlers.ContainsKey(method)) + { + m_HTTPHandlers.Add(method, handler); + return true; + } + + //must already have a handler for that path so return false + return false; + } + public bool SetLLSDHandler(LLSDMethod handler) { m_llsdHandler = handler; @@ -145,6 +159,10 @@ namespace OpenSim.Framework.Servers { switch (request.ContentType) { + case null: + case "text/html": + HandleHTTPRequest(request, response); + break; case "application/xml+llsd": HandleLLSDRequests(request, response); break; @@ -184,6 +202,32 @@ namespace OpenSim.Framework.Servers } } + private bool TryGetHTTPHandler(string handlerKey, out GenericHTTPMethod HTTPHandler) + { + string bestMatch = null; + + foreach (string pattern in m_HTTPHandlers.Keys) + { + if (handlerKey.StartsWith(pattern)) + { + if (String.IsNullOrEmpty(bestMatch) || pattern.Length > bestMatch.Length) + { + bestMatch = pattern; + } + } + } + + if (String.IsNullOrEmpty(bestMatch)) + { + HTTPHandler = null; + return false; + } + else + { + HTTPHandler = m_HTTPHandlers[bestMatch]; + return true; + } + } private void HandleXmlRpcRequests(HttpListenerRequest request, HttpListenerResponse response) { Stream requestStream = request.InputStream; @@ -204,27 +248,7 @@ namespace OpenSim.Framework.Servers } catch (XmlException e) { - Hashtable keysvals = new Hashtable(); - responseString = String.Format("XmlException:\n{0}", e.Message); - MainLog.Instance.Error("XML", responseString); - string[] querystringkeys = request.QueryString.AllKeys; - string[] rHeaders = request.Headers.AllKeys; - - - foreach (string queryname in querystringkeys) - { - keysvals.Add(queryname, request.QueryString[queryname]); - MainLog.Instance.Warn("HTTP", queryname + "=" + request.QueryString[queryname]); - } - foreach (string headername in rHeaders) - { - MainLog.Instance.Warn("HEADER", headername + "=" + request.Headers[headername]); - } - if (keysvals.ContainsKey("show_login_form")) - { - HandleHTTPRequest(keysvals, request, response); - return; - } + } if (xmlRprcRequest != null) @@ -332,7 +356,7 @@ namespace OpenSim.Framework.Servers } } - public void HandleHTTPRequest(Hashtable keysvals, HttpListenerRequest request, HttpListenerResponse response) + public void HandleHTTPRequest(HttpListenerRequest request, HttpListenerResponse response) { // This is a test. There's a workable alternative.. as this way sucks. // We'd like to put this into a text file parhaps that's easily editable. @@ -345,119 +369,146 @@ namespace OpenSim.Framework.Servers // I depend on show_login_form being in the secondlife.exe parameters to figure out // to display the form, or process it. // a better way would be nifty. + Stream requestStream = request.InputStream; - if ((string) keysvals["show_login_form"] == "TRUE") + Encoding encoding = Encoding.UTF8; + StreamReader reader = new StreamReader(requestStream, encoding); + + string requestBody = reader.ReadToEnd(); + reader.Close(); + requestStream.Close(); + + string responseString = String.Empty; + + Hashtable keysvals = new Hashtable(); + + string[] querystringkeys = request.QueryString.AllKeys; + string[] rHeaders = request.Headers.AllKeys; + + + foreach (string queryname in querystringkeys) { - string responseString = - ""; - responseString = responseString + ""; - responseString = responseString + ""; - responseString = responseString + - ""; - responseString = responseString + ""; - responseString = responseString + ""; - responseString = responseString + "Second Life Login"; - responseString = responseString + ""; - responseString = responseString + "
"; - // Linden Grid Form Post - //responseString = responseString + "
"; - responseString = responseString + ""; - - responseString = responseString + "
"; - responseString = responseString + "
"; - responseString = responseString + "
"; - responseString = responseString + "First Name:"; - responseString = responseString + - ""; - responseString = responseString + "
"; - responseString = responseString + "
"; - responseString = responseString + "Last Name:"; - responseString = responseString + - ""; - responseString = responseString + "
"; - responseString = responseString + "
"; - responseString = responseString + "Password:"; - responseString = responseString + ""; - responseString = responseString + ""; - responseString = responseString + - ""; - responseString = responseString + ""; - responseString = responseString + ""; - responseString = responseString + - ""; - responseString = responseString + ""; - responseString = responseString + ""; - responseString = responseString + "
"; - responseString = responseString + "
"; - responseString = responseString + ""; - responseString = responseString + ""; - responseString = responseString + "
"; - responseString = responseString + ""; - responseString = responseString + "
"; - responseString = responseString + - "
Connecting...
"; - - responseString = responseString + "
"; - responseString = responseString + - "Create new account | "; - responseString = responseString + - "Forgot password?"; - responseString = responseString + "
"; - - responseString = responseString + "
" + keysvals["channel"] + " | " + - keysvals["version"] + "=" + keysvals["lang"] + "
"; - responseString = responseString + "
"; - responseString = responseString + ""; - responseString = responseString + "
"; - responseString = responseString + ""; - responseString = responseString + ""; - responseString = responseString + ""; - response.AddHeader("Content-type", "text/html"); - - byte[] buffer = Encoding.UTF8.GetBytes(responseString); - - response.SendChunked = false; - response.ContentLength64 = buffer.Length; - response.ContentEncoding = Encoding.UTF8; - try + keysvals.Add(queryname, request.QueryString[queryname]); + MainLog.Instance.Warn("HTTP", queryname + "=" + request.QueryString[queryname]); + } + //foreach (string headername in rHeaders) + //{ + //MainLog.Instance.Warn("HEADER", headername + "=" + request.Headers[headername]); + //} + if (keysvals.Contains("method")) + { + MainLog.Instance.Warn("HTTP", "Contains Method"); + string method = (string) keysvals["method"]; + MainLog.Instance.Warn("HTTP", requestBody); + GenericHTTPMethod requestprocessor; + bool foundHandler = TryGetHTTPHandler(method, out requestprocessor); + if (foundHandler) { - response.OutputStream.Write(buffer, 0, buffer.Length); + Hashtable responsedata = requestprocessor(keysvals); + DoHTTPGruntWork(responsedata,response); + + //SendHTML500(response); + } - catch (Exception ex) + else { - MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); + MainLog.Instance.Warn("HTTP", "Handler Not Found"); + SendHTML404(response); } - finally - { - response.OutputStream.Close(); - } - } // show_login_form == "TRUE" + } else { - // show_login_form is present but FALSE - // - // The idea here is that we're telling the client to log in immediately here using the following information - // For my testing, I'm hard coding the web_login_key temporarily. - // Telling the client to go to the new improved SLURL for immediate logins + MainLog.Instance.Warn("HTTP", "No Method specified"); + SendHTML404(response); + } + } - // The fact that it says grid=Other is important + private void DoHTTPGruntWork(Hashtable responsedata, HttpListenerResponse response) + { + int responsecode = (int)responsedata["int_response_code"]; + string responseString = (string)responsedata["str_response_string"]; + + // We're forgoing the usual error status codes here because the client + // ignores anything but 200 and 301 - // + response.StatusCode = 200; - response.StatusCode = 301; - response.RedirectLocation = "secondlife:///app/login?first_name=" + keysvals["username"] + "&last_name=" + - keysvals["lastname"] + - "&location=home&grid=other&web_login_key=796f2b2a-0131-41e4-af12-00f60c24c458"; + if (responsecode == 301) + { + response.RedirectLocation = (string)responsedata["str_redirect_location"]; + response.StatusCode = responsecode; + } + response.AddHeader("Content-type", "text/html"); + byte[] buffer = Encoding.UTF8.GetBytes(responseString); + + response.SendChunked = false; + response.ContentLength64 = buffer.Length; + response.ContentEncoding = Encoding.UTF8; + try + { + response.OutputStream.Write(buffer, 0, buffer.Length); + } + catch (Exception ex) + { + MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); + } + finally + { response.OutputStream.Close(); - } // show_login_form == "FALSE" + } + + + } + public void SendHTML404(HttpListenerResponse response) + { + // I know this statuscode is dumb, but the client doesn't respond to 404s and 500s + response.StatusCode = 200; + response.AddHeader("Content-type", "text/html"); + + string responseString = GetHTTP404(); + byte[] buffer = Encoding.UTF8.GetBytes(responseString); + + response.SendChunked = false; + response.ContentLength64 = buffer.Length; + response.ContentEncoding = Encoding.UTF8; + try + { + response.OutputStream.Write(buffer, 0, buffer.Length); + } + catch (Exception ex) + { + MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); + } + finally + { + response.OutputStream.Close(); + } + } + public void SendHTML500(HttpListenerResponse response) + { + // I know this statuscode is dumb, but the client doesn't respond to 404s and 500s + response.StatusCode = 200; + response.AddHeader("Content-type", "text/html"); + + string responseString = GetHTTP500(); + byte[] buffer = Encoding.UTF8.GetBytes(responseString); + + response.SendChunked = false; + response.ContentLength64 = buffer.Length; + response.ContentEncoding = Encoding.UTF8; + try + { + response.OutputStream.Write(buffer, 0, buffer.Length); + } + catch (Exception ex) + { + MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); + } + finally + { + response.OutputStream.Close(); + } } public void Start() @@ -504,5 +555,46 @@ namespace OpenSim.Framework.Servers { m_streamHandlers.Remove(GetHandlerKey(httpMethod, path)); } + + public void RemoveHTTPHandler(string httpMethod, string path) + { + m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path)); + } + + public string GetHTTP404() + { + string file = Path.Combine(Util.configDir(), "http_404.html"); + if (!File.Exists(file)) + return getDefaultHTTP404(); + + StreamReader sr = File.OpenText(file); + string result = sr.ReadToEnd(); + sr.Close(); + return result; + } + + public string GetHTTP500() + { + string file = Path.Combine(Util.configDir(), "http_500.html"); + if (!File.Exists(file)) + return getDefaultHTTP500(); + + StreamReader sr = File.OpenText(file); + string result = sr.ReadToEnd(); + sr.Close(); + return result; + } + + // Fallback HTTP responses in case the HTTP error response files don't exist + private string getDefaultHTTP404() + { + return "404 Page not found

Ooops!

The page you requested has been obsconded with by knomes. Find hippos quick!

"; + } + + private string getDefaultHTTP500() + { + return "500 Internal Server Error

Ooops!

The server you requested is overun by knomes! Find hippos quick!

"; + } + } } diff --git a/OpenSim/Framework/Servers/GenericHTTPMethod.cs b/OpenSim/Framework/Servers/GenericHTTPMethod.cs new file mode 100644 index 0000000000..76aa8fe852 --- /dev/null +++ b/OpenSim/Framework/Servers/GenericHTTPMethod.cs @@ -0,0 +1,34 @@ +/* +* Copyright (c) Contributors, http://opensimulator.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +using System; +using System.Collections; + +namespace OpenSim.Framework.Servers +{ + public delegate Hashtable GenericHTTPMethod(Hashtable request); +} \ No newline at end of file diff --git a/OpenSim/Framework/Servers/IStreamHandler.cs b/OpenSim/Framework/Servers/IStreamHandler.cs index c87937a505..d52f9ac41f 100644 --- a/OpenSim/Framework/Servers/IStreamHandler.cs +++ b/OpenSim/Framework/Servers/IStreamHandler.cs @@ -25,7 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ - +using System.Collections; using System.IO; namespace OpenSim.Framework.Servers @@ -40,6 +40,7 @@ namespace OpenSim.Framework.Servers // Return path string Path { get; } + } public interface IStreamedRequestHandler : IRequestHandler @@ -53,4 +54,8 @@ namespace OpenSim.Framework.Servers // Handle request stream, return byte array void Handle(string path, Stream request, Stream response); } + public interface IGenericHTTPHandler : IRequestHandler + { + Hashtable Handle(string path, Hashtable request); + } } \ No newline at end of file diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs index 4df1ebd06c..de44a0d3ef 100644 --- a/OpenSim/Framework/UserProfileData.cs +++ b/OpenSim/Framework/UserProfileData.cs @@ -40,6 +40,10 @@ namespace OpenSim.Framework ///
public LLUUID UUID; + /// + /// The last used Web_login_key + /// + public LLUUID webLoginKey; /// /// The first component of a users account name /// diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 8e6817d68e..02ca385eb3 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -103,6 +103,7 @@ namespace OpenSim.Grid.UserServer BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); + httpServer.SetLLSDHandler(m_loginService.LLSDLoginMethod); httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); diff --git a/bin/http_404.html.example b/bin/http_404.html.example new file mode 100644 index 0000000000..a3216f33c1 --- /dev/null +++ b/bin/http_404.html.example @@ -0,0 +1 @@ +404 Page not found

Ooops!

The page you requested has been obsconded with by knomes. Find hippos quick!

\ No newline at end of file diff --git a/bin/http_500.html.example b/bin/http_500.html.example new file mode 100644 index 0000000000..6b5402d9d9 --- /dev/null +++ b/bin/http_500.html.example @@ -0,0 +1 @@ +500 Internal Server Error

Ooops!

The server you requested is overun by knomes! Find hippos quick!

\ No newline at end of file