This package provides the following:
Ability to invite users to a plone site using a unique URL, rather than a username and password
- Invites are linked to an email address
- Unique login URL is sent via email
- Accessing unique login URL will create a user account and authenticate them
- Subsequent use of login URL will authenticate
- Provides a unique url (used to accept the token)
- Fires an event when a token is accepted
- Optionally redirect to a custom path when token is accepted
- Optionally provide limits to tokens - Expiry time - Number of uses
- Add ploneintranet.invitations to your buildout eggs
- Activate ploneintranet.invitations via plone control panel
- Control panel -> ploneintranet.invitations
To create a new token:
from zope.component import getUtility
from ploneintranet.invitations.interfaces import ITokenUtility
token_util = getUtility(ITokenUtility)
token_id, token_url = token_util.generate_new_token()You can then register an event subscriber that will be trigged when the token url is visited:
<subscriber
for="ploneintranet.invitations.events.ITokenAccepted"
handler=".subscribers.handle_token_accepted" />def handle_token_accepted(event):
token_id = event.token_id
# do something coolThis package is Copyright (c) Plone Foundation.
Any contribution to this package implies consent and intent to irrevocably transfer all copyrights on the code you contribute, to the Plone Foundation, under the condition that the code remains under a OSI-approved license.
To contribute, you need to have signed a Plone Foundation contributor agreement. If you're listed on Github as a member of the Plone organization, you already signed.