Passed
Push — 3.0 ( f60a73...a99576 )
by Jeroen
69:39 queued 12s
created

actions/admin/user/unban.php (1 issue)

Severity
1
<?php
2
/**
3
 * Unbans a user.
4
 */
5
6
$access_status = access_show_hidden_entities(true);
7
8
$guid = (int) get_input('guid');
9
$user = get_user($guid);
10
11
if (!$user || !$user->canEdit()) {
1 ignored issue
show
$user is of type ElggUser, thus it always evaluated to true.
Loading history...
12
	access_show_hidden_entities($access_status);
13
	return elgg_error_response(elgg_echo('admin:user:unban:no'));
14
}
15
16
if (!$user->unban()) {
17
	access_show_hidden_entities($access_status);
18
	return elgg_error_response(elgg_echo('admin:user:unban:no'));
19
}
20
21
access_show_hidden_entities($access_status);
22
23
return elgg_ok_response('', elgg_echo('admin:user:unban:yes'));
24