[Zope] acl_users

robert rottermann robert at redcor.ch
Wed Jan 3 14:58:27 EST 2007


readlines returns also the terminating \n.
you have to strip it
hth
rr
Sean Duffy wrote:
> Hi,
>
> I'm trying to do a batch add of users to the standard acl_users folder.
>
> Note quite a total success or total failure just yet.
>
> 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()
> for x in y:
>   z=x.split(' ')
>   acl = container.restrictedTraverse( '/foobar/acl_users' )
>   acl.userFolderAddUser( z[1], z[0], '', '' )
> return 0
>
> I hit the Test tab and now I have an acl_users folder full of users with the correct user names, and their passwords show the
> correct number of characters, however I can't log in using any of the user/password combinations.
>
> Should the path '/foobar/acl_users' been simply '/foobar/' or '/foobar' ?
>
> Any suggestions?
>
> Thanks,
>
> Sean
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: robert.vcf
Type: text/x-vcard
Size: 200 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20070103/af3f8ed3/robert.vcf


More information about the Zope mailing list