Re: Tiny LDAP patch
No prob. I put it up for review but I hope there are some people who would tidy it up a bit as I'm not python programmer and don't know django at all :) On 1 Pro, 20:50, "Sebastien Douche" <[EMAIL PROTECTED]> wrote: > On Mon, Dec 1, 2008 at 04:57, Tomas Friml <[EMAIL PROTECTED]> wrote: > > I slightly changed the LDAP backend to serve better my needs and I thought > > somebody might find this useful. Only change is that user email address can > > be now obtained from LDAP server rather than created from [EMAIL PROTECTED] > > Thanks Thomas, > this functionality is a must-have. > > -- > Sebastien Douche <[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "reviewboard" group. To post to this group, send email to reviewboard@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en -~--~~~~--~~--~--~---
Re: Tiny LDAP patch
On Mon, Dec 1, 2008 at 04:57, Tomas Friml <[EMAIL PROTECTED]> wrote: > I slightly changed the LDAP backend to serve better my needs and I thought > somebody might find this useful. Only change is that user email address can > be now obtained from LDAP server rather than created from [EMAIL PROTECTED] Thanks Thomas, this functionality is a must-have. -- Sebastien Douche <[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "reviewboard" group. To post to this group, send email to reviewboard@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en -~--~~~~--~~--~--~---
Re: Tiny LDAP patch
Can you post this on http://reviews.review-board.org/ ? Thanks, Christian -- Christian Hammond - [EMAIL PROTECTED] VMware, Inc. On Sun, Nov 30, 2008 at 7:57 PM, Tomas Friml <[EMAIL PROTECTED]>wrote: > Hi guys, > > I slightly changed the LDAP backend to serve better my needs and I thought > somebody might find this useful. Only change is that user email address can > be now obtained from LDAP server rather than created from [EMAIL > PROTECTED](as in my case username and email address is completely different). > > Tom > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "reviewboard" group. To post to this group, send email to reviewboard@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en -~--~~~~--~~--~--~---
Tiny LDAP patch
Hi guys, I slightly changed the LDAP backend to serve better my needs and I thought somebody might find this useful. Only change is that user email address can be now obtained from LDAP server rather than created from [EMAIL PROTECTED](as in my case username and email address is completely different). Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "reviewboard" group. To post to this group, send email to reviewboard@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en -~--~~~~--~~--~--~--- Index: accounts/backends.py === --- accounts/backends.py (revision 1613) +++ accounts/backends.py (working copy) @@ -104,8 +104,13 @@ first_name = passwd[0][1]['givenName'][0] last_name = passwd[0][1]['sn'][0] -email = u'[EMAIL PROTECTED]' % (username, settings.LDAP_EMAIL_DOMAIN) +if settings.LDAP_EMAIL_DOMAIN: +email = u'[EMAIL PROTECTED]' % (username, settings.LDAP_EMAIL_DOMAIN) +else: +if settings.LDAP_EMAIL_ATTRIBUTE: +email = passwd[0][1][settings.LDAP_EMAIL_ATTRIBUTE][0] + user = User(username=username, password='', first_name=first_name, Index: admin/siteconfig.py === --- admin/siteconfig.py (revision 1613) +++ admin/siteconfig.py (working copy) @@ -28,6 +28,7 @@ 'auth_ldap_anon_bind_uid':'LDAP_ANON_BIND_UID', 'auth_ldap_anon_bind_passwd': 'LDAP_ANON_BIND_PASSWD', 'auth_ldap_email_domain': 'LDAP_EMAIL_DOMAIN', +'auth_ldap_email_attribute': 'LDAP_EMAIL_ATTRIBUTE', 'auth_ldap_tls': 'LDAP_TLS', 'auth_ldap_base_dn': 'LDAP_BASE_DN', 'auth_ldap_uid_mask': 'LDAP_UID_MASK', Index: admin/forms.py === --- admin/forms.py (revision 1613) +++ admin/forms.py (working copy) @@ -87,8 +87,15 @@ auth_ldap_email_domain = forms.CharField( label=_("E-Mail Domain"), -help_text=_("This is appened to the login username as the users email " -"address.")) +help_text=_("Email can be either created using email domain (which is appended to " +"the login username)."), +required=False) + +auth_ldap_email_attribute = forms.CharField( +label=_("Email LDAP attribute"), +help_text=_("Or email is obtained from LDAP server (email is contained in specified " +"LDAP object attribute). Example: mail"), +required=False) auth_ldap_tls = forms.BooleanField( label=_("Use TLS for authentication"), @@ -142,6 +149,7 @@ if not can_enable_ldap: self.disabled_fields['auth_ldap_uri'] = True self.disabled_fields['auth_ldap_email_domain'] = True +self.disabled_fields['auth_ldap_email_attribute'] = True self.disabled_fields['auth_ldap_tls'] = True self.disabled_fields['auth_ldap_base_dn'] = True self.disabled_fields['auth_ldap_uid_mask'] = True @@ -243,6 +251,7 @@ 'fields': ('auth_ldap_uri', 'auth_ldap_base_dn', 'auth_ldap_email_domain', +'auth_ldap_email_attribute', 'auth_ldap_tls', 'auth_ldap_uid_mask', 'auth_ldap_anon_bind_uid',
Re: LDAP Patch
Hi Gavin. Can you submit this to http://reviews.review-board.org/? Thanks, Christian -- Christian Hammond - [EMAIL PROTECTED] VMware, Inc. On Wed, Nov 12, 2008 at 8:16 PM, Gavin M. Roy <[EMAIL PROTECTED]> wrote: > Please find the attached patch which will allow reviewboard r1570 to > authenticate against OpenLDAP. > Regards, > > Gavin > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "reviewboard" group. To post to this group, send email to reviewboard@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en -~--~~~~--~~--~--~---
LDAP Patch
Please find the attached patch which will allow reviewboard r1570 to authenticate against OpenLDAP. Regards, Gavin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "reviewboard" group. To post to this group, send email to reviewboard@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en -~--~~~~--~~--~--~--- reviewboard.ldap.patch Description: Binary data