aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs (renamed from OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs)47
1 files changed, 15 insertions, 32 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs
index cca5bb4..a053bc2 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/User/LocalUserServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs
@@ -26,24 +26,23 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Reflection;
30using log4net;
31using Nini.Config; 29using Nini.Config;
30using log4net;
31using System.Reflection;
32using OpenSim.Region.Framework.Interfaces; 32using OpenSim.Region.Framework.Interfaces;
33using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
34using OpenSim.Server.Base;
35using OpenSim.Services.Interfaces; 34using OpenSim.Services.Interfaces;
35using OpenSim.Services.Connectors;
36 36
37namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User 37namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication
38{ 38{
39 public class LocalUserServicesConnector : ISharedRegionModule 39 public class RemoteAuthenticationServicesConnector : AuthenticationServicesConnector,
40 ISharedRegionModule, IAuthenticationService
40 { 41 {
41 private static readonly ILog m_log = 42 private static readonly ILog m_log =
42 LogManager.GetLogger( 43 LogManager.GetLogger(
43 MethodBase.GetCurrentMethod().DeclaringType); 44 MethodBase.GetCurrentMethod().DeclaringType);
44 45
45 private IUserAccountService m_UserService;
46
47 private bool m_Enabled = false; 46 private bool m_Enabled = false;
48 47
49 public Type ReplaceableInterface 48 public Type ReplaceableInterface
@@ -53,45 +52,29 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
53 52
54 public string Name 53 public string Name
55 { 54 {
56 get { return "LocalUserServicesConnector"; } 55 get { return "RemoteAuthenticationServicesConnector"; }
57 } 56 }
58 57
59 public void Initialise(IConfigSource source) 58 public override void Initialise(IConfigSource source)
60 { 59 {
61 IConfig moduleConfig = source.Configs["Modules"]; 60 IConfig moduleConfig = source.Configs["Modules"];
62 if (moduleConfig != null) 61 if (moduleConfig != null)
63 { 62 {
64 string name = moduleConfig.GetString("UserServices", ""); 63 string name = moduleConfig.GetString("AuthenticationServices", "");
65 if (name == Name) 64 if (name == Name)
66 { 65 {
67 IConfig userConfig = source.Configs["UserService"]; 66 IConfig userConfig = source.Configs["AuthenticationService"];
68 if (userConfig == null) 67 if (userConfig == null)
69 { 68 {
70 m_log.Error("[USER CONNECTOR]: UserService missing from OpenSim.ini"); 69 m_log.Error("[AUTH CONNECTOR]: AuthenticationService missing from OpenSim.ini");
71 return; 70 return;
72 } 71 }
73 72
74 string serviceDll = userConfig.GetString("LocalServiceModule", 73 m_Enabled = true;
75 String.Empty);
76
77 if (serviceDll == String.Empty)
78 {
79 m_log.Error("[USER CONNECTOR]: No LocalServiceModule named in section UserService");
80 return;
81 }
82 74
83 Object[] args = new Object[] { source }; 75 base.Initialise(source);
84 m_UserService =
85 ServerUtils.LoadPlugin<IUserAccountService>(serviceDll,
86 args);
87 76
88 if (m_UserService == null) 77 m_log.Info("[AUTH CONNECTOR]: Remote Authentication enabled");
89 {
90 m_log.Error("[USER CONNECTOR]: Can't load user service");
91 return;
92 }
93 m_Enabled = true;
94 m_log.Info("[USER CONNECTOR]: Local user connector enabled");
95 } 78 }
96 } 79 }
97 } 80 }
@@ -113,7 +96,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.User
113 if (!m_Enabled) 96 if (!m_Enabled)
114 return; 97 return;
115 98
116 scene.RegisterModuleInterface<IUserAccountService>(m_UserService); 99 scene.RegisterModuleInterface<IAuthenticationService>(this);
117 } 100 }
118 101
119 public void RemoveRegion(Scene scene) 102 public void RemoveRegion(Scene scene)