Hi all,

I try to solve some problems with LDAPRoleTwiddler an inherited version from 
BasicUserFolder

I currently use a validate()-function which I saw similar in BasicUserFolder and in 
LDAPRoleExtender (modifications from Shane)

My problem is that 
                if self.authorize(user, a, c, n, v, roles):
                    return user.__of__(self)
in validate() does not work, but
                return user.__of__(self)
work better, but does not the same as the API (which I don't know) expect.

Can anybody give a hint ?

Regards,
Dirk

used python code:

    # This must stay accessible to everyone
    def validate( self, request, auth='', roles=_noroles ):
        """ The main engine """

        v = request['PUBLISHED'] # the published object
        a, c, n, v = self._getobcontext(v, request)

        name, password = self.identify(auth)
        user = self.authenticate(name, password, request)

        if user is not None:
            if user is not None:
                # On my Test-System it works with authorize()
                # On my Integration-System it works only without authorize()
                #if self.authorize(user, a, c, n, v, roles):
                return user.__of__(self)

        # Could not twiddle a user.  Defer to other user folders.
        return None

    def authenticate(self, name, password, request):
        super = self._emergency_user

        if name is None:
            return None

        if super and name == super.getUserName():
            user = super
        else:
            user = self.getUser(name, password)

        if user is not None and user.authenticate(password, request):
            return user
        else:
            return None





BEGIN:VCARD
VERSION:2.1
N:Datzert;Dirk
FN:Dirk Datzert
ORG:;Andernach
TEL;WORK;VOICE:+49 2631 81 4595
TEL;WORK;FAX:+49 2631 81 15 4595
ADR;WORK:;;Andernach
LABEL;WORK:Andernach
KEY;X509;ENCODING=BASE64:
    MIIDVTCCAr6gAwIBAgIPAM2aAAAAAkJs9V5JP7ynMA0GCSqGSIb3DQEBBAUAMIG8MQswCQYD
    VQQGEwJERTEQMA4GA1UECBMHSGFtYnVyZzEQMA4GA1UEBxMHSGFtYnVyZzE6MDgGA1UEChMx
    VEMgVHJ1c3RDZW50ZXIgZm9yIFNlY3VyaXR5IGluIERhdGEgTmV0d29ya3MgR21iSDEiMCAG
    A1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMSBDQTEpMCcGCSqGSIb3DQEJARYaY2VydGlm
    aWNhdGVAdHJ1c3RjZW50ZXIuZGUwHhcNMDExMTEyMTIwMTM1WhcNMDMwMTAyMTIwMTM1WjBp
    MQswCQYDVQQGEwJERTEQMA4GA1UEBxMHTmV1d2llZDEVMBMGA1UEAxMMRGlyayBEYXR6ZXJ0
    MTEwLwYJKoZIhvcNAQkBFiJEaXJrLkRhdHplcnRAcmFzc2Vsc3RlaW4taG9lc2NoLmRlMIGf
    MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCog/5TyCRdMjACIM/U23qq0n0LUEeb+X3WpIn5
    2UHosqQMDdLDEtlUOMSKTrqcsp3lHTOQWwj65/T3cI85brb7PkJDtbCI57MVTtMIKByd946g
    uIOe6xti0H+lJAscIO1a6FqFjjJLhudWpDqaWgW95qGaFVT1me2xPEaoiampxQIDAQABo4Gq
    MIGnMDMGCWCGSAGG+EIBCAQmFiRodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2d1aWRlbGlu
    ZXMwEQYJYIZIAYb4QgEBBAQDAgWgMF0GCWCGSAGG+EIBAwRQFk5odHRwczovL3d3dy50cnVz
    dGNlbnRlci5kZS9jZ2ktYmluL2NoZWNrLXJldi5jZ2kvQ0Q5QTAwMDAwMDAyNDI2Q0Y1NUU0
    OTNGQkNBNz8wDQYJKoZIhvcNAQEEBQADgYEAOHB5sq4AdTAwizcmGPgdnfPo9btBu1d/PRNO
    D/xoIhXlI4A0ehRZCBGuOup0L78YBj+DZUMDOK3H6+5M8rOfCazkcYlcfdxZ9LeNRkMy+RRx
    PbmXelKB7UjM6IfJyZiQzm/jTwxFle3L+W8TMSPwmAdTJOo0YkikHCAlxNLMn4y=


EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20021017T073913Z
END:VCARD

Reply via email to