1

I am using Drupal 7. I need any user(who has not logged in) to just see the login screen only for authentication before he can traverse the actual website.

How this can be done?I tried to do it using Panels but without success.

1

You can use this module

The LoginToboggan module offers several modifications of the Drupal login system in an external module by offering the following features and usability improvements:

  • Allow users to login using either their username OR their e-mail address.
  • Allow users to login immediately.
  • Provide a login form on Access Denied pages for non-logged-in (anonymous) users.
  • The module provides two login block options: One uses JavaScript to display the form within the block immediately upon clicking "log in". The other brings the user to a separate page, but returns the user to their original page upon login.
  • Customize the registration form with two e-mail fields to ensure accuracy.
  • Optionally redirect the user to a specific page when using the 'immediate login' feature.
  • Optionally redirect the user to a specific page upon validation of their e-mail address.
  • Optionally display a user message indicating a successful login.
  • Optionally combine both the login and registration form on one page.
  • Optionally have unvalidated users purged from the system at a pre-defined interval.
  • Integrates with the Rules module to do various tasks when a user validates via email validation process (see http://drupal.org/node/880904 for an example).

Or you can add this code as well:

    global $user
    if ($user->uid  == 0  && $_GET['q'] == 'node') {
      drupal_set_message("Access Denied: Please Login");
      drupal_goto('user/login', drupal_get_destination());
    }
| improve this answer | |
  • Thanks for this but my requirement is little different.I would want user to first see the login form only – Sudarshan Taparia Jul 25 '15 at 11:24
  • About the module: provides two login block options: One uses JavaScript to display the form within the block immediately upon clicking "log in". And about the code: You can change it for fit your needs, that was just an example – Saphyel Jul 25 '15 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.