protected UserDataResponse GetUserData(ClientRequestHandler handler, object[] arguments)
 {
     UserDataResponse response = new UserDataResponse();
     MWRCommonTypes.MachineWithPrivilleges[] machines;
     MWRCommonTypes.User user;
     handler.GetUserData((string)arguments[0], (string)arguments[1], out machines, out user);
     response.MachinesList = machines;
     response.User = user;
     response.ErrorCode = 0;
     return response;
 }
Example #2
0
        public UserDataResponse GetUserData(ClientAuthStruct auth)
        {
            UserDataResponse response = new UserDataResponse();
            ClientInterface.UserDataResponse proxyResponse = client.GetUserData(GetAuthData(auth));
            response.ErrorCode = proxyResponse.ErrorCode;
            response.ErrorDescription = proxyResponse.ErrorDescription;
                if (response.ErrorCode == 0)
                {
                    if (proxyResponse.MachinesList != null && proxyResponse.MachinesList.Length > 0)
                    {
                        response.MachinesList = new MachineWithPrivilleges[proxyResponse.MachinesList.Length];
                        for (int i = 0; i < proxyResponse.MachinesList.Length; i++)
                        {
                            response.MachinesList[i] = new MachineWithPrivilleges();
                            response.MachinesList[i].Description = proxyResponse.MachinesList[i].Description;
                            response.MachinesList[i].Guid = proxyResponse.MachinesList[i].Guid;
                            response.MachinesList[i].IP = proxyResponse.MachinesList[i].IP;
                            response.MachinesList[i].Name = proxyResponse.MachinesList[i].Name;
                            response.MachinesList[i].Privilleges = proxyResponse.MachinesList[i].Privilleges.ToArray();
                        }
                    }
                    response.User = new User();
                    response.User.Group = proxyResponse.User.Group;
                    response.User.ID = proxyResponse.User.ID;
                    response.User.Name = proxyResponse.User.Name;
                    response.User.Password = proxyResponse.User.Password;
                    response.User.RegisterDate = proxyResponse.User.RegisterDate;
                }

            return response;
        }