summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-07-18 17:23:40 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-07-18 17:23:40 +0200
commitfb6468936e2b65d7d14f6b86ff3933f6fe0a6cc4 (patch)
treef003dbbf17c5612c36a5a3e919768d684ef944c5 /settings
parenta5bebb86a59a156d00bbd36f477696ddd38ca092 (diff)
downloadnextcloud-server-fb6468936e2b65d7d14f6b86ff3933f6fe0a6cc4.tar.gz
nextcloud-server-fb6468936e2b65d7d14f6b86ff3933f6fe0a6cc4.zip
fix removeuser.php for subadmins
Diffstat (limited to 'settings')
-rw-r--r--settings/ajax/removeuser.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/settings/ajax/removeuser.php b/settings/ajax/removeuser.php
index 230815217c3..01b28396393 100644
--- a/settings/ajax/removeuser.php
+++ b/settings/ajax/removeuser.php
@@ -3,11 +3,27 @@
// Init owncloud
require_once('../../lib/base.php');
-OC_JSON::checkAdminUser();
+OC_JSON::checkSubAdminUser();
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();
+ }
+}
+
// Return Success story
if( OC_User::deleteUser( $username )){
OC_JSON::success(array("data" => array( "username" => $username )));