diff options
Diffstat (limited to 'OpenSim/Server/Handlers/GridUser')
-rw-r--r-- | OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs | 5 | ||||
-rw-r--r-- | OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs | 21 |
2 files changed, 9 insertions, 17 deletions
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs index 66f35e3..1e29378 100644 --- a/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs +++ b/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using Nini.Config; | 29 | using Nini.Config; |
30 | using OpenSim.Server.Base; | 30 | using OpenSim.Server.Base; |
31 | using OpenSim.Services.Interfaces; | 31 | using OpenSim.Services.Interfaces; |
32 | using OpenSim.Framework.ServiceAuth; | ||
32 | using OpenSim.Framework.Servers.HttpServer; | 33 | using OpenSim.Framework.Servers.HttpServer; |
33 | using OpenSim.Server.Handlers.Base; | 34 | using OpenSim.Server.Handlers.Base; |
34 | 35 | ||
@@ -55,7 +56,9 @@ namespace OpenSim.Server.Handlers.GridUser | |||
55 | Object[] args = new Object[] { config }; | 56 | Object[] args = new Object[] { config }; |
56 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(service, args); | 57 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(service, args); |
57 | 58 | ||
58 | server.AddStreamHandler(new GridUserServerPostHandler(m_GridUserService)); | 59 | IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName); ; |
60 | |||
61 | server.AddStreamHandler(new GridUserServerPostHandler(m_GridUserService, auth)); | ||
59 | } | 62 | } |
60 | } | 63 | } |
61 | } | 64 | } |
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs index 9199c68..b63b594 100644 --- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs +++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs | |||
@@ -39,6 +39,7 @@ using System.Collections.Generic; | |||
39 | using OpenSim.Server.Base; | 39 | using OpenSim.Server.Base; |
40 | using OpenSim.Services.Interfaces; | 40 | using OpenSim.Services.Interfaces; |
41 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
42 | using OpenSim.Framework.ServiceAuth; | ||
42 | using OpenSim.Framework.Servers.HttpServer; | 43 | using OpenSim.Framework.Servers.HttpServer; |
43 | using OpenMetaverse; | 44 | using OpenMetaverse; |
44 | 45 | ||
@@ -50,8 +51,8 @@ namespace OpenSim.Server.Handlers.GridUser | |||
50 | 51 | ||
51 | private IGridUserService m_GridUserService; | 52 | private IGridUserService m_GridUserService; |
52 | 53 | ||
53 | public GridUserServerPostHandler(IGridUserService service) : | 54 | public GridUserServerPostHandler(IGridUserService service, IServiceAuth auth) : |
54 | base("POST", "/griduser") | 55 | base("POST", "/griduser", auth) |
55 | { | 56 | { |
56 | m_GridUserService = service; | 57 | m_GridUserService = service; |
57 | } | 58 | } |
@@ -281,7 +282,7 @@ namespace OpenSim.Server.Handlers.GridUser | |||
281 | 282 | ||
282 | rootElement.AppendChild(result); | 283 | rootElement.AppendChild(result); |
283 | 284 | ||
284 | return DocToBytes(doc); | 285 | return Util.DocToBytes(doc); |
285 | } | 286 | } |
286 | 287 | ||
287 | private byte[] FailureResult() | 288 | private byte[] FailureResult() |
@@ -303,20 +304,8 @@ namespace OpenSim.Server.Handlers.GridUser | |||
303 | 304 | ||
304 | rootElement.AppendChild(result); | 305 | rootElement.AppendChild(result); |
305 | 306 | ||
306 | return DocToBytes(doc); | 307 | return Util.DocToBytes(doc); |
307 | } | 308 | } |
308 | 309 | ||
309 | private byte[] DocToBytes(XmlDocument doc) | ||
310 | { | ||
311 | MemoryStream ms = new MemoryStream(); | ||
312 | XmlTextWriter xw = new XmlTextWriter(ms, null); | ||
313 | xw.Formatting = Formatting.Indented; | ||
314 | doc.WriteTo(xw); | ||
315 | xw.Flush(); | ||
316 | |||
317 | return ms.ToArray(); | ||
318 | } | ||
319 | |||
320 | |||
321 | } | 310 | } |
322 | } | 311 | } |