aboutsummaryrefslogtreecommitdiff
path: root/actions/admin/user/unban.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/admin/user/unban.php')
-rw-r--r--actions/admin/user/unban.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/actions/admin/user/unban.php b/actions/admin/user/unban.php
new file mode 100644
index 000000000..7a772a0d3
--- /dev/null
+++ b/actions/admin/user/unban.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Unbans a user.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.User
+ */
+
+$access_status = access_get_show_hidden_status();
+access_show_hidden_entities(true);
+
+$guid = get_input('guid');
+$user = get_entity($guid);
+
+if (($user instanceof ElggUser) && ($user->canEdit())) {
+ if ($user->unban()) {
+ system_message(elgg_echo('admin:user:unban:yes'));
+ } else {
+ register_error(elgg_echo('admin:user:unban:no'));
+ }
+} else {
+ register_error(elgg_echo('admin:user:unban:no'));
+}
+
+access_show_hidden_entities($access_status);
+
+forward(REFERER);