diff options
-rw-r--r-- | actions/admin/user/ban.php | 31 | ||||
-rw-r--r-- | actions/admin/user/delete.php | 29 | ||||
-rw-r--r-- | languages/en.php | 10 | ||||
-rw-r--r-- | mod/profile/views/default/profile/userdetails.php | 13 | ||||
-rw-r--r-- | views/default/admin/user.php | 3 |
5 files changed, 83 insertions, 3 deletions
diff --git a/actions/admin/user/ban.php b/actions/admin/user/ban.php new file mode 100644 index 000000000..188ab9c7a --- /dev/null +++ b/actions/admin/user/ban.php @@ -0,0 +1,31 @@ +<?php + /** + * Elgg ban user + * + * @package Elgg + * @subpackage Core + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Marcus Povey + * @copyright Curverider Ltd 2008 + * @link http://elgg.org/ + */ + + // block non-admin users + admin_gatekeeper(); + + // Get the user + $guid = get_input('guid'); + $obj = get_entity($guid); + + if ( ($obj instanceof ElggUser) && ($obj->canEdit())) + { + + // TODO: Ban user + + + + + } + else + system_message(elgg_echo('admin:user:ban:no')); +?>
\ No newline at end of file diff --git a/actions/admin/user/delete.php b/actions/admin/user/delete.php new file mode 100644 index 000000000..c449bfe57 --- /dev/null +++ b/actions/admin/user/delete.php @@ -0,0 +1,29 @@ +<?php + /** + * Elgg delete user + * + * @package Elgg + * @subpackage Core + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Marcus Povey + * @copyright Curverider Ltd 2008 + * @link http://elgg.org/ + */ + + // block non-admin users + admin_gatekeeper(); + + // Get the user + $guid = get_input('guid'); + $obj = get_entity($guid); + + if ( ($obj instanceof ElggUser) && ($obj->canEdit())) + { + if (delete_entity($guid)) + system_message(elgg_echo('admin:user:delete:yes')); + else + system_message(elgg_echo('admin:user:delete:no')); + } + else + system_message(elgg_echo('admin:user:delete:no')); +?>
\ No newline at end of file diff --git a/languages/en.php b/languages/en.php index 1e2b6dd91..b8a60d9a9 100644 --- a/languages/en.php +++ b/languages/en.php @@ -244,7 +244,12 @@ 'admin:statistics:label:onlineusers' => "%d Most recent users online", 'admin:user:label:search' => "Find users:", - 'admin:user:label:seachbutton' => "Search",
+ 'admin:user:label:seachbutton' => "Search", + + 'admin:user:ban:no' => "Can not ban user", + 'admin:user:ban:yes' => "User banned.", + 'admin:user:delete:no' => "Can not delete user", + 'admin:user:delete:yes' => "User deleted",
/**
@@ -256,7 +261,8 @@ 'edit' => "Edit",
'delete' => "Delete",
'load' => "Load",
- 'upload' => "Upload",
+ 'upload' => "Upload", + 'ban' => "Ban",
/**
* Generic data words
diff --git a/mod/profile/views/default/profile/userdetails.php b/mod/profile/views/default/profile/userdetails.php index c405e78a9..a2918b2a3 100644 --- a/mod/profile/views/default/profile/userdetails.php +++ b/mod/profile/views/default/profile/userdetails.php @@ -73,6 +73,19 @@ </p>
<?php
+ + // TODO: Add admin console options here + if (isadminloggedin()) + { +?> + <p> + <a href="<?php echo $vars['url']; ?>actions/admin/user/ban?guid=<?php echo $vars['entity']->guid; ?> ?>"><?php echo elgg_echo("ban"); ?></a> + </p> + <p> + <a href="<?php echo $vars['url']; ?>actions/admin/user/delete?guid=<?php echo $vars['entity']->guid; ?> ?>"><?php echo elgg_echo("delete"); ?></a> + </p> +<?php + } }
?>
\ No newline at end of file diff --git a/views/default/admin/user.php b/views/default/admin/user.php index ee708d30e..6994851c6 100644 --- a/views/default/admin/user.php +++ b/views/default/admin/user.php @@ -9,10 +9,11 @@ * @author Marcus Povey * @copyright Curverider Ltd 2008 * @link http://elgg.org/ - **/ + */ // Description of what's going on echo "<p>" . nl2br(elgg_echo("admin:user:description")) . "</p>"; echo elgg_view("admin/user_opt/search"); + ?>
\ No newline at end of file |