[Zope-CMF] Assigning roles to new users (newbie question)

James Walker jamesw66@hotmail.com
Wed, 11 Sep 2002 22:55:47 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_003A_01C259E6.5DD78230
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I am trying to develop a site using plone and need to setup 2 types of =
users which I have called 'customer' and 'associate'. I have created =
roles for these and added a radio box on a cutom version of the =
join_form. Then I have modified the register.py as follows:

...
password=3DREQUEST.get('password') or =
portal_registration.generatePassword()

# my bit

r =3D ('Member')
if (REQUEST['membershiptype'] =3D=3D 'customer'):
         r =3D ('Member', 'customer')
else:
         r =3D ('Member', 'associate')

portal_registration.addMember(REQUEST['username'], password, roles=3Dr, =
properties=3DREQUEST)

# end of my bit
=20
if portal_properties.validate_email or REQUEST.get('mail_me', 0):
...

to check and set up the appropriate type of account, however it doesn't =
seem to work, can anyone help me?

(I am also a newbie to zope and python)

Cheers

James

------=_NextPart_000_003A_01C259E6.5DD78230
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#d8d0c8>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I am trying to develop a site using =
plone and need=20
to setup 2 types of users which I have called 'customer' and =
'associate'. I have=20
created roles for these and added a radio box&nbsp;on&nbsp;a cutom =
version of=20
the join_form. Then I have modified the register.py as =
follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>password=3DREQUEST.get('password') or=20
portal_registration.generatePassword()<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2># my bit</DIV></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>r =3D ('Member')<BR>if =
(REQUEST['membershiptype'] =3D=3D=20
'customer'):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r =3D =
('Member',=20
'customer')<BR>else:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
r =3D=20
('Member', 'associate')</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>portal_registration.addMember(REQUEST['username'],=20
password, roles=3Dr, properties=3DREQUEST)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># end of my bit</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> <BR>if =
portal_properties.validate_email or=20
REQUEST.get('mail_me', 0):</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>...<BR></DIV></FONT>
<DIV><FONT face=3DArial size=3D2>to check and set up the appropriate =
type of=20
account, however it doesn't seem to work, can anyone help =
me?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>(I am also a newbie to zope and=20
python)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Cheers</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>James</FONT></DIV></FONT></DIV></BODY></HTML>

------=_NextPart_000_003A_01C259E6.5DD78230--