Elgg  Version 3.0
unban.php
Go to the documentation of this file.
1 <?php
7 
8 $guid = (int) get_input('guid');
10 
11 if (!$user || !$user->canEdit()) {
13  return elgg_error_response(elgg_echo('admin:user:unban:no'));
14 }
15 
16 if (!$user->unban()) {
18  return elgg_error_response(elgg_echo('admin:user:unban:no'));
19 }
20 
22 
23 return elgg_ok_response('', elgg_echo('admin:user:unban:yes'));
get_user($guid)
Get a user object from a GUID.
Definition: users.php:40
$guid
Definition: unban.php:8
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$access_status
Unbans a user.
Definition: unban.php:6
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
elgg_error_response($error= '', $forward_url=REFERRER, $status_code=ELGG_HTTP_OK)
Prepare an error response to be returned by a page or an action handler.
$user
Definition: unban.php:9
elgg_ok_response($content= '', $message= '', $forward_url=null, $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
access_show_hidden_entities($show_hidden)
Show or hide disabled entities.
Definition: access.php:156