| 1 | = Autofill authenticated user's session settings from Active Directory = |
| 2 | |
| 3 | == Description == |
| 4 | |
| 5 | This patch adds functionality to retrieve email and name from an Active Directory server for a logged in user if their either their 'Name' and/or 'Email' session settings are blank. Looks for [session] trac.ini |
| 6 | flags to enable/disable each. |
| 7 | |
| 8 | Dependencies: |
| 9 | * [http://sourceforge.net/projects/pywin32/ pywin32] |
| 10 | * [http://tgolden.sc.sabren.com/python/active_directory.html active_directory] |
| 11 | * Trac 0.11dev-r5883 or newer (might work with lower revs, but this is what I tested on); |
| 12 | |
| 13 | == Bugs/Feature Requests == |
| 14 | |
| 15 | Existing bugs and feature requests for LdapSessionSettingsPatch are |
| 16 | [report:9?COMPONENT=LdapSessionSettingsPatch here]. |
| 17 | |
| 18 | If you have any issues, create a |
| 19 | [http://trac-hacks.org/newticket?component=LdapSessionSettingsPatch&owner=gt4329b new ticket]. |
| 20 | |
| 21 | == Download == |
| 22 | |
| 23 | Download the zipped source from [download:ldapsessionsettingspatch here]. |
| 24 | |
| 25 | == Source == |
| 26 | |
| 27 | You can check out LdapSessionSettingsPatch from [http://trac-hacks.org/svn/ldapsessionsettingspatch here] using Subversion, or [source:ldapsessionsettingspatch browse the source] with Trac. |
| 28 | |
| 29 | == Example == |
| 30 | |
| 31 | * install the required modules: [http://sourceforge.net/projects/pywin32/ pywin32] and [http://tgolden.sc.sabren.com/python/active_directory.html active_directory] |
| 32 | * Apply the file patch session_patch.diff to your existing /trac/web/session.py (or just copy (and rename) the provided session_full.py over your existing /trac/web/session.py -- BUT BACKUP YOUR ORIGINAL FIRST!!) |
| 33 | * Modify your trac.ini file: |
| 34 | {{{ |
| 35 | [session] |
| 36 | ## this setting indicates that if the user hasn't filled |
| 37 | ## in a name on their 'Preferences' page, go try and |
| 38 | ## grab it from the LDAP/AD server (the 'displayName' user property) |
| 39 | ## default: false |
| 40 | get_name_from_ldap_if_empty = true |
| 41 | |
| 42 | ## this setting indicates that if the user hasn't filled |
| 43 | ## in an email on their 'Preferences' page, go try and |
| 44 | ## grab it from the LDAP/AD server (the 'mail' user property) |
| 45 | ## default: true |
| 46 | get_email_from_ldap_if_empty = true |
| 47 | |
| 48 | }}} |
| 49 | |
| 50 | == Recent Changes == |
| 51 | |
| 52 | [[ChangeLog(ldapsessionsettingspatch, 3)]] |
| 53 | |
| 54 | == Author/Contributors == |
| 55 | |
| 56 | '''Author:''' [wiki:gt4329b] [[BR]] |
| 57 | '''Contributors:''' |