@@ -19,12 +19,13 @@ news
- #419 don't strip passwords for login forms, make rhodecode
more compatible with LDAP servers
- Added HTTP_X_FORWARDED_FOR as another method of extracting
IP for pull/push logs. - moved all to base controller
- #415: Adding comment to changeset causes reload.
Comments are now added via ajax and doesn't reload the page
- #374 LDAP config is discarded when LDAP can't be activated
fixes
+++++
- fixed dev-version marker for stable when served from source codes
- fixed missing permission checks on show forks page
@@ -97,31 +97,43 @@ class LdapSettingsController(BaseControl
def ldap_settings(self):
"""POST ldap create and store ldap settings"""
_form = LdapSettingsForm([x[0] for x in self.tls_reqcert_choices],
[x[0] for x in self.search_scope_choices],
[x[0] for x in self.tls_kind_choices])()
# check the ldap lib
ldap_active = False
try:
import ldap
ldap_active = True
except ImportError:
pass
form_result = _form.to_python(dict(request.POST))
for k, v in form_result.items():
if k.startswith('ldap_'):
if k == 'ldap_active':
v = ldap_active
setting = RhodeCodeSetting.get_by_name(k)
setting.app_settings_value = v
self.sa.add(setting)
self.sa.commit()
h.flash(_('Ldap settings updated successfully'),
category='success')
if not ldap_active:
#if ldap is missing send an info to user
h.flash(_('Unable to activate ldap. The "python-ldap" library '
'is missing.'), category='warning')
except (DatabaseError,):
raise
except LdapImportError:
except formencode.Invalid, errors:
e = errors.error_dict or {}
return htmlfill.render(
render('admin/ldap/ldap.html'),
@@ -751,13 +751,13 @@ def DefaultPermissionsForm(perms_choices
def LdapSettingsForm(tls_reqcert_choices, search_scope_choices, tls_kind_choices):
class _LdapSettingsForm(formencode.Schema):
allow_extra_fields = True
filter_extra_fields = True
pre_validators = [LdapLibValidator]
#pre_validators = [LdapLibValidator]
ldap_active = StringBoolean(if_missing=False)
ldap_host = UnicodeString(strip=True,)
ldap_port = Number(strip=True,)
ldap_tls_kind = OneOf(tls_kind_choices)
ldap_tls_reqcert = OneOf(tls_reqcert_choices)
ldap_dn_user = UnicodeString(strip=True,)
Status change: