Skip to content

Commit

Permalink
DESC-72 ZBUG-4085 allow Zimbra Desktop users to copy/paste join url, …
Browse files Browse the repository at this point in the history
…fix german i18n
  • Loading branch information
barrydegraaff committed Aug 6, 2024
1 parent ee1687f commit 803dbcd
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 79 deletions.
4 changes: 2 additions & 2 deletions bbb-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ rm -Rf $TMPFOLDER

echo "Deploying Zimlets"
cd /tmp
wget --no-cache https://github.com/Zimbra-Community/bigbluebutton-zimlet/releases/download/0.0.7/tk_barrydegraaff_bigbluebutton.zip -O /tmp/tk_barrydegraaff_bigbluebutton.zip
wget --no-cache https://github.com/Zimbra/zimbra-zimlet-bigbluebutton/releases/download/0.0.6/zimbra-zimlet-bigbluebutton.zip -O /tmp/zimbra-zimlet-bigbluebutton.zip
wget --no-cache https://github.com/Zimbra-Community/bigbluebutton-zimlet/releases/download/0.0.8/tk_barrydegraaff_bigbluebutton.zip -O /tmp/tk_barrydegraaff_bigbluebutton.zip
wget --no-cache https://github.com/Zimbra/zimbra-zimlet-bigbluebutton/releases/download/0.0.8/zimbra-zimlet-bigbluebutton.zip -O /tmp/zimbra-zimlet-bigbluebutton.zip
su - zimbra -c "/opt/zimbra/bin/zmzimletctl deploy /tmp/tk_barrydegraaff_bigbluebutton.zip"
su - zimbra -c "/opt/zimbra/bin/zmzimletctl deploy /tmp/zimbra-zimlet-bigbluebutton.zip"
su - zimbra -c "zmmailboxdctl restart"
Expand Down
105 changes: 31 additions & 74 deletions extension/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions extension/i18n/english.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ join1 = Meeting ID
join2 = Your name
join3 = Password
join4 = Join Meeting
join5 = If you are in Zimbra Desktop you can copy the URL from below and open it in your web browser
1 change: 1 addition & 0 deletions extension/i18n/french.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ join1 = ID de la r\u00E9union
join2 = Votre nom
join3 = Mot de passe
join4 = Rejoindre la r\u00E9union
join5 = If you are in Zimbra Desktop you can copy the URL from below and open it in your web browser
Binary file modified extension/out/artifacts/BigBlueButton_jar/BigBlueButton.jar
Binary file not shown.
Binary file not shown.
24 changes: 22 additions & 2 deletions extension/src/tk/barrydegraaff/bigbluebutton/BigBlueButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public String getPath() {
private String join2;
private String join3;
private String join4;
private String join5;

/**
* Processes HTTP POST requests.
Expand Down Expand Up @@ -147,6 +148,7 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc
this.join2 = prop.getProperty("join2");
this.join3 = prop.getProperty("join3");
this.join4 = prop.getProperty("join4");
this.join5 = prop.getProperty("join5");
input.close();
} catch (Exception ex) {
ex.printStackTrace();
Expand Down Expand Up @@ -202,8 +204,9 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc
) {
String joinUrl = bbbRequest("join", "meetingID=" + meeting.getString("meetingId") + "&password=" + req.getParameter("password") + "&fullName=" + encodeURIComponent(req.getParameter("name")));
resp.setCharacterEncoding("UTF-8");
resp.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
resp.setHeader("Location", joinUrl);
//resp.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
//resp.setHeader("Location", joinUrl);
joinPage(resp, joinUrl);
} else {
showPage(resp, meeting.getString("meetingId"));
}
Expand Down Expand Up @@ -343,6 +346,23 @@ private void showPage(HttpServletResponse resp, String meetingID) throws IOExcep
}
}

private void joinPage(HttpServletResponse resp, String meetingURL) throws IOException, ServletException {
try {

resp.setHeader("Content-Type", "text/html");

resp.getOutputStream().print("<!DOCTYPE HTML>\r\n<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><style>");

byte[] encoded = Files.readAllBytes(Paths.get("/opt/zimbra/lib/ext/bigbluebutton/page.css"));
resp.getOutputStream().print(new String(encoded, StandardCharsets.UTF_8));
resp.getOutputStream().print("</style><title>Zimbra BigBlueButton Meeting</title>");
resp.getOutputStream().print("</head><body><div class=\"main\"><div class=\"logo\"></div><h1>"+this.join4+"</h1><p><a href=\""+meetingURL+"\">"+this.mail2+"</a><br><br>" + this.join5 + "<br><br><input type=\"text\" value=\""+meetingURL+"\"></p>");
} catch (
Exception ex) {
ex.printStackTrace();
}
}

private void sendConfirmation(Account account, String meetingId, String attendeePassword, String moderatorPassword, String hostname) {
try {
MimeMessage mm = new Mime.FixedMimeMessage(JMSession.getSmtpSession(account));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<zimlet name="tk_barrydegraaff_bigbluebutton" version="0.0.7" label="BigBlueButton" description="BigBlueButton provides real-time sharing of audio, video, slides, chat, and screen.">
<zimlet name="tk_barrydegraaff_bigbluebutton" version="0.0.8" label="BigBlueButton" description="BigBlueButton provides real-time sharing of audio, video, slides, chat, and screen.">
<summary></summary>
<resource>BigBlueButton.png</resource>
<include>tk_barrydegraaff_bigbluebutton.js</include>
Expand Down

0 comments on commit 803dbcd

Please sign in to comment.