unban.php 559 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Unbans a user.
  4. *
  5. * @package Elgg.Core
  6. * @subpackage Administration.User
  7. */
  8. $access_status = access_get_show_hidden_status();
  9. access_show_hidden_entities(true);
  10. $guid = get_input('guid');
  11. $user = get_entity($guid);
  12. if (($user instanceof ElggUser) && ($user->canEdit())) {
  13. if ($user->unban()) {
  14. system_message(elgg_echo('admin:user:unban:yes'));
  15. } else {
  16. register_error(elgg_echo('admin:user:unban:no'));
  17. }
  18. } else {
  19. register_error(elgg_echo('admin:user:unban:no'));
  20. }
  21. access_show_hidden_entities($access_status);
  22. forward(REFERER);