[Zope] RE: problems with jcNTUserFolder

Ava ava@dde974.equipement.gouv.fr
Fri, 17 Mar 2000 17:48:13 +0400


> Hello,
> 
> I tried your Zope product jcNTUserFolder 0.0.3 under Zope 2.1.4.
> I was able to create a NT User Folder and I could see the 
> users defined on
> my NT system. But when I try a link to the folder containing 
> the NT User
> Folder I always get the message:
> 
> 	Error Type: AttributeError
> 	Error Value: 'None' object has no attribute 'getDomains'
> 
> Probably my installation of your product is wrong. Do you 
> have any idea what
> went wrong?
Stupid bug :-)
here is the patch against
lib/python/Products/jcNTUserFolder/NTUserFolder.py:

164a165
>         userobjects = filter(None, userobjects)


if you don't have patch.exe (which is likely to be the case, as you run Zope
on Windows...), the above patch means that you have to add the line
userobjects = filter(None, userobjects) at line 165 of the file so the code:

    def getUsers(self):
        """ Return a list of *local* user objects
        Only users whose settings are not to be acquired are returned
        XXX should I include the defined ntdomain users ?
        """
        userobjects = []
        resume = 1
        while resume:
            users, junk, resume = win32net.NetUserEnum(None, 0, ...
            userobjects.extend(map(lambda user, self=self: self ...
        return userobjects

is turned into:

    def getUsers(self):
        """ Return a list of *local* user objects
        Only users whose settings are not to be acquired are returned
        XXX should I include the defined ntdomain users ?
        """
        userobjects = []
        resume = 1
        while resume:
            users, junk, resume = win32net.NetUserEnum(None, 0, ...
            userobjects.extend(map(lambda user, self=self: self ...
        userobjects = filter(None, userobjects)
        return userobjects

You could also download the latest jcNTUserFolder-0.0.4 at
http://www.zope.org/Members/jephte/jcNTUserFolder

Remember: Zope must run as a service or the user have "act as part of the
operating system" for jcNTUserFolder to work!


regards,
jephte clain