This repository has been archived by the owner on Jan 3, 2018. It is now read-only.
/
initTBitsISP.sh
executable file
·102 lines (86 loc) · 4.66 KB
/
initTBitsISP.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
if ( which yum ); then
if ( ! which wget || ! which patch ); then
yum -y install wget patch
fi
else
if (which apt-get); then
if ( ! which wget || ! which patch ); then
apt-get -y install wget patch;
fi
else echo "Neither yum nor apt-get available. On which platform are you?";
exit 0
fi
fi
#####################################################################################
# apply a couple of patches, see related kolab bugzilla number in filename, eg. https://issues.kolab.org/show_bug.cgi?id=2018
#####################################################################################
# different paths in debian and centOS
pythonDistPackages=/usr/lib/python2.7/dist-packages
# Debian
if [ ! -d $pythonDistPackages ]; then
# centOS
pythonDistPackages=/usr/lib/python2.6/site-packages
fi
echo "applying patchMultiDomainAdminsBug2018.patch"
patch -p1 -i `pwd`/patches/patchMultiDomainAdminsBug2018.patch -d /usr/share/kolab-webadmin
echo "applying domainquotaBug2046.patch"
patch -p1 -i `pwd`/patches/domainquotaBug2046.patch -d /usr/share/kolab-webadmin
echo "applying domainAdminDefaultQuota.patch"
patch -p1 -i `pwd`/patches/domainAdminDefaultQuota.patch -d /usr/share/kolab-webadmin
echo "applying domainAdminMaxAccounts.patch"
patch -p1 -i `pwd`/patches/domainAdminMaxAccounts.patch -d /usr/share/kolab-webadmin
#echo "applying domainAdminEnableGroupware.patch"
#patch -p1 -i `pwd`/patches/domainAdminEnableGroupware.patch -d /usr/share/kolab-webadmin
echo "applying lastLoginTBitsAttribute patch"
patch -p1 -i `pwd`/patches/lastLoginTBitsAttribute-wap.patch -d /usr/share/kolab-webadmin
patch -p1 -i `pwd`/patches/lastLoginTBitsAttribute-pykolab.patch -d $pythonDistPackages
echo "applying allowPrimaryEmailAddressFromDomain.patch"
patch -p1 -i `pwd`/patches/allowPrimaryEmailAddressFromDomain.patch -d $pythonDistPackages
#####################################################################################
#using specific ldap attribute for the domainadmin overall quota
#####################################################################################
sed -r -i -e "s/\[kolab\]/[kolab]\ndomainadmin_quota_attribute = tbitskolaboverallquota/g" /etc/kolab/kolab.conf
#####################################################################################
#disable LDAP debugging
#####################################################################################
sed -r -i -e 's/config_set\("debug", true\)/config_set("debug", false)/g' /usr/share/kolab-webadmin/lib/Auth/LDAP.php
#####################################################################################
#extend the LDAP schema for TBits ISP patches
#####################################################################################
for d in /etc/dirsrv/slapd*
do
cp patches/99tbits.ldif $d/schema/
done
service dirsrv restart
#####################################################################################
#create new user_type domainadmin
#add tbitsKolabUser objectclass to Kolab user, for last login time
#####################################################################################
php initTBitsUserTypes.php
#####################################################################################
#set the domain for management of the domain admins
#####################################################################################
sed -r -i -e "s/\[kolab\]/[kolab]\ndomainadmins_management_domain = administrators.org/g" /etc/kolab/kolab.conf
php initDomainAdminManagementDomain.php
#####################################################################################
#disabled: only give users with role enable-groupware-features the permission to use calendar, tasks, files etc in Roundcube
#####################################################################################
if [ 1 -eq 2 ]
then
sed -r -i -e "s/'calendar',/#'calendar',/g" /etc/roundcubemail/config.inc.php
sed -r -i -e "s/'kolab_activesync',/#'kolab_activesync',/g" /etc/roundcubemail/config.inc.php
sed -r -i -e "s/'kolab_addressbook',/#'kolab_addressbook',/g" /etc/roundcubemail/config.inc.php
sed -r -i -e "s/'kolab_files',/#'kolab_files',/g" /etc/roundcubemail/config.inc.php
sed -r -i -e "s/'tasklist',/#'tasklist',/g" /etc/roundcubemail/config.inc.php
KolabAuthRolePlugins="rcmail_config['kolab_auth_role_plugins'] = array( \
'cn=enable-groupware-features,%dc' => array( \
'calendar', \
'kolab_activesync', \
'kolab_addressbook', \
'kolab_files', \
'tasklist', \
), \
);"
sed -r -i -e "s/config\['plugins'\] = array\(/$KolabAuthRolePlugins\n\$config['plugins'] = array(/g" /etc/roundcubemail/config.inc.php
fi