mirror of
https://github.com/nextcloud/server.git
synced 2024-09-09 07:27:20 +02:00
a7df23ceba
This enforces proper types on POST and GET arguments where I considered it sensible. I didn't update some as I don't know what kind of values they would support 🙈 Fixes https://github.com/owncloud/core/issues/14196 for core
17 lines
333 B
PHP
17 lines
333 B
PHP
<?php
|
|
|
|
OC_JSON::checkAdminUser();
|
|
OCP\JSON::callCheck();
|
|
|
|
$username = (string)$_POST['username'];
|
|
$group = (string)$_POST['group'];
|
|
|
|
// Toggle group
|
|
if(OC_SubAdmin::isSubAdminofGroup($username, $group)) {
|
|
OC_SubAdmin::deleteSubAdmin($username, $group);
|
|
}else{
|
|
OC_SubAdmin::createSubAdmin($username, $group);
|
|
}
|
|
|
|
OC_JSON::success();
|