Example #1
0
        public UserAccountService(IConfigSource config)
            : base(config)
        {
            IConfig userConfig = config.Configs["UserAccountService"];
            if (userConfig == null)
                throw new Exception("No UserAccountService configuration");

            // In case there are several instances of this class in the same process,
            // the console commands are only registered for the root instance
            if (m_RootInstance == null)
            {
                m_RootInstance = this;
                string gridServiceDll = userConfig.GetString("GridService", string.Empty);
                if (gridServiceDll != string.Empty)
                    m_GridService = LoadPlugin<IGridService>(gridServiceDll, new Object[] { config });

                string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty);
                if (authServiceDll != string.Empty)
                    m_AuthenticationService = LoadPlugin<IAuthenticationService>(authServiceDll, new Object[] { config });

                string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty);
                if (presenceServiceDll != string.Empty)
                    m_GridUserService = LoadPlugin<IGridUserService>(presenceServiceDll, new Object[] { config });

                string invServiceDll = userConfig.GetString("InventoryService", string.Empty);
                if (invServiceDll != string.Empty)
                    m_InventoryService = LoadPlugin<IInventoryService>(invServiceDll, new Object[] { config });

                if (MainConsole.Instance != null)
                {
                    MainConsole.Instance.Commands.AddCommand("UserService", false,
                            "create user",
                            "create user [<first> [<last> [<pass> [<email>]]]]",
                            "Create a new user", HandleCreateUser);

                    MainConsole.Instance.Commands.AddCommand("UserService", false,
                            "reset user password",
                            "reset user password [<first> [<last> [<password>]]]",
                            "Reset a user password", HandleResetUserPassword);

                    MainConsole.Instance.Commands.AddCommand("UserService", false,
                            "set user level",
                            "set user level [<first> [<last> [<level>]]]",
                            "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, "
                                + "this account will be treated as god-moded. "
                                + "It will also affect the 'login level' command. ",
                            HandleSetUserLevel);

                    MainConsole.Instance.Commands.AddCommand("UserService", false,
                            "show account",
                            "show account <first> <last>",
                            "Show account details for the given user", HandleShowAccount);
                }

            }

        }
        public void Initialize(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("UserAccountHandler", "") != Name)
                return;

            m_localService = new UserAccountService();
            m_localService.Configure(config, registry);
            Init(registry, Name);
            registry.RegisterModuleInterface<IUserAccountService>(this);
            m_registry = registry;
        }
Example #3
0
        public UserAccountService(IConfigSource config)
            : base(config)
        {
            IConfig userConfig = config.Configs["UserAccountService"];

            if (userConfig == null)
            {
                throw new Exception("No UserAccountService configuration");
            }

            // In case there are several instances of this class in the same process,
            // the console commands are only registered for the root instance
            if (m_RootInstance == null)
            {
                m_RootInstance = this;
                string gridServiceDll = userConfig.GetString("GridService", string.Empty);
                if (gridServiceDll != string.Empty)
                {
                    m_GridService = LoadPlugin <IGridService>(gridServiceDll, new Object[] { config });
                }

                string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty);
                if (authServiceDll != string.Empty)
                {
                    m_AuthenticationService = LoadPlugin <IAuthenticationService>(authServiceDll, new Object[] { config });
                }

                string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty);
                if (presenceServiceDll != string.Empty)
                {
                    m_GridUserService = LoadPlugin <IGridUserService>(presenceServiceDll, new Object[] { config });
                }

                string invServiceDll = userConfig.GetString("InventoryService", string.Empty);
                if (invServiceDll != string.Empty)
                {
                    m_InventoryService = LoadPlugin <IInventoryService>(invServiceDll, new Object[] { config });
                }

                if (MainConsole.Instance != null)
                {
                    MainConsole.Instance.Commands.AddCommand("UserService", false,
                                                             "create user",
                                                             "create user [<first> [<last> [<pass> [<email>]]]]",
                                                             "Create a new user", HandleCreateUser);
                    MainConsole.Instance.Commands.AddCommand("UserService", false, "reset user password",
                                                             "reset user password [<first> [<last> [<password>]]]",
                                                             "Reset a user password", HandleResetUserPassword);
                }
            }
        }
        public UserAccountService(IConfigSource config)
            : base(config)
        {
            IConfig userConfig = config.Configs["UserAccountService"];
            if (userConfig == null)
                throw new Exception("No UserAccountService configuration");

            // In case there are several instances of this class in the same process,
            // the console commands are only registered for the root instance
            if (m_RootInstance == null)
            {
                m_RootInstance = this;
                string gridServiceDll = userConfig.GetString("GridService", string.Empty);
                if (gridServiceDll != string.Empty)
                    m_GridService = LoadPlugin<IGridService>(gridServiceDll, new Object[] { config });

                string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty);
                if (authServiceDll != string.Empty)
                    m_AuthenticationService = LoadPlugin<IAuthenticationService>(authServiceDll, new Object[] { config });

                string presenceServiceDll = userConfig.GetString("PresenceService", string.Empty);
                if (presenceServiceDll != string.Empty)
                    m_PresenceService = LoadPlugin<IPresenceService>(presenceServiceDll, new Object[] { config });

                string invServiceDll = userConfig.GetString("InventoryService", string.Empty);
                if (invServiceDll != string.Empty)
                    m_InventoryService = LoadPlugin<IInventoryService>(invServiceDll, new Object[] { config });

                if (MainConsole.Instance != null)
                {
                    MainConsole.Instance.Commands.AddCommand("UserService", false,
                            "create user",
                            "create user [<first> [<last> [<pass> [<email>]]]]",
                            "Create a new user", HandleCreateUser);
                    MainConsole.Instance.Commands.AddCommand("UserService", false, "reset user password",
                            "reset user password [<first> [<last> [<password>]]]",
                            "Reset a user password", HandleResetUserPassword);
                }

            }

        }
        public UserAccountService(IConfigSource config)
            : base(config)
        {
            IConfig userConfig = config.Configs["UserAccountService"];

            if (userConfig == null)
            {
                throw new Exception("No UserAccountService configuration");
            }

            string gridServiceDll = userConfig.GetString("GridService", string.Empty);

            if (gridServiceDll != string.Empty)
            {
                m_GridService = LoadPlugin <IGridService>(gridServiceDll, new Object[] { config });
            }

            string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty);

            if (authServiceDll != string.Empty)
            {
                m_AuthenticationService = LoadPlugin <IAuthenticationService>(authServiceDll, new Object[] { config });
            }

            string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty);

            if (presenceServiceDll != string.Empty)
            {
                m_GridUserService = LoadPlugin <IGridUserService>(presenceServiceDll, new Object[] { config });
            }

            string invServiceDll = userConfig.GetString("InventoryService", string.Empty);

            if (invServiceDll != string.Empty)
            {
                m_InventoryService = LoadPlugin <IInventoryService>(invServiceDll, new Object[] { config });
            }

            string avatarServiceDll = userConfig.GetString("AvatarService", string.Empty);

            if (avatarServiceDll != string.Empty)
            {
                m_AvatarService = LoadPlugin <IAvatarService>(avatarServiceDll, new Object[] { config });
            }

            m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false);

            // In case there are several instances of this class in the same process,
            // the console commands are only registered for the root instance
            if (m_RootInstance == null && MainConsole.Instance != null)
            {
                m_RootInstance = this;
                MainConsole.Instance.Commands.AddCommand("Users", false,
                                                         "create user",
                                                         "create user [<first> [<last> [<pass> [<email> [<user id>]]]]]",
                                                         "Create a new user", HandleCreateUser);

                MainConsole.Instance.Commands.AddCommand("Users", false,
                                                         "reset user password",
                                                         "reset user password [<first> [<last> [<password>]]]",
                                                         "Reset a user password", HandleResetUserPassword);

                MainConsole.Instance.Commands.AddCommand("Users", false,
                                                         "set user level",
                                                         "set user level [<first> [<last> [<level>]]]",
                                                         "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, "
                                                         + "this account will be treated as god-moded. "
                                                         + "It will also affect the 'login level' command. ",
                                                         HandleSetUserLevel);

                MainConsole.Instance.Commands.AddCommand("Users", false,
                                                         "show account",
                                                         "show account <first> <last>",
                                                         "Show account details for the given user", HandleShowAccount);
            }
        }
Example #6
0
        public UserAccountService(IConfigSource config)
            : base(config)
        {
            IConfig userConfig = config.Configs["UserAccountService"];

            if (userConfig == null)
            {
                throw new Exception("No UserAccountService configuration");
            }

            string gridServiceDll = userConfig.GetString("GridService", string.Empty);

            if (gridServiceDll != string.Empty)
            {
                m_GridService = LoadPlugin <IGridService>(gridServiceDll, new Object[] { config });
            }

            string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty);

            if (authServiceDll != string.Empty)
            {
                m_AuthenticationService = LoadPlugin <IAuthenticationService>(authServiceDll, new Object[] { config });
            }

            string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty);

            if (presenceServiceDll != string.Empty)
            {
                m_GridUserService = LoadPlugin <IGridUserService>(presenceServiceDll, new Object[] { config });
            }

            string invServiceDll = userConfig.GetString("InventoryService", string.Empty);

            if (invServiceDll != string.Empty)
            {
                m_InventoryService = LoadPlugin <IInventoryService>(invServiceDll, new Object[] { config });
            }

            string avatarServiceDll = userConfig.GetString("AvatarService", string.Empty);

            if (avatarServiceDll != string.Empty)
            {
                m_AvatarService = LoadPlugin <IAvatarService>(avatarServiceDll, new Object[] { config });
            }

            m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false);

            //  create a system grid god account
            UserAccount ggod = GetUserAccount(UUID.Zero, UUID_GRID_GOD);

            if (ggod == null)
            {
                UserAccountData d = new UserAccountData();

                d.FirstName           = "GRID";
                d.LastName            = "SERVICES";
                d.PrincipalID         = UUID_GRID_GOD;
                d.ScopeID             = UUID.Zero;
                d.Data                = new Dictionary <string, string>();
                d.Data["Email"]       = string.Empty;
                d.Data["Created"]     = Util.UnixTimeSinceEpoch().ToString();
                d.Data["UserLevel"]   = "240";
                d.Data["UserFlags"]   = "0";
                d.Data["ServiceURLs"] = string.Empty;

                m_Database.Store(d);
            }

            if (m_RootInstance == null)
            {
                m_RootInstance = this;

                // In case there are several instances of this class in the same process,
                // the console commands are only registered for the root instance
                if (MainConsole.Instance != null)
                {
                    MainConsole.Instance.Commands.AddCommand("Users", false,
                                                             "create user",
                                                             "create user [<first> [<last> [<pass> [<email> [<user id> [<model>]]]]]]",
                                                             "Create a new user", HandleCreateUser);

                    MainConsole.Instance.Commands.AddCommand("Users", false,
                                                             "reset user password",
                                                             "reset user password [<first> [<last> [<password>]]]",
                                                             "Reset a user password", HandleResetUserPassword);

                    MainConsole.Instance.Commands.AddCommand("Users", false,
                                                             "reset user email",
                                                             "reset user email [<first> [<last> [<email>]]]",
                                                             "Reset a user email address", HandleResetUserEmail);

                    MainConsole.Instance.Commands.AddCommand("Users", false,
                                                             "set user level",
                                                             "set user level [<first> [<last> [<level>]]]",
                                                             "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, "
                                                             + "this account will be treated as god-moded. "
                                                             + "It will also affect the 'login level' command. ",
                                                             HandleSetUserLevel);

                    MainConsole.Instance.Commands.AddCommand("Users", false,
                                                             "show account",
                                                             "show account <first> <last>",
                                                             "Show account details for the given user", HandleShowAccount);
                }
            }
        }