aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/ServiceAuth/CompoundAuthentication.cs (renamed from OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs)67
1 files changed, 29 insertions, 38 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Framework/ServiceAuth/CompoundAuthentication.cs
index d7198f0..a49952c 100644
--- a/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs
+++ b/OpenSim/Framework/ServiceAuth/CompoundAuthentication.cs
@@ -26,66 +26,57 @@
26 */ 26 */
27 27
28using System; 28using System;
29using OpenMetaverse; 29using System.Collections.Generic;
30using log4net; 30using System.Collections.Specialized;
31using System.Reflection; 31using System.Linq;
32using OpenSim.Framework; 32using System.Net;
33 33
34namespace OpenSim.Region.Framework.Scenes.Scripting 34namespace OpenSim.Framework.ServiceAuth
35{ 35{
36 public class NullScriptHost : IScriptHost 36 public class CompoundAuthentication : IServiceAuth
37 { 37 {
38 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 38 public string Name { get { return "Compound"; } }
39 39
40 private Vector3 m_pos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30); 40 private List<IServiceAuth> m_authentications = new List<IServiceAuth>();
41 41
42 public string Name 42 public int Count { get { return m_authentications.Count; } }
43 {
44 get { return "Object"; }
45 set { }
46 }
47 43
48 public string SitName 44 public List<IServiceAuth> GetAuthentors()
49 { 45 {
50 get { return String.Empty; } 46 return new List<IServiceAuth>(m_authentications);
51 set { }
52 } 47 }
53 48
54 public string TouchName 49 public void AddAuthenticator(IServiceAuth auth)
55 { 50 {
56 get { return String.Empty; } 51 m_authentications.Add(auth);
57 set { }
58 } 52 }
59 53
60 public string Description 54 public void RemoveAuthenticator(IServiceAuth auth)
61 { 55 {
62 get { return String.Empty; } 56 m_authentications.Remove(auth);
63 set { }
64 } 57 }
65 58
66 public UUID UUID 59 public void AddAuthorization(NameValueCollection headers)
67 { 60 {
68 get { return UUID.Zero; } 61 foreach (IServiceAuth auth in m_authentications)
62 auth.AddAuthorization(headers);
69 } 63 }
70 64
71 public UUID OwnerID 65 public bool Authenticate(string data)
72 { 66 {
73 get { return UUID.Zero; } 67 return m_authentications.TrueForAll(a => a.Authenticate(data));
74 } 68 }
75 69
76 public UUID CreatorID 70 public bool Authenticate(NameValueCollection requestHeaders, AddHeaderDelegate d, out HttpStatusCode statusCode)
77 { 71 {
78 get { return UUID.Zero; } 72 foreach (IServiceAuth auth in m_authentications)
79 } 73 {
74 if (!auth.Authenticate(requestHeaders, d, out statusCode))
75 return false;
76 }
80 77
81 public Vector3 AbsolutePosition 78 statusCode = HttpStatusCode.OK;
82 { 79 return true;
83 get { return m_pos; }
84 }
85
86 public void SetText(string text, Vector3 color, double alpha)
87 {
88 m_log.Warn("Tried to SetText "+text+" on NullScriptHost");
89 } 80 }
90 } 81 }
91} 82} \ No newline at end of file