6081bfa2bc
Conflicts: lib/search/provider/file.php settings/ajax/changepassword.php settings/settings.php
20 lines
504 B
PHP
20 lines
504 B
PHP
<?php
|
|
|
|
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" => $l->t("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" => $l->t("Unable to add group") )));
|
|
}
|