|
|
@ -8,12 +8,15 @@ import de.anomic.data.bookmarksDB.Bookmark;
|
|
|
|
|
|
|
|
|
|
|
|
public class addTag {
|
|
|
|
public class addTag {
|
|
|
|
public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
|
|
|
|
public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch<?> env) {
|
|
|
|
// return variable that accumulates replacements
|
|
|
|
|
|
|
|
final plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
|
|
|
|
final plasmaSwitchboard switchboard = (plasmaSwitchboard) env;
|
|
|
|
final serverObjects prop = new serverObjects();
|
|
|
|
final serverObjects prop = new serverObjects();
|
|
|
|
|
|
|
|
boolean isAdmin = false;
|
|
|
|
|
|
|
|
isAdmin = switchboard.verifyAuthentication(header, true);
|
|
|
|
|
|
|
|
|
|
|
|
prop.put("result", "0");//error
|
|
|
|
prop.put("result", "0");//error
|
|
|
|
//rename tags
|
|
|
|
//rename tags
|
|
|
|
if(post != null) {
|
|
|
|
if(post != null && isAdmin) {
|
|
|
|
if (post.containsKey("selectTag") && post.containsKey("addTag")) {
|
|
|
|
if (post.containsKey("selectTag") && post.containsKey("addTag")) {
|
|
|
|
switchboard.bookmarksDB.addTag(post.get("selectTag"), post.get("addTag"));
|
|
|
|
switchboard.bookmarksDB.addTag(post.get("selectTag"), post.get("addTag"));
|
|
|
|
prop.put("result", "1");//success
|
|
|
|
prop.put("result", "1");//success
|
|
|
|