add another file which was missing in the previous commit

This commit is contained in:
Georg Ehrke 2012-07-15 16:32:57 +02:00
parent e707e94857
commit 044134a289
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<?php
// Init owncloud
require_once('../../lib/base.php');
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
$success = true;
$error = "add user to";
$action = "add";
$username = $_POST["username"];
$group = OC_Util::sanitizeHTML($_POST["group"]);
// Toggle group
if(OC_SubAdmin::isSubAdminofGroup($username, $group)){
OC_SubAdmin::deleteSubAdmin($username, $group);
}else{
OC_SubAdmin::createSubAdmin($username, $group);
}
OC_JSON::success();