Adding missing translation

This commit is contained in:
Thomas Mueller 2012-09-04 20:47:15 +02:00
parent 69ee842521
commit ae8d2d029f
1 changed files with 8 additions and 6 deletions

View File

@ -7,9 +7,6 @@ OC_JSON::checkSubAdminUser();
OCP\JSON::callCheck();
$success = true;
$error = "add user to";
$action = "add";
$username = $_POST["username"];
$group = OC_Util::sanitizeHTML($_POST["group"]);
@ -23,11 +20,16 @@ if(!OC_Group::groupExists($group)) {
OC_Group::createGroup($group);
}
$l = OC_L10N::get('settings');
$error = $l->t("Unable to add user to group %s", $group);
$action = "add";
// Toggle group
if( OC_Group::inGroup( $username, $group )) {
$action = "remove";
$error = "remove user from";
$success = OC_Group::removeFromGroup( $username, $group );
$error = $l->t("Unable to remove user from group %s", $group);
$success = OC_Group::removeFromGroup( $username, $group );
$usersInGroup=OC_Group::usersInGroup($group);
if(count($usersInGroup)==0) {
OC_Group::deleteGroup($group);
@ -42,5 +44,5 @@ if( $success ) {
OC_JSON::success(array("data" => array( "username" => $username, "action" => $action, "groupname" => $group )));
}
else{
OC_JSON::error(array("data" => array( "message" => "Unable to $error group $group" )));
OC_JSON::error(array("data" => array( "message" => $error )));
}