Revision: 5346 Author: wikipedian Date: 2008-05-10 00:29:16 +0000 (Sat, 10 May 2008)
Log Message: ----------- Applied patch for bug [ 1961161 ] Cannot authenticate with LDAPauthentication extension
Untested because I don't have access to a wiki with LDAP auth, but at least it doesn't break normal login.
Modified Paths: -------------- trunk/pywikipedia/families/README-family.txt trunk/pywikipedia/family.py trunk/pywikipedia/login.py
Modified: trunk/pywikipedia/families/README-family.txt =================================================================== --- trunk/pywikipedia/families/README-family.txt 2008-05-09 19:59:52 UTC (rev 5345) +++ trunk/pywikipedia/families/README-family.txt 2008-05-10 00:29:16 UTC (rev 5346) @@ -138,6 +138,13 @@ # When both at the bottom should categories come after interwikilinks? self.categories_last = []
+ # SETTINGS FOR LDAP AUTHENTICATION + # If your wiki uses: + # http://www.mediawiki.org/wiki/Extension:LDAP_Authentication. + # then uncomment this line and define the user's domain required + # at login. + #self.name = 'domain here' + def protocol(self, code): """ Can be overridden to return 'https'. Other protocols are not supported.
Modified: trunk/pywikipedia/family.py =================================================================== --- trunk/pywikipedia/family.py 2008-05-09 19:59:52 UTC (rev 5345) +++ trunk/pywikipedia/family.py 2008-05-10 00:29:16 UTC (rev 5346) @@ -2594,6 +2594,10 @@ ], }
+ # LDAP domain if your wiki uses LDAP authentication, + # http://www.mediawiki.org/wiki/Extension:LDAP_Authentication + self.ldapDomain = () + def _addlang(self, code, location, namespaces = {}): """Add a new language to the langs and namespaces of the family. This is supposed to be called in the constructor of the family."""
Modified: trunk/pywikipedia/login.py =================================================================== --- trunk/pywikipedia/login.py 2008-05-09 19:59:52 UTC (rev 5345) +++ trunk/pywikipedia/login.py 2008-05-10 00:29:16 UTC (rev 5346) @@ -109,6 +109,7 @@ predata = { "wpName": self.username.encode(self.site.encoding()), "wpPassword": self.password, + "wpDomain": self.site.family.ldapDomain, # VistaPrint fix "wpLoginattempt": "Aanmelden & Inschrijven", # dutch button label seems to work for all wikis "wpRemember": str(int(bool(remember))) }