Author: eschwert
Date: Tue Feb 28 19:17:03 2012
New Revision: 1294795
URL: http://svn.apache.org/viewvc?rev=1294795&view=rev
Log:
OPENMEETINGS-60 Anonymous user handling for room entrance
Modified:
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectList.java
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/servlet/RoomsServlet.java
Modified:
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectList.java
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectList.java?rev=1294795&r1=1294794&r2=1294795&view=diff
==============================================================================
---
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectList.java
(original)
+++
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/jira/customfields/RoomSelectList.java
Tue Feb 28 19:17:03 2012
@@ -68,9 +68,11 @@ import com.atlassian.jira.issue.fields.l
return map;
}
//FieldConfig fieldConfig = field.getRelevantConfig(issue);
- //List<Room> rooms = roomService.allNotDeleted();
+ //List<Room> rooms = roomService.allNotDeleted();
+ if(currentUser != null){
List<Room> rooms =
roomService.allNotDeletedByUserName(currentUser.toString());
map.put("rooms", rooms);
+ }
return map;
}
Modified:
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/servlet/RoomsServlet.java
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/servlet/RoomsServlet.java?rev=1294795&r1=1294794&r2=1294795&view=diff
==============================================================================
---
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/servlet/RoomsServlet.java
(original)
+++
incubator/openmeetings/branches/jira-plugin/src/main/java/org/openmeetings/jira/plugin/servlet/RoomsServlet.java
Tue Feb 28 19:17:03 2012
@@ -116,24 +116,39 @@ public final class RoomsServlet extends
try {
if(omGateway.loginUser()){
+ String username = "";
+ String firsname = "";
+ Long userId = 0L;
+ String email = "";
+ int becomeModeratorAsInt = 1;
+ int showAudioVideoTestAsInt = 1;
+
String url =
(String)omPluginSettings.getSomeInfo("url");
String port =
(String)omPluginSettings.getSomeInfo("port");
String externalUserType =
(String)omPluginSettings.getSomeInfo("key");
-
- String firsname =
currentUser.getDisplayName();
- String email =
currentUser.getEmailAddress();
- Long userId = new Date().getTime();
- String username = currentUser.getName();
- int becomeModeratorAsInt = 1;
- int showAudioVideoTestAsInt = 1;
-
+
+ if(currentUser == null){
+ firsname = "anonymous";
+ email = "";
+ userId = new Date().getTime();
+ username = "anonymous";
+ becomeModeratorAsInt = 0;
+ showAudioVideoTestAsInt = 1;
+ }else{
+ firsname = currentUser.getDisplayName();
+ email =
currentUser.getEmailAddress();
+ userId = new Date().getTime();
+ username =
currentUser.getName();
+ becomeModeratorAsInt = 1;
+ showAudioVideoTestAsInt = 1;
+ }
String avatarId =
this.avatarManager.getDefaultAvatarId(Avatar.Type.USER).toString();
//URI avatarUrl =
avatarService.getAvatarURL(currentUser, avatarId, Avatar.Size.SMALL);
//String profilePictureUrl =
avatarUrl.toString();
String profilePictureUrl =
this.getCanonicalBaseUrl() + "/secure/projectavatar?avatarId=" + avatarId +
"&size=small";
Long roomId =
Long.valueOf(req.getParameter("roomId"));
-
+
String roomHash =
omGateway.setUserObjectAndGenerateRoomHash(username, firsname, "",
profilePictureUrl,
email, userId, externalUserType, roomId,
becomeModeratorAsInt,