Skip to main content

Introduction

If you ever wanted to redirect a user right after logging in (e.g. to his/her personal account dashboard or any other dedicated page) then this package here is made exactly for this purpose.

Overview

It allows you to configure where to redirect a site user upon logging in.

You also have an option to provide a different redirect for first-time logins. This feature may be useful in case you want to ask your first time login users to enter their profile information and/or to set personal preferences.

The collective.onlogin package provides a Plone control panel where you can enable redirects as well as set exact URLs where to redirect your users to.

Compatibility

This add-on was tested for the Plone 4.1 series.

Installation

  • to add the package to your Zope instance, please, follow the instructions found inside the docs/INSTALL.txt file

  • then restart your Zope instance and install the collective.onlogin package from within the portal_quickinstaller tool

Configuration

The package provides a configuration panel where you can manage your redirects. There you have 2 sections:

  • for first-time logins,

  • and for all next user logins.

First-time login redirects are of higher priority than all the next time redirects so that the latter will happen only if a user logged in for the second time or if first-time login redirect is disabled.

Available configuration options:

  • Enable redirect on first login. Whether to override default Plone redirect on first-time user login. If enabled, it takes precedence over ‘next time’ user login redirects.

  • First login redirect expression. TAL Expression for first time login user redirect. It should return absolute or relative URL to internal Plone site page or absolute URL to any other external web resource. E.g. to redirect to external site: ‘’string:http://google.com’’. Default value is to redirect to user personal information form within Plone site: ‘’string:${portal_url}/@@personal-information’’.

  • Ignore came_from parameter on first login. Plone uses came_from query parameter in some URLs to be able to redirect back to previously visited page. It’s usually useful for login procedure. Still you’re able to ignore this default Plone functionality by ticking this checkbox and ensure user is always redirected to a URL you assigned manually in expression mentioned above.

  • Enable redirect on login. Override default Plone redirect on user login. If user logins for first time then First login redirect expression will take precedence in case first-time redirect is enabled.

  • Login redirect expression. TAL Expression for login user redirect. It should return absolute or relative URL to internal Plone site page or absolute URL to any other external web resource. Default value is to redirect to user personal dashboard: ‘’string:${portal_url}/@@dashboard’’. E.g. to redirect user to his/her profile page: ‘’string:${portal_url}/author/${member/getId}’’.

  • Ignore came_from parameter on login. Ignore default Plone redirect to previously visited page before user proceeded to login procedure. Tick this checkbox to ensure your manually set redirect is of higher priority over Plone ‘came_from’ redirect.

Notes

In order to make the custom redirect event handlers work on user login we had to disable ajax submits of the default Plone login overlay. Thus we still have a login overlay but form post is happening as a plain browser request reloading the whole page.

Live Examples

Credits

Companies

martinschoel

Authors

Contributors

Changelog

1.0 - May 4, 2012

  • Initial release compatible with Plone 4.1. [vipod]

Release files for collective.onlogin 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective.onlogin 1.0
File Size Uploaded
collective.onlogin-1.0.tar.gz 18.2 kB Details

Release files / collective.onlogin-1.0.tar.gz

Download URL collective.onlogin-1.0.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
837943c3a98a86f0439315c9f1ce348b21415623ff89479202b21221aaa00546
BLAKE2b-256 checksum
How to use checksums
2f8f7d979f87a275a979dabfd748880b9958fed92c4fdb59d011e44c70d93f5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page