nextcloud/settings/ajax/changegroupname.php

25 lines
547 B
PHP
Raw Normal View History

<?php
OCP\JSON::callCheck();
2014-02-20 14:00:44 +04:00
OCP\JSON::checkLoggedIn();
2014-02-20 11:54:41 +04:00
OCP\JSON::checkAdminUser();
$l=OC_L10N::get('settings');
$groupname = $_POST["groupname"];
// Return Success story
// TODO : make changes to the API to allow this.
// setGroupname doesnt exist yet.
if(OC_Group::setGroupname($groupname)) {
2014-02-20 14:00:44 +04:00
OCP\JSON::success(
array("data" => array(
"message" => $l->t('Group name has been changed.'),
"groupname" => $groupname,
)
)
);
} else {
2014-02-20 14:00:44 +04:00
OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to change group name"))));
}