summaryrefslogtreecommitdiff
path: root/populate-ldap/10a-add-vlv-searches.sh
blob: 2c7b5d9522ba807348fc432b7eeebee50a6ba5b1 (plain)
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
#!/bin/bash

 . ./settings.sh

(
    echo "dn: cn=PVS,cn=${domain_db},cn=ldbm database,cn=plugins,cn=config"
    echo "objectClass: top"
    echo "objectClass: vlvSearch"
    echo "cn: PVS"
    echo "vlvBase: ou=People,${rootdn}"
    echo "vlvScope: 2"
    echo "vlvFilter: (objectclass=inetorgperson)"
    echo "aci: (targetattr = \"*\") (version 3.0;acl \"Read Access\";allow (read,compare,search)(userdn = \"ldap:///anyone\");)"
    echo ""
) | ldapadd -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}" -c

(
    echo "dn: cn=RVS,cn=${domain_db},cn=ldbm database,cn=plugins,cn=config"
    echo "objectClass: top"
    echo "objectClass: vlvSearch"
    echo "cn: RVS"
    echo "vlvBase: ou=Resources,${rootdn}"
    echo "vlvScope: 2"
    echo "vlvFilter: (|(&(objectclass=kolabsharedfolder)(kolabfoldertype=event)(mail=*))(objectclass=groupofuniquenames)(objectclass=groupofurls))"
    echo "aci: (targetattr = \"*\") (version 3.0;acl \"Read Access\";allow (read,compare,search)(userdn = \"ldap:///anyone\");)"
    echo ""
) | ldapadd -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}" -c

(
    echo "dn: cn=GVS,cn=${domain_db},cn=ldbm database,cn=plugins,cn=config"
    echo "objectClass: top"
    echo "objectClass: vlvSearch"
    echo "cn: GVS"
    echo "vlvBase: ou=Groups,${rootdn}"
    echo "vlvScope: 2"
    echo "vlvFilter: (|(objectclass=groupofuniquenames)(objectclass=groupofurls))"
    echo "aci: (targetattr = \"*\") (version 3.0;acl \"Read Access\";allow (read,compare,search)(userdn = \"ldap:///anyone\");)"
    echo ""
) | ldapadd -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}" -c

if [ "${domain_base_dn}" != "cn=kolab,cn=config" ]; then
    (
        echo "dn: cn=DVS,cn=${domain_db},cn=ldbm database,cn=plugins,cn=config"
        echo "objectClass: top"
        echo "objectClass: vlvSearch"
        echo "cn: DVS"
        echo "vlvBase: ${domain_base_dn}"
        echo "vlvScope: 2"
        echo "vlvFilter: (objectclass=domainrelatedobject)"
        echo "aci: (targetattr = \"*\") (version 3.0;acl \"Read Access\";allow (read,compare,search)(userdn = \"ldap:///anyone\");)"
        echo ""
    ) | ldapadd -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}" -c
fi