summaryrefslogtreecommitdiffstats
path: root/settings/ajax/removeuser.php
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-07-19 16:35:14 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-07-19 16:35:14 +0200
commitffc55f351013b46c841ed1c477de6328169ac4cd (patch)
treef4023487e32c68930885802b4902d964d7a1a57c /settings/ajax/removeuser.php
parent6e139f16e4a245fb77d97d495fd8f1ce991a733b (diff)
downloadnextcloud-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.php18
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