fix tooglegroup for subadmins
This commit is contained in:
parent
e42f765697
commit
7f08c84739
1 changed files with 7 additions and 1 deletions
|
@ -3,7 +3,7 @@
|
|||
// Init owncloud
|
||||
require_once('../../lib/base.php');
|
||||
|
||||
OC_JSON::checkAdminUser();
|
||||
OC_JSON::checkSubAdminUser();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$success = true;
|
||||
|
@ -13,6 +13,12 @@ $action = "add";
|
|||
$username = $_POST["username"];
|
||||
$group = OC_Util::sanitizeHTML($_POST["group"]);
|
||||
|
||||
if(!OC_Group::inGroup(OC_User::getUser(), 'admin') && (!OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username) || !OC_SubAdmin::isGroupAccessible(OC_User::getUser(), $group))){
|
||||
$l = OC_L10N::get('core');
|
||||
OC_JSON::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
|
||||
exit();
|
||||
}
|
||||
|
||||
if(!OC_Group::groupExists($group)){
|
||||
OC_Group::createGroup($group);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue