in openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/ActivitiesPanel.java [85:152]
protected void respond(AjaxRequestTarget target) {
if (!isVisible()) {
return;
}
try {
String id = getRequest().getRequestParameters().getParameterValue(PARAM_ID).toString();
long roomId = getRequest().getRequestParameters().getParameterValue(PARAM_ROOM_ID).toLong();
Action act = Action.of(getRequest().getRequestParameters().getParameterValue(ACTION));
Activity a = activities.get(id);
if (a == null || !room.getRoom().getId().equals(roomId)) {
log.error("It seems like we are being hacked!!!!");
return;
}
switch (act) {
case CLOSE:
remove(target, id);
break;
case DECLINE:
if (room.getClient().hasRight(Right.MODERATOR)) {
sendRoom(getRemoveMsg(id));
}
break;
case ACCEPT:
Client client = cm.get(a.getUid());
if (room.getClient().hasRight(Right.MODERATOR) && client != null && client.getRoom() != null && roomId == client.getRoom().getId()) {
switch (a.getType()) {
case REQ_RIGHT_MODERATOR:
sendRoom(getRemoveMsg(id));
room.allowRight(client, Right.MODERATOR);
break;
case REQ_RIGHT_AV:
sendRoom(getRemoveMsg(id));
room.allowRight(client, Right.AUDIO, Right.VIDEO);
break;
case REQ_RIGHT_PRESENTER:
sendRoom(getRemoveMsg(id));
room.allowRight(client, Right.PRESENTER);
break;
case REQ_RIGHT_WB:
sendRoom(getRemoveMsg(id));
room.allowRight(client, Right.WHITEBOARD);
break;
case REQ_RIGHT_SHARE:
sendRoom(getRemoveMsg(id));
room.allowRight(client, Right.SHARE);
break;
case REQ_RIGHT_REMOTE:
sendRoom(getRemoveMsg(id));
room.allowRight(client, Right.REMOTE_CONTROL);
break;
case REQ_RIGHT_A:
sendRoom(getRemoveMsg(id));
room.allowRight(client, Right.AUDIO);
break;
case REQ_RIGHT_MUTE_OTHERS:
sendRoom(getRemoveMsg(id));
room.allowRight(client, Right.MUTE_OTHERS);
break;
default:
break;
}
}
break;
}
} catch (Exception e) {
log.error("Unexpected exception while processing activity action", e);
}
}