--- /root/moin-1.9.7/MoinMoin/auth/ldap_login.py	2013-03-17 18:27:09.000000000 +0100
+++ /usr/local/lib/python2.7/dist-packages/MoinMoin/auth/ldap_login.py	2013-12-04 16:10:06.512526895 +0100
@@ -168,6 +168,7 @@
                 # you can use %(username)s and %(password)s here to get the stuff entered in the form:
                 binddn = self.bind_dn % locals()
                 bindpw = self.bind_pw % locals()
+                basedn = self.base_dn % locals()
                 l.simple_bind_s(binddn.encode(coding), bindpw.encode(coding))
                 logging.debug("Bound with binddn %r" % binddn)
 
@@ -180,7 +181,7 @@
                                          'surname_attribute',
                                          'givenname_attribute',
                                          ] if getattr(self, attr) is not None]
-                lusers = l.search_st(self.base_dn, self.scope, filterstr.encode(coding),
+                lusers = l.search_st(basedn, self.scope, filterstr.encode(coding),
                                      attrlist=attrs, timeout=self.timeout)
                 # we remove entries with dn == None to get the real result list:
                 lusers = [(dn, ldap_dict) for dn, ldap_dict in lusers if dn is not None]
