Change UserAccountService to match

viewer-2-initial-appearance
Melanie 2010-09-05 19:09:30 +01:00
parent 4243701d22
commit 1b770d3afc
1 changed files with 22 additions and 12 deletions

View File

@ -55,6 +55,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
private string m_serverUrl = String.Empty; private string m_serverUrl = String.Empty;
private ExpiringCache<UUID, UserAccount> m_accountCache; private ExpiringCache<UUID, UserAccount> m_accountCache;
private bool m_Enabled = false;
#region ISharedRegionModule #region ISharedRegionModule
@ -65,8 +66,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
public SimianUserAccountServiceConnector() { } public SimianUserAccountServiceConnector() { }
public string Name { get { return "SimianUserAccountServiceConnector"; } } public string Name { get { return "SimianUserAccountServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IUserAccountService>(this); } } public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IUserAccountService>(this); } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IUserAccountService>(this); } } public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IUserAccountService>(this); } }
#endregion ISharedRegionModule #endregion ISharedRegionModule
@ -77,20 +78,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
{ {
IConfig gridConfig = source.Configs["UserAccountService"]; IConfig moduleConfig = source.Configs["Modules"];
if (gridConfig != null) if (moduleConfig != null)
{ {
string serviceUrl = gridConfig.GetString("UserAccountServerURI"); string name = moduleConfig.GetString("UserAccountServices", "");
if (!String.IsNullOrEmpty(serviceUrl)) if (name == Name)
{ {
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) IConfig gridConfig = source.Configs["UserAccountService"];
serviceUrl = serviceUrl + '/'; if (gridConfig != null)
m_serverUrl = serviceUrl; {
string serviceUrl = gridConfig.GetString("UserAccountServerURI");
if (!String.IsNullOrEmpty(serviceUrl))
{
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl;
m_Enabled = true;
}
}
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector");
} }
} }
if (String.IsNullOrEmpty(m_serverUrl))
m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector");
} }
public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)