aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/UserAccountService/UserAccountService.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-05-11 17:15:02 +0100
committerUbitUmarov2017-05-11 17:15:02 +0100
commit7e8c996d1b13212a65b75393e1a2f96683e9bb2d (patch)
tree708f4caa2f1044c724df57348f43bd5f91eb70d5 /OpenSim/Services/UserAccountService/UserAccountService.cs
parent let .net decide GC mode from its defaults on the platform (diff)
downloadopensim-SC-7e8c996d1b13212a65b75393e1a2f96683e9bb2d.zip
opensim-SC-7e8c996d1b13212a65b75393e1a2f96683e9bb2d.tar.gz
opensim-SC-7e8c996d1b13212a65b75393e1a2f96683e9bb2d.tar.bz2
opensim-SC-7e8c996d1b13212a65b75393e1a2f96683e9bb2d.tar.xz
add a grid services god account
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/UserAccountService/UserAccountService.cs86
1 files changed, 56 insertions, 30 deletions
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index a22754f..48929ee 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -43,6 +43,7 @@ namespace OpenSim.Services.UserAccountService
43 public class UserAccountService : UserAccountServiceBase, IUserAccountService 43 public class UserAccountService : UserAccountServiceBase, IUserAccountService
44 { 44 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 private static readonly UUID UUID_GRID_GOD = new UUID("6571e388-6218-4574-87db-f9379718315e");
46 private static UserAccountService m_RootInstance; 47 private static UserAccountService m_RootInstance;
47 48
48 /// <summary> 49 /// <summary>
@@ -85,38 +86,63 @@ namespace OpenSim.Services.UserAccountService
85 86
86 m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false); 87 m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false);
87 88
88 // In case there are several instances of this class in the same process, 89 // create a system grid god account
89 // the console commands are only registered for the root instance 90 UserAccount ggod = GetUserAccount(UUID.Zero, UUID_GRID_GOD);
90 if (m_RootInstance == null && MainConsole.Instance != null) 91 if(ggod == null)
92 {
93 UserAccountData d = new UserAccountData();
94
95 d.FirstName = "GRID";
96 d.LastName = "SERVICES";
97 d.PrincipalID = UUID_GRID_GOD;
98 d.ScopeID = UUID.Zero;
99 d.Data = new Dictionary<string, string>();
100 d.Data["Email"] = string.Empty;
101 d.Data["Created"] = Util.UnixTimeSinceEpoch().ToString();
102 d.Data["UserLevel"] = "240";
103 d.Data["UserFlags"] = "0";
104 d.Data["ServiceURLs"] = string.Empty;
105
106 m_Database.Store(d);
107 }
108
109 if (m_RootInstance == null)
91 { 110 {
92 m_RootInstance = this; 111 m_RootInstance = this;
93 MainConsole.Instance.Commands.AddCommand("Users", false, 112
94 "create user", 113 // In case there are several instances of this class in the same process,
95 "create user [<first> [<last> [<pass> [<email> [<user id> [<model>]]]]]]", 114 // the console commands are only registered for the root instance
96 "Create a new user", HandleCreateUser); 115 if (MainConsole.Instance != null)
97 116 {
98 MainConsole.Instance.Commands.AddCommand("Users", false, 117
99 "reset user password", 118 MainConsole.Instance.Commands.AddCommand("Users", false,
100 "reset user password [<first> [<last> [<password>]]]", 119 "create user",
101 "Reset a user password", HandleResetUserPassword); 120 "create user [<first> [<last> [<pass> [<email> [<user id> [<model>]]]]]]",
102 121 "Create a new user", HandleCreateUser);
103 MainConsole.Instance.Commands.AddCommand("Users", false, 122
104 "reset user email", 123 MainConsole.Instance.Commands.AddCommand("Users", false,
105 "reset user email [<first> [<last> [<email>]]]", 124 "reset user password",
106 "Reset a user email address", HandleResetUserEmail); 125 "reset user password [<first> [<last> [<password>]]]",
107 126 "Reset a user password", HandleResetUserPassword);
108 MainConsole.Instance.Commands.AddCommand("Users", false, 127
109 "set user level", 128 MainConsole.Instance.Commands.AddCommand("Users", false,
110 "set user level [<first> [<last> [<level>]]]", 129 "reset user email",
111 "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, " 130 "reset user email [<first> [<last> [<email>]]]",
112 + "this account will be treated as god-moded. " 131 "Reset a user email address", HandleResetUserEmail);
113 + "It will also affect the 'login level' command. ", 132
114 HandleSetUserLevel); 133 MainConsole.Instance.Commands.AddCommand("Users", false,
115 134 "set user level",
116 MainConsole.Instance.Commands.AddCommand("Users", false, 135 "set user level [<first> [<last> [<level>]]]",
117 "show account", 136 "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, "
118 "show account <first> <last>", 137 + "this account will be treated as god-moded. "
119 "Show account details for the given user", HandleShowAccount); 138 + "It will also affect the 'login level' command. ",
139 HandleSetUserLevel);
140
141 MainConsole.Instance.Commands.AddCommand("Users", false,
142 "show account",
143 "show account <first> <last>",
144 "Show account details for the given user", HandleShowAccount);
145 }
120 } 146 }
121 } 147 }
122 148