ldaps.patch
dicos/23_annuaire.xml | ||
---|---|---|
37 | 37 |
<variable name='ldap_replication' type='oui/non' description='Activer la réplication LDAP (fournisseur)'> |
38 | 38 |
<value>non</value> |
39 | 39 |
</variable> |
40 |
<variable name='ldap_replication_ssl' type='oui/non' description='Utilisation du protocole ldaps pour la réplication'> |
|
41 |
<value>non</value> |
|
42 |
</variable> |
|
40 | 43 |
<variable name='ldap_replication_client' type='oui/non' description='Activer la réplication LDAP (client)' hidden='True'> |
41 | 44 |
<value>non</value> |
42 | 45 |
</variable> |
... | ... | |
85 | 88 |
<target type='variable'>ldap_tls</target> |
86 | 89 |
<target type='variable'>ldap_nss</target> |
87 | 90 |
</condition> |
91 |
<condition name='hidden_if_in' source='ldap_replication'> |
|
92 |
<param>non</param> |
|
93 |
<target type='variable'>ldap_replication_ssl</target> |
|
94 |
</condition> |
|
88 | 95 | |
89 | 96 |
<!-- slapd est activé si client_ldap est configuré sur local --> |
90 | 97 |
<condition name='disabled_if_not_in' source='activer_client_ldap'> |
scripts/active_replication.py | ||
---|---|---|
152 | 152 |
# fic.write(replicator_pwd) |
153 | 153 |
# fic.close() |
154 | 154 |
print_green("Génération de la configuration client") |
155 |
if dico.get('ldap_replication_ssl', 'non') == 'oui': |
|
156 |
protocole = 'ldaps' |
|
157 |
port = '636' |
|
158 |
else: |
|
159 |
protocole = 'ldap' |
|
160 |
port = '389' |
|
155 | 161 |
adresse_scribe = readdefault("Adresse utilisée pour accéder au Scribe depuis le client", dico['adresse_ip_eth0']) |
156 | 162 |
libelle = dico['libelle_etab'].replace('%', '%%') |
157 | 163 |
numero = dico['numero_etab'].replace('%', '%%') |
... | ... | |
161 | 167 |
print_green("Ecriture du fichier %s" % conf) |
162 | 168 |
tmpl = """# %s (%s) |
163 | 169 |
syncrepl rid=%%i |
164 |
provider=ldap://%s:389
|
|
170 |
provider=%s://%s:%s
|
|
165 | 171 |
type=refreshAndPersist |
166 | 172 |
interval=00:01:00:00 |
167 | 173 |
retry="60 10 300 +" |
... | ... | |
173 | 179 |
binddn="cn=reader,%s" |
174 | 180 |
credentials=%s |
175 | 181 | |
176 |
""" % (libelle, numero, adresse_scribe, numero, acad,
|
|
182 |
""" % (libelle, numero, protocole, adresse_scribe, port, numero, acad,
|
|
177 | 183 |
dn, replicator_pwd, dn) |
178 | 184 |
fic = file(conf, 'w') |
179 | 185 |
fic.write(tmpl) |