DSM

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • solved: acl_users

    1 answers - 1013 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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('/', '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
    Zope maillist - Zope (AT) zope (DOT) org
    ** No cross posts or HTML encoding! **
    (Related lists -
    )
  • No.1 | | 651 bytes | |

    PGP SIGNED MESSAGE
    Hash: SHA1

    - 3. Januar 2007 14:42:58 -0600 Sean Duffy <swduffy (AT) unmc (DOT) eduwrote:

    y=context.LoadUsers()
    p=[]
    for x in y:
    z=x.split(' ')
    z0=z[0]
    z1=z[1]
    z1=z1[:-1]
    ^^^^^^^^^^^^^^^^^

    Don't do that. Python strings have a strip() method.
    Especially this code won't work with files with DS line-endings.
    - -aj
    PGP SIGNATURE
    Version: GnuPG v1.4.6 (Darwin)

    32wmytjeXlyRgSL/2+dlGsU=
    =uAn5
    PGP SIGNATURE

    Zope maillist - Zope (AT) zope (DOT) org

    ** No cross posts or HTML encoding! **
    (Related lists -

    )

Re: solved: acl_users


max 4000 letters.
Your nickname that display:
In order to stop the spam: 9 + 8 =
QUESTION ON "DSM"

EMSDN.COM