public List <ExtendedGroupRoleMembersData> GetGroupRoleMembers(string RequestingAgentID, UUID GroupID)
        {
            List <ExtendedGroupRoleMembersData> rmembers = new List <ExtendedGroupRoleMembersData>();

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

            sendData["GroupID"]           = GroupID.ToString();
            sendData["RequestingAgentID"] = RequestingAgentID;
            Dictionary <string, object> ret = MakeRequest("GETROLEMEMBERS", sendData);

            if (ret == null)
            {
                return(rmembers);
            }

            if (!ret.ContainsKey("RESULT"))
            {
                return(rmembers);
            }

            if (ret["RESULT"].ToString() == "NULL")
            {
                return(rmembers);
            }

            foreach (object v in ((Dictionary <string, object>)ret["RESULT"]).Values)
            {
                ExtendedGroupRoleMembersData m = GroupsDataUtils.GroupRoleMembersData((Dictionary <string, object>)v);
                rmembers.Add(m);
            }

            return(rmembers);
        }
        public static Dictionary <string, object> GroupRoleMembersData(ExtendedGroupRoleMembersData rmember)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();

            dict["RoleID"]   = rmember.RoleID.ToString();
            dict["MemberID"] = rmember.MemberID;
            return(dict);
        }
Ejemplo n.º 3
0
        public GroupRoleMembersData ConvertGroupRoleMembersData(ExtendedGroupRoleMembersData _rm)
        {
            GroupRoleMembersData rm = new GroupRoleMembersData();
            rm.RoleID = _rm.RoleID;

            string url = string.Empty, first = string.Empty, last = string.Empty, tmp = string.Empty;
            Util.ParseUniversalUserIdentifier(_rm.MemberID, out rm.MemberID, out url, out first, out last, out tmp);
            if (url != string.Empty)
                m_UserManagement.AddUser(rm.MemberID, first, last, url);

            return rm;
        }
Ejemplo n.º 4
0
        public GroupRoleMembersData ConvertGroupRoleMembersData(ExtendedGroupRoleMembersData _rm)
        {
            GroupRoleMembersData rm = new GroupRoleMembersData();

            rm.RoleID = _rm.RoleID;

            string url = string.Empty, first = string.Empty, last = string.Empty, tmp = string.Empty;

            Util.ParseUniversalUserIdentifier(_rm.MemberID, out rm.MemberID, out url, out first, out last, out tmp);
            if (url != string.Empty)
            {
                m_UserManagement.AddUser(rm.MemberID, first, last, url);
            }

            return(rm);
        }
        public static ExtendedGroupRoleMembersData GroupRoleMembersData(Dictionary <string, object> dict)
        {
            ExtendedGroupRoleMembersData rmember = new ExtendedGroupRoleMembersData();

            if (dict.ContainsKey("RoleID") && dict["RoleID"] != null)
            {
                rmember.RoleID = new UUID(dict["RoleID"].ToString());
            }

            if (dict.ContainsKey("MemberID") && dict["MemberID"] != null)
            {
                rmember.MemberID = dict["MemberID"].ToString();
            }

            return(rmember);
        }
Ejemplo n.º 6
0
        public GroupRoleMembersData ConvertGroupRoleMembersData(ExtendedGroupRoleMembersData _rm)
        {
			if (m_log.IsDebugEnabled) {
				m_log.DebugFormat ("{0} called", System.Reflection.MethodBase.GetCurrentMethod ().Name);
			}

            GroupRoleMembersData rm = new GroupRoleMembersData();
            rm.RoleID = _rm.RoleID;

            string url = string.Empty, first = string.Empty, last = string.Empty, tmp = string.Empty;
            Util.ParseUniversalUserIdentifier(_rm.MemberID, out rm.MemberID, out url, out first, out last, out tmp);
            if (url != string.Empty)
                m_UserManagement.AddUser(rm.MemberID, first, last, url);

            return rm;
        }
        protected List <ExtendedGroupRoleMembersData> _GetGroupRoleMembers(UUID GroupID, bool isInGroup)
        {
            List <ExtendedGroupRoleMembersData> rmembers = new List <ExtendedGroupRoleMembersData>();

            RoleData[] rdata = new RoleData[0];
            if (!isInGroup)
            {
                rdata = m_Database.RetrieveRoles(GroupID);
                if (rdata == null || (rdata != null && rdata.Length == 0))
                {
                    return(rmembers);
                }
            }
            List <RoleData> rlist = new List <RoleData>(rdata);

            if (!isInGroup)
            {
                rlist = rlist.FindAll(r => (UInt64.Parse(r.Data["Powers"]) & (ulong)GroupPowers.MemberVisible) != 0);
            }

            RoleMembershipData[] data = m_Database.RetrieveRolesMembers(GroupID);

            if (data == null || (data != null && data.Length == 0))
            {
                return(rmembers);
            }

            foreach (RoleMembershipData d in data)
            {
                if (!isInGroup)
                {
                    RoleData rd = rlist.Find(_r => _r.RoleID == d.RoleID); // visible role
                    if (rd == null)
                    {
                        continue;
                    }
                }

                ExtendedGroupRoleMembersData r = new ExtendedGroupRoleMembersData();
                r.MemberID = d.PrincipalID;
                r.RoleID   = d.RoleID;

                rmembers.Add(r);
            }

            return(rmembers);
        }
Ejemplo n.º 8
0
        public GroupRoleMembersData ConvertGroupRoleMembersData(ExtendedGroupRoleMembersData _rm)
        {
            if (m_log.IsDebugEnabled)
            {
                m_log.DebugFormat("{0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
            }

            GroupRoleMembersData rm = new GroupRoleMembersData();

            rm.RoleID = _rm.RoleID;

            string url = string.Empty, first = string.Empty, last = string.Empty, tmp = string.Empty;

            Util.ParseUniversalUserIdentifier(_rm.MemberID, out rm.MemberID, out url, out first, out last, out tmp);
            if (url != string.Empty)
            {
                m_UserManagement.AddUser(rm.MemberID, first, last, url);
            }

            return(rm);
        }
Ejemplo n.º 9
0
        public static ExtendedGroupRoleMembersData GroupRoleMembersData(Dictionary<string, object> dict)
        {
            ExtendedGroupRoleMembersData rmember = new ExtendedGroupRoleMembersData();

            if (dict.ContainsKey("RoleID") && dict["RoleID"] != null)
                rmember.RoleID = new UUID(dict["RoleID"].ToString());

            if (dict.ContainsKey("MemberID") && dict["MemberID"] != null)
                rmember.MemberID = dict["MemberID"].ToString();

            return rmember;
        }
Ejemplo n.º 10
0
        public static Dictionary<string, object> GroupRoleMembersData(ExtendedGroupRoleMembersData rmember)
        {
            Dictionary<string, object> dict = new Dictionary<string, object>();

            dict["RoleID"] = rmember.RoleID.ToString();
            dict["MemberID"] = rmember.MemberID;
            return dict;
        }
Ejemplo n.º 11
0
        protected List<ExtendedGroupRoleMembersData> _GetGroupRoleMembers(UUID GroupID, bool isInGroup)
        {
            List<ExtendedGroupRoleMembersData> rmembers = new List<ExtendedGroupRoleMembersData>();

            RoleData[] rdata = new RoleData[0];
            if (!isInGroup)
            {
                rdata = m_Database.RetrieveRoles(GroupID);
                if (rdata == null || (rdata != null && rdata.Length == 0))
                    return rmembers;
            }
            List<RoleData> rlist = new List<RoleData>(rdata);
            if (!isInGroup)
                rlist = rlist.FindAll(r => (UInt64.Parse(r.Data["Powers"]) & (ulong)GroupPowers.MemberVisible) != 0);

            RoleMembershipData[] data = m_Database.RetrieveRolesMembers(GroupID);

            if (data == null || (data != null && data.Length == 0))
                return rmembers;

            foreach (RoleMembershipData d in data)
            {
                if (!isInGroup)
                {
                    RoleData rd = rlist.Find(_r => _r.RoleID == d.RoleID); // visible role
                    if (rd == null)
                        continue;
                }

                ExtendedGroupRoleMembersData r = new ExtendedGroupRoleMembersData();
                r.MemberID = d.PrincipalID;
                r.RoleID = d.RoleID;

                rmembers.Add(r);
            }

            return rmembers;
        }