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 ExpiringCache<UUID, UserAccount> m_accountCache;
private bool m_Enabled = false;
#region ISharedRegionModule
@ -65,8 +66,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
public SimianUserAccountServiceConnector() { }
public string Name { get { return "SimianUserAccountServiceConnector"; } }
public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface<IUserAccountService>(this); } }
public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface<IUserAccountService>(this); } }
public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface<IUserAccountService>(this); } }
public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface<IUserAccountService>(this); } }
#endregion ISharedRegionModule
@ -76,6 +77,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
public void Initialise(IConfigSource source)
{
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
{
string name = moduleConfig.GetString("UserAccountServices", "");
if (name == Name)
{
IConfig gridConfig = source.Configs["UserAccountService"];
if (gridConfig != null)
@ -86,12 +93,15 @@ namespace OpenSim.Services.Connectors.SimianGrid
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");
}
}
}
public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
{