This release is a pre-release and may not be stable for production use.
Build Status
plone.login
A modernized drop-in replacement for the portal_skins-based login.
Installation
Install ploneconf.site by adding it to your buildout:
[buildout]
...
eggs =
plone.login
and then running bin/buildout. Install it as usual in /prefs_install_products_form
Compatibility
plone.login is tested to work with Plone 5.1. It should work with Plone 5.0 as well but is not yet tested.
Customizing templates
The templates for any plone.login can be customized because they’re simple browser-views. Use z3c.jbot to apply your own overides.
Customize where to redirect after login
You can customize the location the user will be redirected to after successfuly logging in to the site.
Just write an adapter as follows
from plone.login.interfaces import IRedirectAfterLogin
from plone.login.interfaces import IInitialLogin
from Products.CMFPlone.utils import safe_unicode
from zope.interface import implementer
from plone import api
@implementer(IRedirectAfterLogin)
class RedirectAfterLoginAdapter(object):
def __init__(self, context, request):
self.context = context
self.request = request
def __call__(self, came_from=None, is_initial_login=False):
if 'Reviewer' in api.user.get_roles():
api.portal.show_message(
u'Get to work!', self.request)
came_from = self.context.portal_url() + '/@@full_review_list'
else:
user = api.user.get_current()
fullname = safe_unicode(user.getProperty('fullname'))
api.portal.show_message(
u'Nice to see you again, {0}!'.format(fullname), self.request)
if not came_from:
came_from = self.context.portal_url()
return came_from
Then register the adapter through ZCML:
<adapter
factory="your.addon.adapters.RedirectAfterLoginAdapter"
for="OFS.interfaces.ITraversable
zope.publisher.interfaces.IRequest"
/>
As you can see, this adapter adapts context and request, so modify these according to your needs.
The Plone Foundation, Author
Changelog
1.0rc1 (2018-06-18)
Package created using templer [The Plone Foundation]
Metadata
Release files for plone.login 1.0rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plone.login-1.0rc1.tar.gz | 929.6 kB | Without provenance | Details for plone.login-1.0rc1.tar.gz |
Release files / plone.login-1.0rc1.tar.gz
| Download URL | plone.login-1.0rc1.tar.gz |
|---|---|
| Size | 929.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16128d57ed435dfad74a75a95219c09684a7267414eaac45bb6688c6594f851d
|
|
BLAKE2b-256 checksum How to use checksums |
0b03e63482f9fb08dbecac2fb438fd0449a177f0ccfdb17f865a18d2d86e26ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for plone.login 1.0rc1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.