aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs34
1 files changed, 22 insertions, 12 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
index 4c8662f..deb8695 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
55 55
56 private string m_serverUrl = String.Empty; 56 private string m_serverUrl = String.Empty;
57 private ExpiringCache<UUID, UserAccount> m_accountCache; 57 private ExpiringCache<UUID, UserAccount> m_accountCache;
58 private bool m_Enabled = false;
58 59
59 #region ISharedRegionModule 60 #region ISharedRegionModule
60 61
@@ -65,8 +66,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
65 66
66 public SimianUserAccountServiceConnector() { } 67 public SimianUserAccountServiceConnector() { }
67 public string Name { get { return "SimianUserAccountServiceConnector"; } } 68 public string Name { get { return "SimianUserAccountServiceConnector"; } }
68 public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IUserAccountService>(this); } } 69 public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IUserAccountService>(this); } }
69 public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IUserAccountService>(this); } } 70 public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IUserAccountService>(this); } }
70 71
71 #endregion ISharedRegionModule 72 #endregion ISharedRegionModule
72 73
@@ -77,20 +78,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
77 78
78 public void Initialise(IConfigSource source) 79 public void Initialise(IConfigSource source)
79 { 80 {
80 IConfig gridConfig = source.Configs["UserAccountService"]; 81 IConfig moduleConfig = source.Configs["Modules"];
81 if (gridConfig != null) 82 if (moduleConfig != null)
82 { 83 {
83 string serviceUrl = gridConfig.GetString("UserAccountServerURI"); 84 string name = moduleConfig.GetString("UserAccountServices", "");
84 if (!String.IsNullOrEmpty(serviceUrl)) 85 if (name == Name)
85 { 86 {
86 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) 87 IConfig gridConfig = source.Configs["UserAccountService"];
87 serviceUrl = serviceUrl + '/'; 88 if (gridConfig != null)
88 m_serverUrl = serviceUrl; 89 {
90 string serviceUrl = gridConfig.GetString("UserAccountServerURI");
91 if (!String.IsNullOrEmpty(serviceUrl))
92 {
93 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
94 serviceUrl = serviceUrl + '/';
95 m_serverUrl = serviceUrl;
96 m_Enabled = true;
97 }
98 }
99
100 if (String.IsNullOrEmpty(m_serverUrl))
101 m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector");
89 } 102 }
90 } 103 }
91
92 if (String.IsNullOrEmpty(m_serverUrl))
93 m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector");
94 } 104 }
95 105
96 public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) 106 public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)