aboutsummaryrefslogtreecommitdiff
path: root/actions/admin/user/unban.php
blob: 7a772a0d38272cfe821eb92f45b67e99b2059700 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);