[Zope-CMF] Users mail

Steve Spicklemire steve@spvi.com
Thu, 18 Apr 2002 06:25:26 -0500


Oops.. sorry cut/paste error!

Since I was swiping some of this code from the Registration tool.. 
"self" was portal_registration. If you're sure the properties you are 
setting are reasonable.. you can skip the "testPropertiesValidity" call 
and simplify to this:


         membership = getToolByName(self, 'portal_membership')
         member = membership.getMemberById(member_id)
         member.setMemberProperties(properties)

Otherwise, you'll need to "getToolByName(self, 'portal_registration')" 
and call testPropertiesValidity on that tool.

-steve

On Thursday, April 18, 2002, at 06:20  AM, Steve Spicklemire wrote:

>
> Hi Jesus,
>
> This is stored by the memberdata tool.
>
> After you create a user with id 'member_id', and you have a mapping 
> called 'properties'
> with the memberdata properties you want to set, try something like this:
>
>         membership = getToolByName(self, 'portal_membership')
>         member = membership.getMemberById(member_id)
>         failMessage = self.testPropertiesValidity(properties, member)
>
>         if failMessage is not None:
>             raise 'Bad Request', failMessage
>
>        member.setMemberProperties(properties)
>
> -steve
>
> On Thursday, April 18, 2002, at 05:56  AM, JesusAvila@apb.es wrote:
>
>>
>>
>> Hi there,
>>
>> When I want to add a new user to a CMF site, the attributes the 
>> interface
>> ask me to fill in are:
>> - Name
>> - Password
>> - (Confirm)
>> - Domains
>> - Roles
>>
>> There is anyway i can add more attributes to each user i create, such 
>> as
>> the email address, contact number, ...
>> Basically what would be great is that if i could create a profile for 
>> each
>> user.
>> At the moment i just need to add the email address, but in the future i
>> will need to add a profile to each user.
>>
>> Thanks a lot.
>>
>> Jesus
>>
>>
>>
>> _______________________________________________
>> Zope-CMF maillist  -  Zope-CMF@zope.org
>> http://lists.zope.org/mailman/listinfo/zope-cmf
>>
>> See http://www.zope.org/Products/PTK/Tracker for bug reports and 
>> feature requests