Ejemplo n.º 1
0
        public override void Execute()
        {
            string hashedPassword = HashFunctions.ComputeHash(Mapping[ChangePasswordArguments.Password]);

            _persistance.ChangePassword(Mapping[ChangePasswordArguments.Username], hashedPassword);
            Messages.Add(string.Format("Password for user {0} succesfully changed.", Mapping[ChangePasswordArguments.Username]));
        }
Ejemplo n.º 2
0
        public override void Execute()
        {
            string hashedPassword = HashFunctions.ComputeHash(Mapping[AdduserArguments.Password]);

            _persistance.AddNewUserToGroup(Mapping[AdduserArguments.Username], hashedPassword, Mapping[AdduserArguments.Groupname]);
            Messages.Add(string.Format("User {0} succesfully added to group {1}", Mapping[AdduserArguments.Username], Mapping[AdduserArguments.Groupname]));
        }
        public void BootStrapIrcBotAccount()
        {
            CheckAndAddOperGroup();
            string username = _botconfig.BotSettings.IrcUserName;

            if (!_persistance.UserNameExists(username))
            {
                string password       = _botconfig.BotSettings.IrcPassword;
                string hashedPassword = HashFunctions.ComputeHash(password);
                _persistance.AddNewUserToGroup(username, hashedPassword, "opers");
            }
            _persistance.Persist();
        }
 public void BootStrapInitialUsers()
 {
     CheckAndAddOperGroup();
     if (_botconfig.Settings.DbUsers != null)
     {
         foreach (var adduser in _botconfig.Settings.DbUsers)
         {
             if (!_persistance.UserNameExists(adduser.Username))
             {
                 string hashedPassword = HashFunctions.ComputeHash(adduser.Password);
                 _persistance.AddNewUserToGroup(adduser.Username, hashedPassword, "opers");
                 _persistance.SetAdmin(adduser.Username, adduser.IsAdmin);
                 _persistance.SetOper(adduser.Username, adduser.IsOper);
             }
         }
     }
     _persistance.Persist();
 }