aboutsummaryrefslogtreecommitdiffstats
path: root/settings/ajax/removeuser.php
diff options
context:
space:
mode:
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