Ejemplo n.º 1
0
        public string[] GetAllUsers(string userData)
        {
            List <string> usersList = new List <string>();

            Leadtools.Medical.UserManagementDataAccessLayer.User[] Users = UserManagementAgent.GetUsers();

            foreach (Leadtools.Medical.UserManagementDataAccessLayer.User user in Users)
            {
                usersList.Add(user.UserName);
            }
            return(usersList.ToArray());
        }
Ejemplo n.º 2
0
        public bool ResetPassword(string username, string newPassowrd, string userData)
        {
            PasswordOptions options;
            DateTime?       expires = null;

            options = OptionsAgent.Get <PasswordOptions>(PasswordOptionsPresenter.PasswordOptions, new PasswordOptions());
            if (options.DaysToExpire > 0)
            {
                expires = DateTime.Now.AddDays(options.DaysToExpire);
            }

            return(UserManagementAgent.SetUserPassword(username, ToSecureString(newPassowrd), expires, options.MaxPasswordHistory));
        }
Ejemplo n.º 3
0
        public void DeleteUser(string authUser, string username, string userData)
        {
            string[] userRoles       = PermissionManagementAgent.GetUserRoles(username);
            string[] userPermissions = PermissionManagementAgent.GetUserPermissions(username);

            foreach (string role in userRoles)
            {
                PermissionManagementAgent.DeleteUserRole(role, username);
            }

            foreach (string permission in userPermissions)
            {
                PermissionManagementAgent.DeleteUserPermission(permission, username);
            }

            UserManagementAgent.RemoveUser(username);
            LoggingAgent.DeleteUser(authUser, username);
        }
Ejemplo n.º 4
0
        public void CreateUser(string authUser, string username, string password, string userType, DateTime?expires)
        {
            User[]          users = UserManagementAgent.GetUsers();
            PasswordOptions options;

            if (expires == null)
            {
                options = OptionsAgent.Get <PasswordOptions>(PasswordOptionsPresenter.PasswordOptions, new PasswordOptions());
                if (options.DaysToExpire > 0)
                {
                    expires = DateTime.Now.AddDays(options.DaysToExpire);
                }
            }

            if (UserManagementAgent.UserExists(username))
            {
                throw new Exception("User already exist.");
            }

            UserManagementAgent.AddUser(username, string.Empty, ToSecureString(password), expires, userType);
            LoggingAgent.AddUser(authUser, username);
        }
Ejemplo n.º 5
0
 public bool IsPasswordExpired(string userName)
 {
     return(UserManagementAgent.IsUserPasswordExpired(userName));
 }
Ejemplo n.º 6
0
 public bool ValidateUser(string username, string password, string userData)
 {
     return(UserManagementAgent.IsUserValid(username, ToSecureString(password)));
 }
Ejemplo n.º 7
0
 public dynamic[] GetAllUsers(Dictionary <string, string> query)
 {
     return(UserManagementAgent.GetUsers(query).Select(i => ToDynamic(i)).ToArray());
 }
Ejemplo n.º 8
0
 public dynamic[] GetAllUsersFullInfo()
 {
     return(UserManagementAgent.GetUsers().Select(i => ToDynamic(i)).ToArray());
 }