diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-08-22 20:58:21 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-08-22 20:58:21 +0000 |
commit | 46c278c3603765b623fa441e2435274fbeda05ad (patch) | |
tree | c2b926d3195aa71524f9c8b692e567cfd4605b9b /actions/admin | |
parent | f9ee6f1429f800c3eed3c0ef59d98219be32fba8 (diff) | |
download | elgg-46c278c3603765b623fa441e2435274fbeda05ad.tar.gz elgg-46c278c3603765b623fa441e2435274fbeda05ad.tar.bz2 |
Merged r6620:6653 from 1.7 branch into trunk
git-svn-id: http://code.elgg.org/elgg/trunk@6846 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/admin')
-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); |