Elgg  Version 4.3
unban.php
Go to the documentation of this file.
1 <?php
6 $guid = (int) get_input('guid');
7 
8 return elgg_call(ELGG_SHOW_DISABLED_ENTITIES, function() use ($guid) {
10 
11  if (!$user || !$user->canEdit()) {
12  return elgg_error_response(elgg_echo('admin:user:unban:no'));
13  }
14 
15  if (!$user->unban()) {
16  return elgg_error_response(elgg_echo('admin:user:unban:no'));
17  }
18 
19  return elgg_ok_response('', elgg_echo('admin:user:unban:yes'));
20 });
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
Definition: elgglib.php:592
get_user($guid)
Get a user object from a GUID.
Definition: users.php:20
$guid
Unbans a user.
Definition: unban.php:6
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
const ELGG_SHOW_DISABLED_ENTITIES
Definition: constants.php:148
get_input($variable, $default=null, $filter_result=true)
Parameter input functions.
Definition: input.php:20
$user
Definition: ban.php:7
elgg_error_response($message= '', $forward_url=REFERRER, int $status_code=ELGG_HTTP_BAD_REQUEST)
Prepare an error response to be returned by a page or an action handler.
elgg_ok_response($content= '', $message= '', $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.