aboutsummaryrefslogtreecommitdiff
path: root/actions/admin/user/makeadmin.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/admin/user/makeadmin.php')
-rw-r--r--actions/admin/user/makeadmin.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/actions/admin/user/makeadmin.php b/actions/admin/user/makeadmin.php
index 580e7df05..dc5c508fb 100644
--- a/actions/admin/user/makeadmin.php
+++ b/actions/admin/user/makeadmin.php
@@ -15,11 +15,10 @@ admin_gatekeeper();
// Get the user
$guid = get_input('guid');
-$obj = get_entity($guid);
+$user = get_entity($guid);
-if (($obj instanceof ElggUser) && ($obj->canEdit())) {
- $obj->admin = 'yes';
- if ($obj->admin) {
+if (($user instanceof ElggUser) && ($user->canEdit())) {
+ if ($user->makeAdmin()) {
system_message(elgg_echo('admin:user:makeadmin:yes'));
} else {
register_error(elgg_echo('admin:user:makeadmin:no'));