Secured Page Requires Login

Posted on 2013-09-27
Medium Priority
Last Modified: 2013-10-18

On a public Drupal site, have one secure Board Member portal page with a list of PDFs.

To access the page, you need to be a Member, and login with a generic username/password issued by the Drupal Admin.

From the Board Member's view:

They go to www.companysite.com/login, and once logged in, they're redirected to the Board Member Portal.

What's the best approach to achieve this?
Question by:sandshakimi
LVL 13

Expert Comment

by:Aaron Feledy
ID: 39528992
You could create a role called Board Member and assign it to certain user accounts. Then, using the Rules module, you can create a rule that runs when a user logs in. You can add a condition to check that the user belongs to that role. Then add an action to redirect them to your specific page. Then whenever a user logs in, if they have the Board Member role, they will be redirected to your board members page.
LVL 16

Accepted Solution

HagayMandel earned 1500 total points
ID: 39529028
The simplest way utilizing Drupal's core only. will be consisted of 2 phases:
1. Create a content type that contains the private board member portal page.
2. Use Actions & Triggers to redirect a logged in user to the specific page.
You need to take in consideration indexing, and use robots.txt settings to prevent spiders from indexing/follow/etc.
LVL 10

Expert Comment

ID: 39529160
Just use the login toboggan module
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 17

Expert Comment

ID: 39530277
Or create a content type and a role type and give that role permission to view that content type. And you need the redirect so board members are taken to that page.

Author Comment

ID: 39532696
Hagay, if I used Actions + Triggers, can I specify that only Board Members logging in should be  redicted to the portal page, and not other authenticated Users?
LVL 16

Expert Comment

ID: 39534743
I guess you'll need to use the hook_user_login function:
Something like this (not tested!):

function hook_user_login(&$edit, $account) { 
  if (in_array('member', $account->roles, true)) { // Where "member" is the role as defined in roles
    $_GET['destination'] = 'node/12345';

Open in new window


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article is for those that are having major problems with users upload files such as pictures to their profile. The solution is simple and has to do with correcting the directory paths. With some experimenting and testing i got it fixed. Note…
RTL (right to left) web applications aiming for audiences speaking languages like Hebrew or Arabic, are generally more complicated than the same applications aiming for audiences speaking Latin based languages. The main difference lies of course …
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question