diff options
Diffstat (limited to 'actions/admin')
-rw-r--r-- | actions/admin/user/makeadmin.php | 7 | ||||
-rw-r--r-- | actions/admin/user/removeadmin.php | 7 |
2 files changed, 6 insertions, 8 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')); diff --git a/actions/admin/user/removeadmin.php b/actions/admin/user/removeadmin.php index 445596331..b5872e592 100644 --- a/actions/admin/user/removeadmin.php +++ b/actions/admin/user/removeadmin.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 = ''; - if (!$obj->admin) { +if (($user instanceof ElggUser) && ($user->canEdit())) { + if ($user->removeAdmin()) { system_message(elgg_echo('admin:user:removeadmin:yes')); } else { register_error(elgg_echo('admin:user:removeadmin:no')); |