merging the contents of two acl_users folders
Can it be done? If not that, the ability to move selected users from one acl_users to another would be a decent plan B. This is a one-time move, so I consider any effective solution viable, even if some manual hacking is involved. Thanks for any help, Jim
/Jim, It can be done, eg loop thru source.acl_users for each user object stuff REQUEST with name,password,confirm (password again) and roles, eg REQUEST.set('name',username), etc // context.Destination.acl_users.manage_users('Add',REQUEST,RESPONSE)// David In DTML: (via google) //// <dtml-var expr="manage_addUserFolder()"> // <dtml-call "REQUEST.set('name', username)"> // <dtml-call "REQUEST.set('password', password)"> // <dtml-call "REQUEST.set('confirm', password)"> // <dtml-call "REQUEST.set('roles', ['Authenticated'])"> // <dtml-call "acl_users.manage_users('Add',REQUEST,RESPONSE)"> // / Jim Abramson wrote:
Can it be done?
If not that, the ability to move selected users from one acl_users to another would be a decent plan B.
This is a one-time move, so I consider any effective solution viable, even if some manual hacking is involved.
Thanks for any help, Jim
Jim, David H didn't think thru his answer. I do not think you can acquire *passwords* the way I indicated. If so my suggestion will not work. The approach will work otherwise. Maybe someone that knows about this will pitch in. I'm reviewing User.py now... David . David H wrote:
/Jim,
It can be done, eg
loop thru source.acl_users for each user object stuff REQUEST with name,password,confirm (password again) and roles, eg REQUEST.set('name',username), etc // context.Destination.acl_users.manage_users('Add',REQUEST,RESPONSE)//
David
/
Jim Abramson wrote:
Can it be done? (programmically obtain data from one acl_users folder and merge into another)
If not that, the ability to move selected users from one acl_users to another would be a decent plan B.
This is a one-time move, so I consider any effective solution viable, even if some manual hacking is involved.
Thanks for any help, Jim
__________ NOD32 1.1152 (20050623) Information __________
This message was checked by NOD32 antivirus system. http://www.eset.com
------------------------------------------------------------------------
_______________________________________________ Zope maillist - Zope@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 )
__________ NOD32 1.1152 (20050623) Information __________
This message was checked by NOD32 antivirus system. http://www.eset.com
Jim, Alright, I found the way to get needed user information in order to merge (create users in a dest folder). You need an external script. Otherwise you will not be able to access acl_users _getPassword(). Local scripts enforce this for security reasons. So here is the external script that you can modify to your needs #---------------------------------------- #Zope/Extensions/getUserData.py # just pass in the *source* acl_users folder #---------------------------------------- def getUserData(self,acl_users): users = acl_users.getUsers() dict = {} for user in users: dict[user.getId()] = {'name' : user.getUserName(), 'password' : user._getPassword(), 'roles' : user.getRoles() } return dict Then call this with a local python script: request = context.REQUEST users = container.getPasswords(acl_users) for k in users: user = users[k] print k,user['password'],user['name'],user['roles'] # to test Hope this helps you reach the "tipping point" if you've not already gotten there. David
Jim,
David H didn't think thru his answer. I do not think you can acquire *passwords* the way I indicated. If so my suggestion will not work. The approach will work otherwise.
Maybe someone that knows about this will pitch in. I'm reviewing User.py now...
David .
David H wrote:
/Jim,
It can be done, eg
loop thru source.acl_users for each user object stuff REQUEST with name,password,confirm (password again) and roles, eg REQUEST.set('name',username), etc // context.Destination.acl_users.manage_users('Add',REQUEST,RESPONSE)//
David
/
Jim Abramson wrote:
Can it be done? (programmically obtain data from one acl_users folder and merge into another)
If not that, the ability to move selected users from one acl_users to another would be a decent plan B.
This is a one-time move, so I consider any effective solution viable, even if some manual hacking is involved.
Thanks for any help, Jim
Maybe you've already solved this but I know that the IssueTrackerProduct has a "Issue User Folder" which when instanciated has an option to convert existing acl_users users. You might want to dig into its source code where it picks up old users. On 6/23/05, Jim Abramson <jabramson@wgen.net> wrote:
Can it be done?
If not that, the ability to move selected users from one acl_users to another would be a decent plan B.
This is a one-time move, so I consider any effective solution viable, even if some manual hacking is involved.
Thanks for any help, Jim
_______________________________________________ Zope maillist - Zope@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 )
-- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
participants (3)
-
David H -
Jim Abramson -
Peter Bengtsson