aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs22
1 files changed, 20 insertions, 2 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index b60cd42..ea5d805 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -84,6 +84,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
84 private bool m_groupsEnabled = false; 84 private bool m_groupsEnabled = false;
85 private bool m_groupNoticesEnabled = true; 85 private bool m_groupNoticesEnabled = true;
86 private bool m_debugEnabled = false; 86 private bool m_debugEnabled = false;
87 private int m_levelGroupCreate = 0;
87 88
88 #region IRegionModuleBase Members 89 #region IRegionModuleBase Members
89 90
@@ -115,6 +116,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
115 116
116 m_groupNoticesEnabled = groupsConfig.GetBoolean("NoticesEnabled", true); 117 m_groupNoticesEnabled = groupsConfig.GetBoolean("NoticesEnabled", true);
117 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false); 118 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false);
119 m_levelGroupCreate = groupsConfig.GetInt("LevelGroupCreate", 0);
118 } 120 }
119 } 121 }
120 122
@@ -708,13 +710,29 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
708 remoteClient.SendCreateGroupReply(UUID.Zero, false, "A group with the same name already exists."); 710 remoteClient.SendCreateGroupReply(UUID.Zero, false, "A group with the same name already exists.");
709 return UUID.Zero; 711 return UUID.Zero;
710 } 712 }
713
714 // check user level
715 ScenePresence avatar = null;
716 Scene scene = (Scene)remoteClient.Scene;
717 scene.TryGetScenePresence(remoteClient.AgentId, out avatar);
718
719 if (avatar != null)
720 {
721 if (avatar.UserLevel < m_levelGroupCreate)
722 {
723 remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got insufficient permissions to create a group.");
724 return UUID.Zero;
725 }
726 }
727
728 // check funds
711 // is there is a money module present ? 729 // is there is a money module present ?
712 IMoneyModule money = remoteClient.Scene.RequestModuleInterface<IMoneyModule>(); 730 IMoneyModule money = scene.RequestModuleInterface<IMoneyModule>();
713 if (money != null) 731 if (money != null)
714 { 732 {
715 // do the transaction, that is if the agent has got sufficient funds 733 // do the transaction, that is if the agent has got sufficient funds
716 if (!money.AmountCovered(remoteClient.AgentId, money.GroupCreationCharge)) { 734 if (!money.AmountCovered(remoteClient.AgentId, money.GroupCreationCharge)) {
717 remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group."); 735 remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got insufficient funds to create a group.");
718 return UUID.Zero; 736 return UUID.Zero;
719 } 737 }
720 money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, "Group Creation"); 738 money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, "Group Creation");