server/settings/ajax/togglesubadmins.php
Bart Visscher 80d1037e42 Group name does't need to be sanitized before storing it in the database
It should only be sanitized before display
2012-11-27 20:22:45 +01:00

16 lines
317 B
PHP

<?php
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
$username = $_POST["username"];
$group = $_POST["group"];
// Toggle group
if(OC_SubAdmin::isSubAdminofGroup($username, $group)) {
OC_SubAdmin::deleteSubAdmin($username, $group);
}else{
OC_SubAdmin::createSubAdmin($username, $group);
}
OC_JSON::success();