diff options
author | MW | 2009-02-22 11:01:26 +0000 |
---|---|---|
committer | MW | 2009-02-22 11:01:26 +0000 |
commit | 9b0b0b5e28065155b2662a9c275f2236f3db3a26 (patch) | |
tree | 29102e0bec1414fc36dc1be012ac5b13ac81c5ec /OpenSim/Grid/UserServer/Main.cs | |
parent | * And a little more (diff) | |
download | opensim-SC-9b0b0b5e28065155b2662a9c275f2236f3db3a26.zip opensim-SC-9b0b0b5e28065155b2662a9c275f2236f3db3a26.tar.gz opensim-SC-9b0b0b5e28065155b2662a9c275f2236f3db3a26.tar.bz2 opensim-SC-9b0b0b5e28065155b2662a9c275f2236f3db3a26.tar.xz |
Part 1 of refactoring the userserver. Changed it so instead of subclassing the User dataBase access class (UserManagerBase) and then adding the http handlers to that. There is now a UserDataBaseService that is passed to the other classes so they can access the db. This should make it easier to have multiple "modules" that can register http handlers and access the db.
Diffstat (limited to 'OpenSim/Grid/UserServer/Main.cs')
-rw-r--r-- | OpenSim/Grid/UserServer/Main.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 2199e93..1e6504d 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs | |||
@@ -52,6 +52,8 @@ namespace OpenSim.Grid.UserServer | |||
52 | 52 | ||
53 | protected UserConfig Cfg; | 53 | protected UserConfig Cfg; |
54 | 54 | ||
55 | protected UserDataBaseService m_userDataBaseService; | ||
56 | |||
55 | public UserManager m_userManager; | 57 | public UserManager m_userManager; |
56 | public UserLoginService m_loginService; | 58 | public UserLoginService m_loginService; |
57 | public GridInfoService m_gridInfoService; | 59 | public GridInfoService m_gridInfoService; |
@@ -97,8 +99,10 @@ namespace OpenSim.Grid.UserServer | |||
97 | 99 | ||
98 | IInterServiceInventoryServices inventoryService = new OGS1InterServiceInventoryService(Cfg.InventoryUrl); | 100 | IInterServiceInventoryServices inventoryService = new OGS1InterServiceInventoryService(Cfg.InventoryUrl); |
99 | 101 | ||
102 | m_userDataBaseService = new UserDataBaseService(inventoryService); | ||
103 | m_userDataBaseService.AddPlugin(Cfg.DatabaseProvider, Cfg.DatabaseConnect); | ||
104 | |||
100 | StartupUserManager(inventoryService); | 105 | StartupUserManager(inventoryService); |
101 | m_userManager.AddPlugin(Cfg.DatabaseProvider, Cfg.DatabaseConnect); | ||
102 | 106 | ||
103 | m_gridInfoService = new GridInfoService(); | 107 | m_gridInfoService = new GridInfoService(); |
104 | 108 | ||
@@ -158,7 +162,7 @@ namespace OpenSim.Grid.UserServer | |||
158 | /// <param name="inventoryService"></param> | 162 | /// <param name="inventoryService"></param> |
159 | protected virtual void StartupUserManager(IInterServiceInventoryServices inventoryService) | 163 | protected virtual void StartupUserManager(IInterServiceInventoryServices inventoryService) |
160 | { | 164 | { |
161 | m_userManager = new UserManager(new OGS1InterServiceInventoryService(Cfg.InventoryUrl)); | 165 | m_userManager = new UserManager(inventoryService, m_userDataBaseService); |
162 | } | 166 | } |
163 | 167 | ||
164 | /// <summary> | 168 | /// <summary> |
@@ -168,7 +172,7 @@ namespace OpenSim.Grid.UserServer | |||
168 | protected virtual void StartupLoginService(IInterServiceInventoryServices inventoryService) | 172 | protected virtual void StartupLoginService(IInterServiceInventoryServices inventoryService) |
169 | { | 173 | { |
170 | m_loginService = new UserLoginService( | 174 | m_loginService = new UserLoginService( |
171 | m_userManager, inventoryService, new LibraryRootFolder(Cfg.LibraryXmlfile), Cfg, Cfg.DefaultStartupMsg, new RegionProfileServiceProxy()); | 175 | m_userDataBaseService, inventoryService, new LibraryRootFolder(Cfg.LibraryXmlfile), Cfg, Cfg.DefaultStartupMsg, new RegionProfileServiceProxy()); |
172 | } | 176 | } |
173 | 177 | ||
174 | protected virtual void AddHttpHandlers() | 178 | protected virtual void AddHttpHandlers() |
@@ -297,9 +301,9 @@ namespace OpenSim.Grid.UserServer | |||
297 | email = MainConsole.Instance.CmdPrompt("Email", ""); | 301 | email = MainConsole.Instance.CmdPrompt("Email", ""); |
298 | else email = cmdparams[6]; | 302 | else email = cmdparams[6]; |
299 | 303 | ||
300 | if (null == m_userManager.GetUserProfile(firstName, lastName)) | 304 | if (null == m_userDataBaseService.GetUserProfile(firstName, lastName)) |
301 | { | 305 | { |
302 | m_lastCreatedUser = m_userManager.AddUser(firstName, lastName, password, email, regX, regY); | 306 | m_lastCreatedUser = m_userDataBaseService.AddUser(firstName, lastName, password, email, regX, regY); |
303 | } | 307 | } |
304 | else | 308 | else |
305 | { | 309 | { |
@@ -329,7 +333,7 @@ namespace OpenSim.Grid.UserServer | |||
329 | newPassword = MainConsole.Instance.PasswdPrompt("New password"); | 333 | newPassword = MainConsole.Instance.PasswdPrompt("New password"); |
330 | else newPassword = cmdparams[4]; | 334 | else newPassword = cmdparams[4]; |
331 | 335 | ||
332 | m_userManager.ResetUserPassword(firstName, lastName, newPassword); | 336 | m_userDataBaseService.ResetUserPassword(firstName, lastName, newPassword); |
333 | } | 337 | } |
334 | 338 | ||
335 | private void HandleLoginCommand(string module, string[] cmd) | 339 | private void HandleLoginCommand(string module, string[] cmd) |