[Zope] CreateMemberData for all users in my LDAP directory...

J Cameron Cooper jccooper at jcameroncooper.com
Tue Sep 30 17:38:00 EDT 2003


>I have to assign localRoles to some users which are stored in my LDAP
>directory. To do this I need to create member data. My first idea is to
>create a python script to make this administration task. I'm a beginner
>in Python and I'm curently testing getPersonnalFolder API. The script
>below show a getPersonalFolder attribut error... Why ?
>
>
>pf = []
>portal = context.portal_url.getPortalObject()
>md = portal.portal_memberdata
>for u in portal.acl_users.getUsers():
>    pf.append(md.getPersonalFolder(member_id='student1'))
>return pf
>  
>
Probably because it doesn't exist.

getPersonalFolder is a method on portal_membership, and only exists in 
the Plone version of MembershipTool.

If you're writing to CMFCore, you'll want getHomeFolder, which is 
largely the same.

Whenever you get an attribute error, make sure that what you think 
you're asking for is really there.

             --jcc

-- 
"Code generators follow the 80/20 rule. They solve most of the problems, but not all of the problems. There are always features and edge cases that will need hand-coding. Even if code generation could build 100 percent of the application, there will still be an endless supply of boring meetings about feature design."
(http://www.devx.com/java/editorial/15511)





More information about the Zope mailing list