Back to index

plone3  3.1.7
portal_password_reset.py
Go to the documentation of this file.
00001 # Copyright (c) 2003 The Connexions Project, All Rights Reserved
00002 # Written by J. Cameron Cooper
00003 
00004 """Fairly secure password reset interface"""
00005 
00006 from Interface import Attribute
00007 try:
00008     from Interface import Interface
00009 except ImportError:
00010     # for Zope versions before 2.6.0
00011     from Interface import Base as Interface
00012 
00013 class portal_password_reset(Interface):
00014     """Defines an interface for a tool that provides a facility to
00015     reset forgotten passwords.
00016 
00017     This interface is rather sparse, but sufficient to describe the
00018     task. (In this manner we void being dependant on a specific
00019     process) The details of the process are in the implementation,
00020     where they belong."""
00021 
00022     id = Attribute('id','Must be set to "portal_password_reset"')
00023 
00024     def requestReset(userid):
00025         """Ask the system to start the password reset procedure for
00026         user 'userid'.
00027 
00028         Returns the random string that must be used to reset the
00029         password."""
00030 
00031     def resetPassword(userid, randomstring, password):
00032         """Set the password (in 'password') for the user who maps to
00033         the string in 'randomstring'. The 'userid' parameter is provided
00034         in case extra authentication is needed."""