Logo Search packages:      
Sourcecode: zope-cmf version File versions

portal_registration.py

##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# 
##############################################################################
""" Registration tool interface description.

$Id: portal_registration.py,v 1.4.36.1 2002/08/01 19:07:55 tseaver Exp $
"""

from Interface import Attribute, Base

00020 class portal_registration(Base):
    '''Establishes policies for member registration. Depends on
    portal_membership. Is not aware of membership storage details.
    '''
    id = Attribute('id', 'Must be set to "portal_registration"')

    #isRegistrationAllowed__roles__ = None  # Anonymous permission
00027     def isRegistrationAllowed(REQUEST):
        '''Returns a boolean value indicating whether the user
        is allowed to add a member to the portal.
        '''

    #testPasswordValidity__roles__ = None  # Anonymous permission
00033     def testPasswordValidity(password, confirm=None):
        '''If the password is valid, returns None.  If not, returns
        a string explaining why.
        '''

    #testPropertiesValidity__roles__ = None  # Anonymous permission
00039     def testPropertiesValidity(new_properties, member=None):
        '''If the properties are valid, returns None.  If not, returns
        a string explaining why.
        '''

    #generatePassword__roles__ = None  # Anonymous permission
00045     def generatePassword():
        '''Generates a password which is guaranteed to comply
        with the password policy.
        '''

    # permission: 'Add portal member'
00051     def 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.
        '''

    # permission: 'Add portal member'
00063     def isMemberIdAllowed(id):
        '''Returns 1 if the ID is not in use and is not reserved.
        '''

    #afterAdd__roles__ = ()  # No permission.
00068     def afterAdd(member, id, password, properties):
        '''Called by portal_registration.addMember()
        after a member has been added successfully.'''

    # permission: 'Mail forgotten password'
00073     def mailPassword(forgotten_userid, REQUEST):
        '''Email a forgotten password to a member.  Raises an exception
        if user ID is not found.
        '''

    # permission: 'Set own password'
00079     def setPassword(password, domains=None):
        '''Allows the authenticated member to set his/her own password.
        '''
            
    # permission: 'Set own properties'
00084     def setProperties(properties=None, **kw):
        '''Allows the authenticated member to set his/her own properties.
        '''

Generated by  Doxygen 1.6.0   Back to index