summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartina Pietruschka2015-08-04 23:37:09 +0000
committerMartina Pietruschka2015-08-04 23:37:09 +0000
commit2f45b2a3425875028d8067d9e02f6978e44e203b (patch)
tree1ee769009fa1b8eaec07b42b840af4625ff70e88
downloadaur-2f45b2a3425875028d8067d9e02f6978e44e203b.tar.gz
init
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD32
-rw-r--r--mdm_login.patch29
-rw-r--r--zarafa-webaccess-mdm.ini2
4 files changed, 82 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c6f9621a322e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = zarafa-webaccess-mdm
+ pkgdesc = Mobile Device Management plugin for Zarafa Webaccess
+ pkgver = 2.1
+ pkgrel = 1
+ url = https://community.zarafa.com/mod/community_plugins/download.php?release_guid=9498
+ arch = any
+ license = AGPL3
+ depends = zarafa-webaccess
+ depends = z-push
+ depends = php
+ source = mdm2.zip::https://community.zarafa.com/mod/community_plugins/download.php?release_guid=9498
+ source = zarafa-webaccess-mdm.ini
+ source = mdm_login.patch
+ md5sums = 1de30b0292198e25f07c4ea9159901bf
+ md5sums = de837fc5ad2e8f2d70df5037f2a0a107
+ md5sums = 88b10c74bc6e7194c52e282a336e1ac7
+
+pkgname = zarafa-webaccess-mdm
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..083f3247ac2b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,32 @@
+# Maintainer: MartiMcFly info@pietma.com
+
+pkgname=('zarafa-webaccess-mdm')
+_pkgname=('mdm')
+pkgver=2.1
+pkgrel=1
+pkgdesc=('Mobile Device Management plugin for Zarafa Webaccess')
+arch=('any')
+url=('https://community.zarafa.com/mod/community_plugins/download.php?release_guid=9498')
+source=('mdm2.zip::https://community.zarafa.com/mod/community_plugins/download.php?release_guid=9498'
+ 'zarafa-webaccess-mdm.ini'
+ 'mdm_login.patch')
+license=('AGPL3')
+depends=('zarafa-webaccess'
+ 'z-push'
+ 'php')
+md5sums=('1de30b0292198e25f07c4ea9159901bf'
+ 'de837fc5ad2e8f2d70df5037f2a0a107'
+ '88b10c74bc6e7194c52e282a336e1ac7')
+
+package() {
+ cd ${srcdir}/${_pkgname}
+
+ patch -BNp1 -i ${srcdir}/mdm_login.patch
+
+ # create folders
+ mkdir -p ${pkgdir}/usr/share/webapps/zarafa-webaccess/plugins/${_pkgname}/
+ cp -r * ${pkgdir}/usr/share/webapps/zarafa-webaccess/plugins/${_pkgname}/
+
+ mkdir -p ${pkgdir}/etc/php/conf.d
+ cp ${srcdir}/${pkgname}.ini ${pkgdir}/etc/php/conf.d
+}
diff --git a/mdm_login.patch b/mdm_login.patch
new file mode 100644
index 000000000000..be2d17c1991c
--- /dev/null
+++ b/mdm_login.patch
@@ -0,0 +1,29 @@
+Index: mdm/plugin.mdm.php
+===================================================================
+--- mdm/plugin.mdm.php (revision 45793)
++++ mdm/plugin.mdm.php (working copy)
+@@ -378,12 +378,23 @@
+ if (! class_exists('SoapClient'))
+ return false;
+
++ $password = $_SESSION['password'];
++ if(function_exists("openssl_decrypt")) {
++ // In PHP 5.3.3 the iv parameter was added
++ if(version_compare(phpversion(), "5.3.3", "<")) {
++ $password = openssl_decrypt($password,"des-ede3-cbc",PASSWORD_KEY,0);
++ } else {
++ $password = openssl_decrypt($password,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV);
++ }
++ } elseif(function_exists("mcrypt_decrypt")) {
++ $password = trim(mcrypt_decrypt(MCRYPT_TRIPLEDES, PASSWORD_KEY, base64_decode($password), MCRYPT_MODE_CBC, PASSWORD_IV));
++ }
+ $client = new SoapClient(null, array(
+ 'location' => $GLOBALS['pluginconfig']['mdm']['zpush-url'] ."/Microsoft-Server-ActiveSync?Cmd=WebserviceDevice&DeviceId=webservice&DeviceType=webservice&User=". urlencode($targetUser),
+ 'uri' => "http://z-push.sf.net/webservice",
+ 'trace' => 1,
+ 'login' => $_SESSION["username"],
+- 'password' => $_SESSION["password"]
++ 'password' => $password
+ ));
+
+ return $client;
diff --git a/zarafa-webaccess-mdm.ini b/zarafa-webaccess-mdm.ini
new file mode 100644
index 000000000000..b0fde93dacec
--- /dev/null
+++ b/zarafa-webaccess-mdm.ini
@@ -0,0 +1,2 @@
+extension=openssl.so
+extension=soap.so \ No newline at end of file