aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2010-09-05 17:44:02 +0100
committerMelanie2010-09-05 17:44:02 +0100
commita407ad38f602614655d1fba776d7721417967761 (patch)
treea497395299b24cc511004497e325d672e5447f9d /OpenSim
parentAdd m_Enabled pattern to SimianGridConnector (diff)
downloadopensim-SC-a407ad38f602614655d1fba776d7721417967761.zip
opensim-SC-a407ad38f602614655d1fba776d7721417967761.tar.gz
opensim-SC-a407ad38f602614655d1fba776d7721417967761.tar.bz2
opensim-SC-a407ad38f602614655d1fba776d7721417967761.tar.xz
Add the m_Enabled pattern to Simian Auth
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs34
1 files changed, 22 insertions, 12 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
index f1c2575..0ce8db8 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
@@ -51,6 +51,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
51 MethodBase.GetCurrentMethod().DeclaringType); 51 MethodBase.GetCurrentMethod().DeclaringType);
52 52
53 private string m_serverUrl = String.Empty; 53 private string m_serverUrl = String.Empty;
54 private bool m_Enabled = false;
54 55
55 #region ISharedRegionModule 56 #region ISharedRegionModule
56 57
@@ -61,8 +62,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
61 62
62 public SimianAuthenticationServiceConnector() { } 63 public SimianAuthenticationServiceConnector() { }
63 public string Name { get { return "SimianAuthenticationServiceConnector"; } } 64 public string Name { get { return "SimianAuthenticationServiceConnector"; } }
64 public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IAuthenticationService>(this); } } 65 public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IAuthenticationService>(this); } }
65 public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IAuthenticationService>(this); } } 66 public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IAuthenticationService>(this); } }
66 67
67 #endregion ISharedRegionModule 68 #endregion ISharedRegionModule
68 69
@@ -73,20 +74,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
73 74
74 public void Initialise(IConfigSource source) 75 public void Initialise(IConfigSource source)
75 { 76 {
76 IConfig gridConfig = source.Configs["AuthenticationService"]; 77 IConfig moduleConfig = source.Configs["Modules"];
77 if (gridConfig != null) 78 if (moduleConfig != null)
78 { 79 {
79 string serviceUrl = gridConfig.GetString("AuthenticationServerURI"); 80 string name = moduleConfig.GetString("AssetServices", "");
80 if (!String.IsNullOrEmpty(serviceUrl)) 81 if (name == Name)
81 { 82 {
82 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) 83 IConfig gridConfig = source.Configs["AuthenticationService"];
83 serviceUrl = serviceUrl + '/'; 84 if (gridConfig != null)
84 m_serverUrl = serviceUrl; 85 {
86 string serviceUrl = gridConfig.GetString("AuthenticationServerURI");
87 if (!String.IsNullOrEmpty(serviceUrl))
88 {
89 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
90 serviceUrl = serviceUrl + '/';
91 m_serverUrl = serviceUrl;
92 m_Enabled = true;
93 }
94 }
95
96 if (String.IsNullOrEmpty(m_serverUrl))
97 m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector");
85 } 98 }
86 } 99 }
87
88 if (String.IsNullOrEmpty(m_serverUrl))
89 m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector");
90 } 100 }
91 101
92 public string Authenticate(UUID principalID, string password, int lifetime) 102 public string Authenticate(UUID principalID, string password, int lifetime)