diff options
Diffstat (limited to 'actions')
-rw-r--r-- | actions/admin/user/delete.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/actions/admin/user/delete.php b/actions/admin/user/delete.php index c22d27e8a..61dbc7e10 100644 --- a/actions/admin/user/delete.php +++ b/actions/admin/user/delete.php @@ -9,16 +9,19 @@ */ -// block non-admin users +// block non-admin users - require since this action is not registered admin_gatekeeper(); // Get the user $guid = get_input('guid'); $obj = get_entity($guid); +$name = $obj->name; +$username = $obj->username; + if (($obj instanceof ElggUser) && ($obj->canEdit())) { if ($obj->delete()) { - system_message(elgg_echo('admin:user:delete:yes')); + system_message(sprintf(elgg_echo('admin:user:delete:yes'), $name)); } else { register_error(elgg_echo('admin:user:delete:no')); } @@ -26,5 +29,10 @@ if (($obj instanceof ElggUser) && ($obj->canEdit())) { register_error(elgg_echo('admin:user:delete:no')); } -forward($_SERVER['HTTP_REFERER']); -exit; +// forward to user administration if on a user's page as it no longer exists +$forward = REFERER; +if (strpos($_SERVER['HTTP_REFERER'], $username) != FALSE) { + $forward = "pg/admin/user/"; +} + +forward($forward); |