You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud-server/settings/ajax/creategroup.php

21 lines
490 B

<?php
13 years ago
OCP\JSON::callCheck();
OC_JSON::checkAdminUser();
$groupname = $_POST["groupname"];
// Does the group exist?
if( in_array( $groupname, OC_Group::getGroups())) {
OC_JSON::error(array("data" => array( "message" => 'Group already exists' )));
exit();
}
// Return Success story
if( OC_Group::createGroup( $groupname )) {
OC_JSON::success(array("data" => array( "groupname" => $groupname )));
}
else{
OC_JSON::error(array("data" => array( "message" => 'Unable to add group' )));
}