Skip to content
This repository was archived by the owner on Sep 7, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
releases
22 changes: 19 additions & 3 deletions .idea/workspace.xml

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

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ For this you need to set-up the Java server extension copy it from https://githu
adminpassword=adminPassword
rocketurl=https://rocket.example.org
loginurl=https://mail.example.org
domaininusername=true

This adminuser and password you should have created when you first installed Rocket. The loginurl is the place where we point users to that have not yet authenticated. This can be your SSO login page or the Zimbra login page. Don't forget `zmmailboxdctl restart`.
This adminuser and password you should have created when you first installed Rocket. The loginurl is the place where we point users to that have not yet authenticated. This can be your SSO login page or the Zimbra login page. The domaininusername property when set to true will create/logon users with their zimbra email address (replacing @ with a . ) i.e user@example.com will be user.example.com. When set to false, the username account would simply be "user". Don't forget `zmmailboxdctl restart`.

You must also configure Rocket chat like so:
![Zimbra Rocket](https://raw.githubusercontent.com/Zimbra-Community/zimbra-rocket/master/img/zimbra-rocket-iframe.png)
Expand All @@ -54,7 +55,7 @@ Edit the /tmp/config_template.xml.tmp file according to your needs. Import the n
zmzimletctl configure /tmp/config_template.xml.tmp

2. **Logon-only integration**
Follow the same steps as under `Full integration` except when configuring the Zimlet set `createRocketAccount` to `false`. The Zimlet assumes you created the account on Rocket chat. So if your Zimbra account is user@example.com a Rocket user account user.example.com should exist.
Follow the same steps as under `Full integration` except when configuring the Zimlet set `createRocketAccount` to `false`. The Zimlet assumes you created the account on Rocket chat. So if your Zimbra account is user@example.com a Rocket user account user.example.com should exist, unless you configured domaininusername in config.properties to true. In that, case the zimlet assumes account"user" exists.

3. **Basic integration**
In this case you may want to configure Rocket to use Zimbra LDAP. See steps below.
Expand Down
50 changes: 50 additions & 0 deletions extension/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<project name="mytest" default="jar" basedir=".">
<description>
Build file for the Zimbra Extension.
</description>

<property name="lib" value="lib/"/>
<property name="build" value="build/"/>
<property name="src" value="src/"/>
<property name="jar" value="rocket.jar"/>

<path id="libraries">
<fileset dir="${lib}" >
<include name="*.jar"/>
</fileset>
</path>

<target name="clean">
<delete dir="${build}"/>
<delete file="rocket.jar"/>
<mkdir dir="${build}"/>
</target>

<target name="compile"
depends="clean">
<javac srcdir="${src}"
destdir="${build}"
includeantruntime="false"
debug="true"
debuglevel="lines,vars,source"
target="13"
source="13">
<classpath>
<path refid="libraries" />
</classpath>
</javac>
</target>

<target name="jar"
depends="compile">
<jar jarfile="${jar}"
compress="false"
basedir="${build}">
<manifest>
<attribute name="Zimbra-Extension-Class" value="tk.barrydegraaff.rocket.RocketExtension" />
</manifest>
<fileset dir="${build}" />
</jar>
</target>

</project>
Binary file not shown.
Binary file not shown.
Binary file added extension/lib/activation-1.1.1.jar
Binary file not shown.
Binary file added extension/lib/ant-1.6.5.jar
Binary file not shown.
Binary file added extension/lib/ant-1.7.0-ziputil-patched.jar
Binary file not shown.
Binary file added extension/lib/ant-contrib-1.0b2.jar
Binary file not shown.
Binary file added extension/lib/ant-tar-patched.jar
Binary file not shown.
Binary file added extension/lib/antisamy-1.5.8z.jar
Binary file not shown.
Binary file added extension/lib/antlr-3.2.jar
Binary file not shown.
Binary file added extension/lib/apache-jsieve-core-0.5.jar
Binary file not shown.
Binary file added extension/lib/apache-jsp-9.4.18.v20190429.jar
Binary file not shown.
Binary file added extension/lib/apache-log4j-extras-1.0.jar
Binary file not shown.
Binary file added extension/lib/asm-3.3.1.jar
Binary file not shown.
Binary file added extension/lib/batik-css-1.7.jar
Binary file not shown.
Binary file added extension/lib/batik-i18n-1.9.jar
Binary file not shown.
Binary file added extension/lib/batik-util-1.8.jar
Binary file not shown.
Binary file added extension/lib/bcprov-jdk15on-1.55.jar
Binary file not shown.
Binary file added extension/lib/commons-cli-1.2.jar
Binary file not shown.
Binary file added extension/lib/commons-codec-1.7.jar
Binary file not shown.
Binary file added extension/lib/commons-collections-3.2.2.jar
Binary file not shown.
Binary file added extension/lib/commons-compress-1.10.jar
Binary file not shown.
Binary file added extension/lib/commons-csv-1.2.jar
Binary file not shown.
Binary file added extension/lib/commons-dbcp-1.4.jar
Binary file not shown.
Binary file added extension/lib/commons-fileupload-1.2.2.jar
Binary file not shown.
Binary file added extension/lib/commons-io-1.4.jar
Binary file not shown.
Binary file added extension/lib/commons-lang-2.6.jar
Binary file not shown.
Binary file added extension/lib/commons-logging.jar
Binary file not shown.
Binary file added extension/lib/commons-net-3.3.jar
Binary file not shown.
Binary file added extension/lib/commons-pool-1.6.jar
Binary file not shown.
Binary file added extension/lib/commons-pool2-2.4.2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added extension/lib/cxf-2.7.18.jar
Binary file not shown.
Binary file added extension/lib/dom4j-1.5.2.jar
Binary file not shown.
Binary file added extension/lib/ehcache-3.1.2.jar
Binary file not shown.
Binary file added extension/lib/freemarker-2.3.19.jar
Binary file not shown.
Binary file added extension/lib/ganymed-ssh2-build210.jar
Binary file not shown.
Binary file added extension/lib/gifencoder-0.9.jar
Binary file not shown.
Binary file added extension/lib/gmbal-api-only-2.2.6.jar
Binary file not shown.
Binary file added extension/lib/guava-23.0.jar
Binary file not shown.
Binary file added extension/lib/helix-core-0.6.1-incubating.jar
Binary file not shown.
Binary file added extension/lib/httpasyncclient-4.1.4.jar
Binary file not shown.
Binary file added extension/lib/httpclient-4.5.8.jar
Binary file not shown.
Binary file added extension/lib/httpcore-4.4.11.jar
Binary file not shown.
Binary file added extension/lib/httpcore-nio-4.4.11.jar
Binary file not shown.
Binary file added extension/lib/httpmime-4.3.1.jar
Binary file not shown.
Binary file added extension/lib/ical4j-0.9.16-patched.jar
Binary file not shown.
Binary file added extension/lib/icu4j-4.8.1.1.jar
Binary file not shown.
Binary file added extension/lib/istack-commons-runtime-3.0.8.jar
Binary file not shown.
Binary file added extension/lib/jackson-annotations-2.9.2.jar
Binary file not shown.
Binary file added extension/lib/jackson-core-2.9.2.jar
Binary file not shown.
Binary file added extension/lib/jackson-databind-2.9.2.jar
Binary file not shown.
Binary file added extension/lib/jackson-dataformat-smile-2.9.2.jar
Binary file not shown.
Binary file not shown.
Binary file added extension/lib/jamm-0.2.5.jar
Binary file not shown.
Binary file added extension/lib/javax.annotation-api-1.2.jar
Binary file not shown.
Binary file added extension/lib/javax.servlet-api-3.1.0.jar
Binary file not shown.
Binary file added extension/lib/javax.ws.rs-api-2.0-m10.jar
Binary file not shown.
Binary file added extension/lib/jaxb-api-2.3.1.jar
Binary file not shown.
Binary file added extension/lib/jaxb-impl-2.3.1.jar
Binary file not shown.
Binary file added extension/lib/jaxen-1.1.3.jar
Binary file not shown.
Binary file added extension/lib/jaxws-api-2.3.1.jar
Binary file not shown.
Binary file added extension/lib/jaxws-rt-2.2.6.jar
Binary file not shown.
Binary file added extension/lib/jcharset-2.0.jar
Binary file not shown.
Binary file added extension/lib/jcommon-1.0.21.jar
Binary file not shown.
Binary file added extension/lib/jcs-1.3.jar
Binary file not shown.
Binary file added extension/lib/jdom-1.1.jar
Binary file not shown.
Binary file added extension/lib/jedis-2.9.0.jar
Binary file not shown.
Binary file added extension/lib/jersey-client-1.11.jar
Binary file not shown.
Binary file added extension/lib/jersey-core-1.11.jar
Binary file not shown.
Binary file added extension/lib/jersey-json-1.11.jar
Binary file not shown.
Binary file added extension/lib/jersey-multipart-1.11.jar
Binary file not shown.
Binary file added extension/lib/jersey-server-1.11.jar
Binary file not shown.
Binary file added extension/lib/jersey-servlet-1.11.jar
Binary file not shown.
Binary file added extension/lib/jfreechart-1.0.15.jar
Binary file not shown.
Binary file added extension/lib/jline-0.9.93.jar
Binary file not shown.
Binary file added extension/lib/jna-3.4.0.jar
Binary file not shown.
Binary file added extension/lib/json.jar
Binary file not shown.
Binary file added extension/lib/jsr181-api-1.0-MR1.jar
Binary file not shown.
Binary file added extension/lib/jsr311-api-1.1.1.jar
Binary file not shown.
Binary file added extension/lib/junixsocket-common-2.0.4.jar
Binary file not shown.
Binary file added extension/lib/junixsocket-demo-2.0.4.jar
Binary file not shown.
Binary file added extension/lib/junixsocket-mysql-2.0.4.jar
Binary file not shown.
Binary file added extension/lib/junixsocket-native-common-2.0.4.jar
Binary file not shown.
Binary file added extension/lib/junixsocket-rmi-2.0.4.jar
Binary file not shown.
Binary file added extension/lib/jython-standalone-2.5.2.jar
Binary file not shown.
Binary file added extension/lib/jzlib-1.0.7.jar
Binary file not shown.
Binary file added extension/lib/libidn-1.24.jar
Binary file not shown.
Binary file added extension/lib/log4j-1.2.16.jar
Binary file not shown.
Binary file added extension/lib/lucene-analyzers-3.5.0.jar
Binary file not shown.
Binary file added extension/lib/lucene-core-3.5.0.jar
Binary file not shown.
Binary file added extension/lib/lucene-smartcn-3.5.0.jar
Binary file not shown.
Binary file added extension/lib/mail-1.4.7.jar
Binary file not shown.
Binary file added extension/lib/mariadb-java-client-2.4.3.jar
Binary file not shown.
Binary file added extension/lib/mina-core-2.0.4.jar
Binary file not shown.
Binary file added extension/lib/native-lib-loader-2.0.2.jar
Binary file not shown.
Binary file added extension/lib/neethi-3.0.2.jar
Binary file not shown.
Binary file added extension/lib/nekohtml-1.9.13.1z.jar
Binary file not shown.
Binary file added extension/lib/oauth-20100527.jar
Binary file not shown.
Binary file added extension/lib/policy-2.3.jar
Binary file not shown.
Binary file added extension/lib/resolver-20050927.jar
Binary file not shown.
Binary file added extension/lib/sac-1.3.jar
Binary file not shown.
Binary file added extension/lib/slf4j-api-1.6.4.jar
Binary file not shown.
Binary file added extension/lib/slf4j-log4j12-1.6.4.jar
Binary file not shown.
Binary file added extension/lib/smack-3.1.0.jar
Binary file not shown.
Binary file added extension/lib/smackx-3.1.0.jar
Binary file not shown.
Binary file added extension/lib/smackx-debug-3.2.1.jar
Binary file not shown.
Binary file added extension/lib/smackx-jingle-3.2.1.jar
Binary file not shown.
Binary file added extension/lib/spring-aop-3.0.7.RELEASE.jar
Binary file not shown.
Binary file added extension/lib/spring-asm-3.0.7.RELEASE.jar
Binary file not shown.
Binary file added extension/lib/spring-beans-3.0.7.RELEASE.jar
Binary file not shown.
Binary file added extension/lib/spring-context-3.0.7.RELEASE.jar
Binary file not shown.
Binary file added extension/lib/spring-core-3.0.7.RELEASE.jar
Binary file not shown.
Binary file not shown.
Binary file added extension/lib/spymemcached-2.12.1.jar
Binary file not shown.
Binary file added extension/lib/sqlite-jdbc-3.7.15-M1.jar
Binary file not shown.
Binary file added extension/lib/stax-ex-1.7.7.jar
Binary file not shown.
Binary file added extension/lib/stax2-api-3.1.1.jar
Binary file not shown.
Binary file added extension/lib/streambuffer-2.2.6.jar
Binary file not shown.
Binary file added extension/lib/syslog4j-0.9.46.jar
Binary file not shown.
Binary file added extension/lib/unboundid-ldapsdk-2.3.5.jar
Binary file not shown.
Binary file added extension/lib/woodstox-core-asl-4.2.0.jar
Binary file not shown.
Binary file added extension/lib/wsdl4j-1.6.3.jar
Binary file not shown.
Binary file added extension/lib/xercesImpl-2.9.1-patch-01.jar
Binary file not shown.
Binary file added extension/lib/xmlschema-core-2.0.3.jar
Binary file not shown.
Binary file added extension/lib/yuicompressor-2.4.2-zimbra.jar
Binary file not shown.
Binary file added extension/lib/zimbra-charset.jar
Binary file not shown.
Binary file added extension/lib/zimbra-native.jar
Binary file not shown.
Binary file modified extension/lib/zimbraclient.jar
Binary file not shown.
Binary file modified extension/lib/zimbracommon.jar
Binary file not shown.
Binary file added extension/lib/zimbrasoap.jar
Binary file not shown.
Binary file modified extension/lib/zimbrastore.jar
Binary file not shown.
Binary file added extension/lib/zkclient-0.1.0.jar
Binary file not shown.
Binary file added extension/lib/zm-ews-stub-2.0.jar
Binary file not shown.
Binary file added extension/lib/zmzimbratozimbramig.jar
Binary file not shown.
Binary file added extension/lib/zookeeper-3.4.5.jar
Binary file not shown.
9 changes: 9 additions & 0 deletions extension/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
all: extension

extension:
ant jar

clean:
rm -f rocket.jar

.PHONY: all extension
34 changes: 29 additions & 5 deletions extension/src/tk/barrydegraaff/rocket/Rocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public String getPath() {
private String adminPassword;
private String rocketURL;
private String loginurl;
private String domaininusername;

/**
* Processes HTTP POST requests.
Expand Down Expand Up @@ -224,16 +225,38 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc
switch (paramsMap.get("action")) {
case "createUser":
String password = newPassword();
if (this.createUser(zimbraAccount.getName(), zimbraAccount.getGivenName() + " " + zimbraAccount.getSn(), password, zimbraAccount.getName().replace("@", "."), zimbraAccount)) {
resp.setHeader("Content-Type", "text/plain");
responseWriter("ok", resp, password);
if (this.domaininusername == "true") {
if (this.createUser(zimbraAccount.getName(), zimbraAccount.getGivenName() + " " + zimbraAccount.getSn(), password, zimbraAccount.getName().replace("@", "."), zimbraAccount)) {
resp.setHeader("Content-Type", "text/plain");
responseWriter("ok", resp, password);
} else {
responseWriter("error", resp, null);
}
} else {
responseWriter("error", resp, null);
if (this.createUser(zimbraAccount.getName(), zimbraAccount.getGivenName() + " " + zimbraAccount.getSn(), password, zimbraAccount.getName().substring(0, zimbraAccount.getName().indexOf("@")), zimbraAccount)) {
resp.setHeader("Content-Type", "text/plain");
responseWriter("ok", resp, password);
} else {
responseWriter("error", resp, null);
}
}
break;
case "signOn":
String token;
token = this.setUserAuthToken(zimbraAccount.getName().replace("@", "."));
if (this.domaininusername == "true") {
token = this.setUserAuthToken(zimbraAccount.getName().replace("@", "."));
} else {
token = this.setUserAuthToken(zimbraAccount.getName().substring(0, zimbraAccount.getName().indexOf("@")));
}
// Creating a File object that represents the disk file.
PrintStream o = new PrintStream(new File("rocket.txt"));

// Store current System.out before assigning a new value
PrintStream console = System.out;

// Assign o to output stream
System.setOut(o);
System.out.println(zimbraAccount.getName().substring(0, zimbraAccount.getName().indexOf("@")));
if (!"".equals(token)) {
resp.setHeader("Content-Type", "application/json");
responseWriter("ok", resp, "{\"loginToken\":\"" + token + "\"}");
Expand Down Expand Up @@ -305,6 +328,7 @@ public Boolean initializeRocketAPI() {
this.adminPassword = prop.getProperty("adminpassword");
this.rocketURL = prop.getProperty("rocketurl");
this.loginurl = prop.getProperty("loginurl");
this.domaininusername = prop.getProperty("domaininusername");
input.close();
} catch (Exception ex) {
ex.printStackTrace();
Expand Down
Binary file added releases/com_zimbra_rocket.zip
Binary file not shown.
Binary file added releases/rocket.jar
Binary file not shown.
3 changes: 3 additions & 0 deletions rocket-test/src/tk/barrydegraaff/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static void main(String[] args) {
String adminPassword;
String rocketURL;
String loginurl;
String domaininusername;

StringBuffer response = new StringBuffer();

Expand All @@ -29,6 +30,8 @@ public static void main(String[] args) {
adminPassword = prop.getProperty("adminpassword");
rocketURL = prop.getProperty("rocketurl");
loginurl = prop.getProperty("loginurl");
domaininusername = prop.getProperty("domaininusername");
System.out.println(domaininusername);
input.close();
} catch (Exception ex) {
ex.printStackTrace();
Expand Down
7 changes: 4 additions & 3 deletions zimlet/com_zimbra_rocket/com_zimbra_rocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ ZimbraRocketZimlet.prototype.init = function () {
try {
var zimletInstance = appCtxt._zimletMgr.getZimletByName('com_zimbra_rocket').handlerObject;
zimletInstance.rocketurl = zimletInstance._zimletContext.getConfig("rocketurl");
zimletInstance.createRocketAccount = zimletInstance._zimletContext.getConfig("createRocketAccount");
zimletInstance.createRocketAccount = zimletInstance._zimletContext.getConfig("createRocketAccount");
zimletInstance.tabLabel = zimletInstance._zimletContext.getConfig("tabLabel");

if(!zimletInstance.userAccountCreateInteger)
{
Expand All @@ -35,7 +36,7 @@ ZimbraRocketZimlet.prototype.setIframe = function()
{
try {
var zimletInstance = appCtxt._zimletMgr.getZimletByName('com_zimbra_rocket').handlerObject;
zimletInstance.ZimbraRocketTab = zimletInstance.createApp("Rocket.Chat", "", "Rocket.Chat");
zimletInstance.ZimbraRocketTab = zimletInstance.createApp(zimletInstance.tabLabel, "", zimletInstance.tabLabel);
var app = appCtxt.getApp(zimletInstance.ZimbraRocketTab);
var appPosition = document.getElementById('skin_container_app_new_button').getBoundingClientRect();
app.setContent('<div style="position: fixed; top:'+appPosition.y+'px; left:0; width:100%; height:92%; border:0px;"><iframe id="ZimbraRocketFrame" style="z-index:2; left:0; width:100%; height:100%; border:0px;" src=\"'+zimletInstance._zimletContext.getConfig("rocketurl")+'\"></div>');
Expand All @@ -53,7 +54,7 @@ function(appName, active) {
var zimletInstance = appCtxt._zimletMgr.getZimletByName('com_zimbra_rocket').handlerObject;
if (active)
{
document.title = 'Zimbra: ' + 'Rocket.Chat';
document.title = 'Zimbra: ' + zimletInstance.tabLabel;
//In the Zimbra tab hide the left menu bar that is displayed by default in Zimbra, also hide the mini calendar
document.getElementById('z_sash').style.display = "none";
//Users that click the tab directly after logging in, will still be served with the calendar, as it is normal
Expand Down
1 change: 1 addition & 0 deletions zimlet/com_zimbra_rocket/config_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ creation set createRocketAccount = true
<global>
<property name="rocketurl">https://rocketserverhere.org/</property>
<property name="createRocketAccount">true</property>
<property name="tabLabel">Rocket.Chat</property>
</global>
</zimletConfig>