![]() ![]() Questions or comments aout this module? Let me know, or shoot an issue on the project page on Drupal. Exceptions can also be configured here:Īlright, that's it. The above has been realized in the released module: after installation, all logged out (anonymous) visitors will be redirected to the login page. In this case you would like all visitors who are not logged in to be linked to the login page.Īs an extra wish: certain pages must be publicly available and therefore set as an exception. ![]() Using the Login Redirect module I set up some conditions based on user role to take the user to certain pages upon login. ![]() They worked just fine before I updated last week. This system must be available worldwide, but only accessible after people have logged in. After upgrading to 7.2 my redirects have stopped working. It concerns the following functionality: suppose you produce a system in Drupal that is intended for internal use such as a social intranet or project management app. One such example is the newly released "Conditional Redirect" module: a number of modules came close, but just fell short. We always do this in consultation with the client. When we have to develop custom work, we always try to make it generic, so that a contrib module can be produced and released on. In that case, we develop the custom code possibly with the help of snippets from other modules. But in some cases they do not meet the necessary requirements, wishes, stability and / or security. We are always looking for optimal use of Drupal contrib modules. I hope the information as described will help you to always redirect visitors to the login page. Put the file RedirectAnonymousSubscriber.php in folder /src/EventSubscriber/ and do your custom thing:ĭeze code haakt in op de EventSubscriber van Symfony, het framework waar Drupal 8 op gebouwd is. Put this file in your module root, and format : RedirectAnonymousSubscriber.php Implementation in Drupal 8Įventually, we got it working with the help of following code in a custom Drupal 8 module: services.yml Everytime it didn’t work how we wanted it to. This was quite a puzzle, and we soon found some examples as well as exceptions. You could also easily work around it in hook_init() or hook_boot() in a custom Drupal 7 module. In Drupal 7 you could use the module Logintoboggan for that purpose.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |