aboutsummaryrefslogtreecommitdiff
path: root/actions/admin/user
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 16:08:42 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 16:08:42 +0000
commit36ef345eb6425106f061fb866d9fa66d051e16df (patch)
tree53fb2bd05f8b5e2010f9e3d1e93075ad7071ec1e /actions/admin/user
parent5571ca5b350fd1735f13af7ddfbb88afa6befb0c (diff)
downloadelgg-36ef345eb6425106f061fb866d9fa66d051e16df.tar.gz
elgg-36ef345eb6425106f061fb866d9fa66d051e16df.tar.bz2
Merged 5530:5604 from 1.7 to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5622 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/admin/user')
-rw-r--r--actions/admin/user/makeadmin.php7
-rw-r--r--actions/admin/user/removeadmin.php7
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'));