diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-07-19 16:35:14 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-07-19 16:35:14 +0200 |
commit | ffc55f351013b46c841ed1c477de6328169ac4cd (patch) | |
tree | f4023487e32c68930885802b4902d964d7a1a57c /settings/ajax/removeuser.php | |
parent | 6e139f16e4a245fb77d97d495fd8f1ce991a733b (diff) | |
download | nextcloud-server-ffc55f351013b46c841ed1c477de6328169ac4cd.tar.gz nextcloud-server-ffc55f351013b46c841ed1c477de6328169ac4cd.zip |
simplify code of remoteuser.php
Diffstat (limited to 'settings/ajax/removeuser.php')
-rw-r--r-- | settings/ajax/removeuser.php | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/settings/ajax/removeuser.php b/settings/ajax/removeuser.php index 01b28396393..1439cfe373a 100644 --- a/settings/ajax/removeuser.php +++ b/settings/ajax/removeuser.php @@ -8,20 +8,10 @@ OCP\JSON::callCheck(); $username = $_POST["username"]; -if(!OC_Group::inGroup(OC_User::getUser(), 'admin') && OC_SubAdmin::isSubAdmin(OC_User::getUser())){ - $accessiblegroups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()); - $isuseraccessible = false; - foreach($accessiblegroups as $accessiblegroup){ - if(OC_Group::inGroup($username, $accessiblegroup)){ - $isuseraccessible = true; - break; - } - } - if(!$isuseraccessible){ - $l = OC_L10N::get('core'); - self::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); - exit(); - } +if(!OC_Group::inGroup(OC_User::getUser(), 'admin') && !OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)){ + $l = OC_L10N::get('core'); + self::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); + exit(); } // Return Success story |