server/settings/ajax/togglesubadmins.php

17 lines
317 B
PHP
Raw Normal View History

<?php
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
$username = $_POST["username"];
$group = $_POST["group"];
// Toggle group
2012-09-07 13:22:01 +00:00
if(OC_SubAdmin::isSubAdminofGroup($username, $group)) {
OC_SubAdmin::deleteSubAdmin($username, $group);
}else{
OC_SubAdmin::createSubAdmin($username, $group);
}
OC_JSON::success();