public override bool ChangePassword(string username, string oldPassword, string newPassword)
        {
            if (!ValidateUser(username, oldPassword) || string.IsNullOrEmpty(newPassword.Trim()))
            {
                return(false);
            }

            MW_Usuarios user = repository.GetUser(username);
            string      hash = FormsAuthentication.HashPasswordForStoringInConfigFile(newPassword.Trim(), "md5");

            //string hash = newPassword.Trim();

            user.TX_Clave = hash;
            repository.Save();

            return(true);
        }
Esempio n. 2
0
        public override bool IsUserInRole(string userName, string roleName)
        {
            MW_Usuarios user = repository.GetUser(userName);
            MW_Roles    role = repository.GetRole(roleName);

            if (!repository.UserExists(user))
            {
                return(false);
            }
            if (!repository.RoleExists(role))
            {
                return(false);
            }

            return(repository.UserRoleExists(user, role));
        }