2014-02-18 20:29:45 +04:00
|
|
|
<?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();
|
|
|
|
|
2014-04-16 19:33:56 +04:00
|
|
|
$l=OC_L10N::get('settings');
|
2014-02-18 20:29:45 +04:00
|
|
|
|
|
|
|
$groupname = $_POST["groupname"];
|
|
|
|
|
|
|
|
// Return Success story
|
|
|
|
// TODO : make changes to the API to allow this.
|
2014-04-16 19:33:56 +04:00
|
|
|
// setGroupname doesnt exist yet.
|
2014-02-18 20:29:45 +04:00
|
|
|
if(OC_Group::setGroupname($groupname)) {
|
2014-02-20 14:00:44 +04:00
|
|
|
OCP\JSON::success(
|
2014-02-18 20:29:45 +04:00
|
|
|
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"))));
|
2014-02-20 13:52:34 +04:00
|
|
|
}
|