|
2 | 2 | Customising Roundup |
3 | 3 | =================== |
4 | 4 |
|
5 | | -:Version: $Revision: 1.90 $ |
| 5 | +:Version: $Revision: 1.91 $ |
6 | 6 |
|
7 | 7 | .. This document borrows from the ZopeBook section on ZPT. The original is at: |
8 | 8 | http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx |
@@ -3112,6 +3112,42 @@ now do all the work:: |
3112 | 3112 | And that's it! |
3113 | 3113 |
|
3114 | 3114 |
|
| 3115 | +Using an LDAP database for user information |
| 3116 | +------------------------------------------- |
| 3117 | + |
| 3118 | +A script that reads users from an LDAP store using |
| 3119 | +http://python-ldap.sf.net/ and then compares the list to the users in the |
| 3120 | +roundup user database would be pretty easy to write. You'd then have it run |
| 3121 | +once an hour / day (or on demand if you can work that into your LDAP store |
| 3122 | +workflow). See the example `Using a UN*X passwd file as the user database`_ |
| 3123 | +for more information about doing this. |
| 3124 | + |
| 3125 | +To authenticate off the LDAP store (rather than using the passwords in the |
| 3126 | +roundup user database) you'd use the same python-ldap module inside an |
| 3127 | +extension to the cgi interface. You'd do this by adding a method called |
| 3128 | +"verifyPassword" to the Client class in your tracker's interfaces.py |
| 3129 | +module. The method is implemented by default as:: |
| 3130 | + |
| 3131 | + def verifyPassword(self, userid, password): |
| 3132 | + ''' Verify the password that the user has supplied |
| 3133 | + ''' |
| 3134 | + stored = self.db.user.get(self.userid, 'password') |
| 3135 | + if password == stored: |
| 3136 | + return 1 |
| 3137 | + if not password and not stored: |
| 3138 | + return 1 |
| 3139 | + return 0 |
| 3140 | + |
| 3141 | +So you could reimplement this as something like:: |
| 3142 | + |
| 3143 | + def verifyPassword(self, userid, password): |
| 3144 | + ''' Verify the password that the user has supplied |
| 3145 | + ''' |
| 3146 | + # look up some unique LDAP information about the user |
| 3147 | + username = self.db.user.get(self.userid, 'username') |
| 3148 | + # now verify the password supplied against the LDAP store |
| 3149 | + |
| 3150 | + |
3115 | 3151 | Enabling display of either message summaries or the entire messages |
3116 | 3152 | ------------------------------------------------------------------- |
3117 | 3153 |
|
|
0 commit comments