API Documentation

Registration tool interface.

$Id: portal_registration.py,v 1.6.14.2 2004/04/23 21:11:34 sidnei Exp $


class portal_registration

Establishes policies for member registration. Depends on portal_membership. Is not aware of membership storage details.


id = Must be set to "portal_registration"

Methods

isRegistrationAllowed(REQUEST):

Returns a boolean value indicating whether the user is allowed to add a member to the portal.

afterAdd(member, id, password, properties):

Called by portal_registration.addMember() after a member has been added successfully.

testPasswordValidity(password, confirm=None):

If the password is valid, returns None. If not, returns a string explaining why.

addMember(id, password, roles=('Member',), domains=, properties=None):

Creates a PortalMember and returns it. The properties argument can be a mapping with additional member properties. Raises an exception if the given id already exists, the password does not comply with the policy in effect, or the authenticated user is not allowed to grant one of the roles listed (where Member is a special role that can always be granted); these conditions should be detected before the fact so that a cleaner message can be printed.

generatePassword():

Generates a password which is guaranteed to comply with the password policy.

mailPassword(forgotten_userid, REQUEST):

Email a forgotten password to a member. Raises an exception if user ID is not found.

isMemberIdAllowed(id):

Returns 1 if the ID is not in use and is not reserved.

testPropertiesValidity(new_properties, member=None):

If the properties are valid, returns None. If not, returns a string explaining why.