diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 50 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 82 | ||||
-rw-r--r-- | OpenSim/Services/UserAccountService/UserAccountService.cs | 4 | ||||
-rw-r--r-- | prebuild.xml | 2 |
5 files changed, 70 insertions, 94 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 92e8ed1..3060169 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -41,11 +41,14 @@ using OpenSim.Framework.Servers; | |||
41 | using OpenSim.Framework.Servers.HttpServer; | 41 | using OpenSim.Framework.Servers.HttpServer; |
42 | using OpenSim.Framework.Statistics; | 42 | using OpenSim.Framework.Statistics; |
43 | using OpenSim.Region.ClientStack; | 43 | using OpenSim.Region.ClientStack; |
44 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; | ||
44 | using OpenSim.Region.Framework; | 45 | using OpenSim.Region.Framework; |
45 | using OpenSim.Region.Framework.Interfaces; | 46 | using OpenSim.Region.Framework.Interfaces; |
46 | using OpenSim.Region.Framework.Scenes; | 47 | using OpenSim.Region.Framework.Scenes; |
47 | using OpenSim.Region.Physics.Manager; | 48 | using OpenSim.Region.Physics.Manager; |
48 | using OpenSim.Server.Base; | 49 | using OpenSim.Server.Base; |
50 | using OpenSim.Services.Interfaces; | ||
51 | using OpenSim.Services.UserAccountService; | ||
49 | 52 | ||
50 | namespace OpenSim | 53 | namespace OpenSim |
51 | { | 54 | { |
@@ -362,6 +365,53 @@ namespace OpenSim | |||
362 | 365 | ||
363 | scene.SetModuleInterfaces(); | 366 | scene.SetModuleInterfaces(); |
364 | 367 | ||
368 | // FIXME: Put me into a separate method! | ||
369 | while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) | ||
370 | { | ||
371 | MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName); | ||
372 | List<char> excluded = new List<char>(new char[1]{' '}); | ||
373 | string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded); | ||
374 | string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded); | ||
375 | |||
376 | UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last); | ||
377 | |||
378 | if (account == null) | ||
379 | { | ||
380 | m_log.DebugFormat("A {0}", scene.UserAccountService.GetType()); | ||
381 | |||
382 | // if (scene.UserAccountService is LocalUserAccountServicesConnector) | ||
383 | // { | ||
384 | // IUserAccountService innerUas | ||
385 | // = ((LocalUserAccountServicesConnector)scene.UserAccountService).UserAccountService; | ||
386 | // | ||
387 | // m_log.DebugFormat("B {0}", innerUas.GetType()); | ||
388 | // | ||
389 | // if (innerUas is UserAccountService) | ||
390 | // { | ||
391 | |||
392 | if (scene.UserAccountService is UserAccountService) | ||
393 | { | ||
394 | string password = MainConsole.Instance.PasswdPrompt("Password"); | ||
395 | string email = MainConsole.Instance.CmdPrompt("Email", ""); | ||
396 | |||
397 | // TODO: Where do we put m_regInfo.ScopeID? | ||
398 | account = ((UserAccountService)scene.UserAccountService).CreateUser(first, last, password, email); | ||
399 | } | ||
400 | // } | ||
401 | } | ||
402 | |||
403 | if (account == null) | ||
404 | { | ||
405 | m_log.ErrorFormat( | ||
406 | "[OPENSIM]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first."); | ||
407 | } | ||
408 | else | ||
409 | { | ||
410 | regionInfo.EstateSettings.EstateOwner = account.PrincipalID; | ||
411 | regionInfo.EstateSettings.Save(); | ||
412 | } | ||
413 | } | ||
414 | |||
365 | // Prims have to be loaded after module configuration since some modules may be invoked during the load | 415 | // Prims have to be loaded after module configuration since some modules may be invoked during the load |
366 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); | 416 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); |
367 | 417 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs index 30ebb21..546fe88 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | |||
@@ -45,7 +45,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
45 | LogManager.GetLogger( | 45 | LogManager.GetLogger( |
46 | MethodBase.GetCurrentMethod().DeclaringType); | 46 | MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | private IUserAccountService m_UserService; | 48 | /// <summary> |
49 | /// This is not on the IUserAccountService. It's only being used so that standalone scenes can punch through | ||
50 | /// to a local UserAccountService when setting up an estate manager. | ||
51 | /// </summary> | ||
52 | public IUserAccountService UserAccountService { get; private set; } | ||
53 | |||
49 | private UserAccountCache m_Cache; | 54 | private UserAccountCache m_Cache; |
50 | 55 | ||
51 | private bool m_Enabled = false; | 56 | private bool m_Enabled = false; |
@@ -86,9 +91,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
86 | } | 91 | } |
87 | 92 | ||
88 | Object[] args = new Object[] { source }; | 93 | Object[] args = new Object[] { source }; |
89 | m_UserService = ServerUtils.LoadPlugin<IUserAccountService>(serviceDll, args); | 94 | UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(serviceDll, args); |
90 | 95 | ||
91 | if (m_UserService == null) | 96 | if (UserAccountService == null) |
92 | { | 97 | { |
93 | m_log.ErrorFormat( | 98 | m_log.ErrorFormat( |
94 | "[LOCAL USER ACCOUNT SERVICE CONNECTOR]: Cannot load user account service specified as {0}", serviceDll); | 99 | "[LOCAL USER ACCOUNT SERVICE CONNECTOR]: Cannot load user account service specified as {0}", serviceDll); |
@@ -119,7 +124,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
119 | if (!m_Enabled) | 124 | if (!m_Enabled) |
120 | return; | 125 | return; |
121 | 126 | ||
122 | scene.RegisterModuleInterface<IUserAccountService>(m_UserService); | 127 | scene.RegisterModuleInterface<IUserAccountService>(UserAccountService); |
123 | } | 128 | } |
124 | 129 | ||
125 | public void RemoveRegion(Scene scene) | 130 | public void RemoveRegion(Scene scene) |
@@ -147,7 +152,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
147 | if (inCache) | 152 | if (inCache) |
148 | return account; | 153 | return account; |
149 | 154 | ||
150 | account = m_UserService.GetUserAccount(scopeID, userID); | 155 | account = UserAccountService.GetUserAccount(scopeID, userID); |
151 | m_Cache.Cache(userID, account); | 156 | m_Cache.Cache(userID, account); |
152 | 157 | ||
153 | return account; | 158 | return account; |
@@ -160,7 +165,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
160 | if (inCache) | 165 | if (inCache) |
161 | return account; | 166 | return account; |
162 | 167 | ||
163 | account = m_UserService.GetUserAccount(scopeID, firstName, lastName); | 168 | account = UserAccountService.GetUserAccount(scopeID, firstName, lastName); |
164 | if (account != null) | 169 | if (account != null) |
165 | m_Cache.Cache(account.PrincipalID, account); | 170 | m_Cache.Cache(account.PrincipalID, account); |
166 | 171 | ||
@@ -169,22 +174,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
169 | 174 | ||
170 | public UserAccount GetUserAccount(UUID scopeID, string Email) | 175 | public UserAccount GetUserAccount(UUID scopeID, string Email) |
171 | { | 176 | { |
172 | return m_UserService.GetUserAccount(scopeID, Email); | 177 | return UserAccountService.GetUserAccount(scopeID, Email); |
173 | } | 178 | } |
174 | 179 | ||
175 | public List<UserAccount> GetUserAccounts(UUID scopeID, string query) | 180 | public List<UserAccount> GetUserAccounts(UUID scopeID, string query) |
176 | { | 181 | { |
177 | return m_UserService.GetUserAccounts(scopeID, query); | 182 | return UserAccountService.GetUserAccounts(scopeID, query); |
178 | } | 183 | } |
179 | 184 | ||
180 | // Update all updatable fields | 185 | // Update all updatable fields |
181 | // | 186 | // |
182 | public bool StoreUserAccount(UserAccount data) | 187 | public bool StoreUserAccount(UserAccount data) |
183 | { | 188 | { |
184 | return m_UserService.StoreUserAccount(data); | 189 | return UserAccountService.StoreUserAccount(data); |
185 | } | 190 | } |
186 | 191 | ||
187 | #endregion | 192 | #endregion |
188 | |||
189 | } | 193 | } |
190 | } | 194 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f394a95..976e001 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1170,88 +1170,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1170 | m_dialogModule = RequestModuleInterface<IDialogModule>(); | 1170 | m_dialogModule = RequestModuleInterface<IDialogModule>(); |
1171 | m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); | 1171 | m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); |
1172 | m_teleportModule = RequestModuleInterface<IEntityTransferModule>(); | 1172 | m_teleportModule = RequestModuleInterface<IEntityTransferModule>(); |
1173 | |||
1174 | // Shoving this in here for now, because we have the needed | ||
1175 | // interfaces at this point | ||
1176 | // | ||
1177 | // TODO: Find a better place for this | ||
1178 | // | ||
1179 | while (m_regInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) | ||
1180 | { | ||
1181 | MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", m_regInfo.EstateSettings.EstateName); | ||
1182 | List<char> excluded = new List<char>(new char[1]{' '}); | ||
1183 | string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded); | ||
1184 | string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded); | ||
1185 | |||
1186 | UserAccount account = UserAccountService.GetUserAccount(m_regInfo.ScopeID, first, last); | ||
1187 | |||
1188 | if (account == null) | ||
1189 | { | ||
1190 | // Create a new account | ||
1191 | account = new UserAccount(m_regInfo.ScopeID, first, last, String.Empty); | ||
1192 | if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0)) | ||
1193 | { | ||
1194 | account.ServiceURLs = new Dictionary<string, object>(); | ||
1195 | account.ServiceURLs["HomeURI"] = string.Empty; | ||
1196 | account.ServiceURLs["GatekeeperURI"] = string.Empty; | ||
1197 | account.ServiceURLs["InventoryServerURI"] = string.Empty; | ||
1198 | account.ServiceURLs["AssetServerURI"] = string.Empty; | ||
1199 | } | ||
1200 | |||
1201 | if (UserAccountService.StoreUserAccount(account)) | ||
1202 | { | ||
1203 | string password = MainConsole.Instance.PasswdPrompt("Password"); | ||
1204 | string email = MainConsole.Instance.CmdPrompt("Email", ""); | ||
1205 | |||
1206 | account.Email = email; | ||
1207 | UserAccountService.StoreUserAccount(account); | ||
1208 | |||
1209 | bool success = false; | ||
1210 | success = AuthenticationService.SetPassword(account.PrincipalID, password); | ||
1211 | if (!success) | ||
1212 | m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set password for account {0} {1}.", | ||
1213 | first, last); | ||
1214 | |||
1215 | GridRegion home = null; | ||
1216 | if (GridService != null) | ||
1217 | { | ||
1218 | List<GridRegion> defaultRegions = GridService.GetDefaultRegions(UUID.Zero); | ||
1219 | if (defaultRegions != null && defaultRegions.Count >= 1) | ||
1220 | home = defaultRegions[0]; | ||
1221 | |||
1222 | if (GridUserService != null && home != null) | ||
1223 | GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); | ||
1224 | else | ||
1225 | m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set home for account {0} {1}.", | ||
1226 | first, last); | ||
1227 | |||
1228 | } | ||
1229 | else | ||
1230 | m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to retrieve home region for account {0} {1}.", | ||
1231 | first, last); | ||
1232 | |||
1233 | if (InventoryService != null) | ||
1234 | success = InventoryService.CreateUserInventory(account.PrincipalID); | ||
1235 | if (!success) | ||
1236 | m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.", | ||
1237 | first, last); | ||
1238 | |||
1239 | |||
1240 | |||
1241 | m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", first, last); | ||
1242 | |||
1243 | m_regInfo.EstateSettings.EstateOwner = account.PrincipalID; | ||
1244 | m_regInfo.EstateSettings.Save(); | ||
1245 | } | ||
1246 | else | ||
1247 | m_log.ErrorFormat("[SCENE]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first."); | ||
1248 | } | ||
1249 | else | ||
1250 | { | ||
1251 | m_regInfo.EstateSettings.EstateOwner = account.PrincipalID; | ||
1252 | m_regInfo.EstateSettings.Save(); | ||
1253 | } | ||
1254 | } | ||
1255 | } | 1173 | } |
1256 | 1174 | ||
1257 | #endregion | 1175 | #endregion |
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 21ce86c..0acfdcf 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -456,7 +456,7 @@ namespace OpenSim.Services.UserAccountService | |||
456 | /// <param name="lastName"></param> | 456 | /// <param name="lastName"></param> |
457 | /// <param name="password"></param> | 457 | /// <param name="password"></param> |
458 | /// <param name="email"></param> | 458 | /// <param name="email"></param> |
459 | private void CreateUser(string firstName, string lastName, string password, string email) | 459 | public UserAccount CreateUser(string firstName, string lastName, string password, string email) |
460 | { | 460 | { |
461 | UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); | 461 | UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); |
462 | if (null == account) | 462 | if (null == account) |
@@ -524,6 +524,8 @@ namespace OpenSim.Services.UserAccountService | |||
524 | { | 524 | { |
525 | m_log.ErrorFormat("[USER ACCOUNT SERVICE]: A user with the name {0} {1} already exists!", firstName, lastName); | 525 | m_log.ErrorFormat("[USER ACCOUNT SERVICE]: A user with the name {0} {1} already exists!", firstName, lastName); |
526 | } | 526 | } |
527 | |||
528 | return account; | ||
527 | } | 529 | } |
528 | 530 | ||
529 | private void CreateDefaultAppearanceEntries(UUID principalID) | 531 | private void CreateDefaultAppearanceEntries(UUID principalID) |
diff --git a/prebuild.xml b/prebuild.xml index 392fbdc..91308a4 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -1840,6 +1840,8 @@ | |||
1840 | <Reference name="OpenSim.Region.ClientStack"/> | 1840 | <Reference name="OpenSim.Region.ClientStack"/> |
1841 | <Reference name="OpenSim.Framework.Communications"/> | 1841 | <Reference name="OpenSim.Framework.Communications"/> |
1842 | <Reference name="OpenSim.Server.Base"/> | 1842 | <Reference name="OpenSim.Server.Base"/> |
1843 | <Reference name="OpenSim.Services.Interfaces"/> | ||
1844 | <Reference name="OpenSim.Services.UserAccountService"/> | ||
1843 | <Reference name="XMLRPC" path="../../../bin/"/> | 1845 | <Reference name="XMLRPC" path="../../../bin/"/> |
1844 | <Reference name="Nini" path="../../../bin/"/> | 1846 | <Reference name="Nini" path="../../../bin/"/> |
1845 | <Reference name="log4net" path="../../../bin/"/> | 1847 | <Reference name="log4net" path="../../../bin/"/> |