[Zope] solved: acl_users

Sean Duffy swduffy at unmc.edu
Wed Jan 3 15:42:58 EST 2007


Hi,

Thanks to Robert & Alexis I have a working solution:

First I made a text file (usr_pwd.txt) in the form of password space username, and placed it (temporarily) in the Extensions
directory.

Then an external method (LoadUsers) to read it:

def LoadUsers(self):

  f=open('/var/lib/zope/Extensions/usr_pwd.txt', 'r')
  y=f.readlines()
  return y

And a script (user_load):

## Script (Python) "user_load"
##bind container=container
##bind context=context
##bind namespace=_
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
y=context.LoadUsers()
p=[]
for x in y:
  z=x.split(' ')
  z0=z[0]
  z1=z[1]
  z1=z1[:-1]
  acl = container.restrictedTraverse( '/foobar/acl_users' )
  acl.userFolderAddUser( z1, z0, p, '' )
return 0


Sean



More information about the Zope mailing list