GetUserInfo() public method

public GetUserInfo ( UUID userID ) : object>.Dictionary
userID UUID
return object>.Dictionary
Beispiel #1
0
        private bool GetUserProfileData(UUID userID, out Dictionary <string, object> userInfo)
        {
            IUserFinder uManage = m_registry.RequestModuleInterface <IUserFinder>();

            userInfo = new Dictionary <string, object>();

            if (!uManage.IsLocalGridUser(userID))
            {
                // Is Foreign
                string home_url = uManage.GetUserServerURL(userID, "HomeURI");

                if (String.IsNullOrEmpty(home_url))
                {
                    userInfo["user_flags"]   = 0;
                    userInfo["user_created"] = 0;
                    userInfo["user_title"]   = "Unavailable";

                    return(true);
                }

                UserAgentServiceConnector uConn = new UserAgentServiceConnector(home_url);

                Dictionary <string, object> account = uConn.GetUserInfo(userID);

                if (account.Count > 0)
                {
                    if (account.ContainsKey("user_flags"))
                    {
                        userInfo["user_flags"] = account["user_flags"];
                    }
                    else
                    {
                        userInfo["user_flags"] = "";
                    }

                    if (account.ContainsKey("user_created"))
                    {
                        userInfo["user_created"] = account["user_created"];
                    }
                    else
                    {
                        userInfo["user_created"] = "";
                    }

                    userInfo["user_title"] = "HG Visitor";
                }
                else
                {
                    userInfo["user_flags"]   = 0;
                    userInfo["user_created"] = 0;
                    userInfo["user_title"]   = "HG Visitor";
                }
                return(true);
            }
            return(false);
        }
        private bool GetUserProfileData(UUID userID, out Dictionary<string, object> userInfo)
        {
            IUserFinder uManage = m_registry.RequestModuleInterface<IUserFinder>();
            userInfo = new Dictionary<string, object>();

            if (!uManage.IsLocalGridUser(userID))
            {
                // Is Foreign
                string home_url = uManage.GetUserServerURL(userID, "HomeURI");

                if (String.IsNullOrEmpty(home_url))
                {
                    userInfo["user_flags"] = 0;
                    userInfo["user_created"] = 0;
                    userInfo["user_title"] = "Unavailable";

                    return true;
                }

                UserAgentServiceConnector uConn = new UserAgentServiceConnector(home_url);

                Dictionary<string, object> account = uConn.GetUserInfo(userID);

                if (account.Count > 0)
                {
                    if (account.ContainsKey("user_flags"))
                        userInfo["user_flags"] = account["user_flags"];
                    else
                        userInfo["user_flags"] = "";

                    if (account.ContainsKey("user_created"))
                        userInfo["user_created"] = account["user_created"];
                    else
                        userInfo["user_created"] = "";

                    userInfo["user_title"] = "HG Visitor";
                }
                else
                {
                    userInfo["user_flags"] = 0;
                    userInfo["user_created"] = 0;
                    userInfo["user_title"] = "HG Visitor";
                }
                return true;
            }
            return false;
        }