invite_members.php 777 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Invite users to the group
  4. */
  5. $invite_members = get_input("invite_members");
  6. $group_guid = (int) get_input("group_guid");
  7. $forward_url = REFERER;
  8. if (!empty($group_guid)) {
  9. $group = get_entity($group_guid);
  10. if (!empty($group) && $group->canEdit()) {
  11. if (elgg_instanceof($group, "group")) {
  12. $group->invite_members = $invite_members;
  13. $forward_url = $group->getURL();
  14. system_message(elgg_echo("group_tools:action:success"));
  15. } else {
  16. register_error(elgg_echo("ClassException:ClassnameNotClass", array($group_guid, elgg_echo("item:group"))));
  17. }
  18. } else {
  19. register_error(elgg_echo("InvalidParameterException:NoEntityFound"));
  20. }
  21. } else {
  22. register_error(elgg_echo("InvalidParameterException:MissingParameter"));
  23. }
  24. forward($forward_url);