diff options
Diffstat (limited to 'OpenSim/Addons/Groups/Service/GroupsService.cs')
-rw-r--r-- | OpenSim/Addons/Groups/Service/GroupsService.cs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/OpenSim/Addons/Groups/Service/GroupsService.cs b/OpenSim/Addons/Groups/Service/GroupsService.cs index 0668870..a2ef13a 100644 --- a/OpenSim/Addons/Groups/Service/GroupsService.cs +++ b/OpenSim/Addons/Groups/Service/GroupsService.cs | |||
@@ -130,6 +130,13 @@ namespace OpenSim.Groups | |||
130 | { | 130 | { |
131 | reason = string.Empty; | 131 | reason = string.Empty; |
132 | 132 | ||
133 | // Check if the group already exists | ||
134 | if (m_Database.RetrieveGroup(name) != null) | ||
135 | { | ||
136 | reason = "A group with that name already exists"; | ||
137 | return UUID.Zero; | ||
138 | } | ||
139 | |||
133 | // Create the group | 140 | // Create the group |
134 | GroupData data = new GroupData(); | 141 | GroupData data = new GroupData(); |
135 | data.GroupID = UUID.Random(); | 142 | data.GroupID = UUID.Random(); |
@@ -723,12 +730,12 @@ namespace OpenSim.Groups | |||
723 | 730 | ||
724 | #region Actions without permission checks | 731 | #region Actions without permission checks |
725 | 732 | ||
726 | private void _AddAgentToGroup(string RequestingAgentID, string AgentID, UUID GroupID, UUID RoleID) | 733 | protected void _AddAgentToGroup(string RequestingAgentID, string AgentID, UUID GroupID, UUID RoleID) |
727 | { | 734 | { |
728 | _AddAgentToGroup(RequestingAgentID, AgentID, GroupID, RoleID, string.Empty); | 735 | _AddAgentToGroup(RequestingAgentID, AgentID, GroupID, RoleID, string.Empty); |
729 | } | 736 | } |
730 | 737 | ||
731 | public void _RemoveAgentFromGroup(string RequestingAgentID, string AgentID, UUID GroupID) | 738 | protected void _RemoveAgentFromGroup(string RequestingAgentID, string AgentID, UUID GroupID) |
732 | { | 739 | { |
733 | // 1. Delete membership | 740 | // 1. Delete membership |
734 | m_Database.DeleteMember(GroupID, AgentID); | 741 | m_Database.DeleteMember(GroupID, AgentID); |
@@ -780,7 +787,7 @@ namespace OpenSim.Groups | |||
780 | 787 | ||
781 | } | 788 | } |
782 | 789 | ||
783 | private bool _AddOrUpdateGroupRole(string RequestingAgentID, UUID groupID, UUID roleID, string name, string description, string title, ulong powers, bool add) | 790 | protected bool _AddOrUpdateGroupRole(string RequestingAgentID, UUID groupID, UUID roleID, string name, string description, string title, ulong powers, bool add) |
784 | { | 791 | { |
785 | RoleData data = m_Database.RetrieveRole(groupID, roleID); | 792 | RoleData data = m_Database.RetrieveRole(groupID, roleID); |
786 | 793 | ||
@@ -810,12 +817,12 @@ namespace OpenSim.Groups | |||
810 | return m_Database.StoreRole(data); | 817 | return m_Database.StoreRole(data); |
811 | } | 818 | } |
812 | 819 | ||
813 | private void _RemoveGroupRole(UUID groupID, UUID roleID) | 820 | protected void _RemoveGroupRole(UUID groupID, UUID roleID) |
814 | { | 821 | { |
815 | m_Database.DeleteRole(groupID, roleID); | 822 | m_Database.DeleteRole(groupID, roleID); |
816 | } | 823 | } |
817 | 824 | ||
818 | private void _AddAgentToGroupRole(string RequestingAgentID, string AgentID, UUID GroupID, UUID RoleID) | 825 | protected void _AddAgentToGroupRole(string RequestingAgentID, string AgentID, UUID GroupID, UUID RoleID) |
819 | { | 826 | { |
820 | RoleMembershipData data = m_Database.RetrieveRoleMember(GroupID, RoleID, AgentID); | 827 | RoleMembershipData data = m_Database.RetrieveRoleMember(GroupID, RoleID, AgentID); |
821 | if (data != null) | 828 | if (data != null) |
@@ -840,7 +847,7 @@ namespace OpenSim.Groups | |||
840 | 847 | ||
841 | } | 848 | } |
842 | 849 | ||
843 | private List<GroupRolesData> _GetGroupRoles(UUID groupID) | 850 | protected List<GroupRolesData> _GetGroupRoles(UUID groupID) |
844 | { | 851 | { |
845 | List<GroupRolesData> roles = new List<GroupRolesData>(); | 852 | List<GroupRolesData> roles = new List<GroupRolesData>(); |
846 | 853 | ||
@@ -865,7 +872,7 @@ namespace OpenSim.Groups | |||
865 | return roles; | 872 | return roles; |
866 | } | 873 | } |
867 | 874 | ||
868 | private List<ExtendedGroupRoleMembersData> _GetGroupRoleMembers(UUID GroupID, bool isInGroup) | 875 | protected List<ExtendedGroupRoleMembersData> _GetGroupRoleMembers(UUID GroupID, bool isInGroup) |
869 | { | 876 | { |
870 | List<ExtendedGroupRoleMembersData> rmembers = new List<ExtendedGroupRoleMembersData>(); | 877 | List<ExtendedGroupRoleMembersData> rmembers = new List<ExtendedGroupRoleMembersData>(); |
871 | 878 | ||