cubicweb #2410188 Fix ldap user in CubicWeb version: 3.14.5 [open]

When installing pegase 3.3.0.5 (aka 0.16.0) @senoko (first pegase installation), Auc & David had to do a hotfix for the connection to the AD.

We need this fix on a 3.14.5.? version, in order to be sure not to forget it if/when we will prepare a new version of pegase for Senoko, before we move to CW 3.15. (not planned).

We cannot afford going to 3.15 or even 3.14.9 or something - we do not have time to fully test a new cw, and due to past experiences, we do not trust blindly new cw versions, even minor.

Here is the fix (cf. auc for detail)

Thanks.

diff --git a/server/sources/ldapuser.py b/server/sources/ldapuser.py --- a/server/sources/ldapuser.py +++ b/server/sources/ldapuser.py @@ -480,10 +480,10 @@

ReST / HTML errors:System Message: ERROR/3 (&lt;string&gt; , line 16)</p>
Unexpected indentation.
except ldap.LDAPError: # Invalid protocol version, fall back safely
conn.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION2)
ReST / HTML errors:System Message: WARNING/2 (&lt;string&gt; , line 18)</p>
Definition list ends without a blank line; unexpected unindent.

# Deny auto-chasing of referrals to be safe, we handle them instead

ReST / HTML errors:System Message: WARNING/2 (&lt;string&gt; , line 19)</p>
Block quote ends without a blank line; unexpected unindent.
  • #try:
  • # connection.set_option(ldap.OPT_REFERRALS, 0)
  • #except ldap.LDAPError: # Cannot set referrals, so do nothing
  • # pass
ReST / HTML errors:System Message: WARNING/2 (&lt;string&gt; , line 23)</p>
Bullet list ends without a blank line; unexpected unindent.
  • try:
  • conn.set_option(ldap.OPT_REFERRALS, 0)
  • except ldap.LDAPError: # Cannot set referrals, so do nothing
  • pass
ReST / HTML errors:System Message: WARNING/2 (&lt;string&gt; , line 27)</p>
Bullet list ends without a blank line; unexpected unindent.
#conn.set_option(ldap.OPT_NETWORK_TIMEOUT, conn_timeout) #conn.timeout = op_timeout # Now bind with the credentials given. Let exceptions propagate out.
prioritynormal
typeenhancement
done in<not specified>
closed by<not specified>