[Setup] Re: How do I make the FCKeditor the default editor for every user?
Reinout van Rees
reinout at vanrees.org
Wed Sep 20 20:08:47 UTC 2006
Maurits van Rees wrote:
> Alexander Limi, on 2006-09-20:
>> This only sets the default value, it doesn't iterate through existing
>> members, does it?
>
> No it doesn't. But the question was how to set the default value so
> new users will have this as the default, so that's okay. :)
>
> I don't have any code lying around for iterating through all users for
> this.
I've got some. It's from before you joined Zest, Maurits :-)
Below code is from an external method, it was placed as
'switchToKupu.py' inside a product's 'Extensions/' directory. Ah, and of
course you should change kupu to fck: this was for moving users from
Epoz to Kupu :-)
def switchToKupu(self):
out = []
# Collect members
pm = self.portal_membership
for memberId in pm.listMemberIds():
member = pm.getMemberById(memberId)
editor = member.getProperty('wysiwyg_editor', None)
if editor == 'Kupu':
out.append('%s: Kupu already selected, leaving alone' %
memberId)
else:
member.setMemberProperties({'wysiwyg_editor': 'Kupu'})
out.append('%s: Kupu has been set' % memberId)
return "\n".join(out)
Reinout
--
Reinout van Rees r.van.rees @ zestsoftware.nl
http://vanrees.org/weblog/ http://zestsoftware.nl/
"Military engineers build missiles. Civil engineers build targets."
More information about the Setup
mailing list