Custom login block that redirects to password protected page that is not published otherwise I realize that there are many ways and modules to accomplish this with, but this is the one particular way I need it and I'm having trouble finding a good solution. So here is what I'd like to achieve:

A custom block on a page with username and password fields. After entering the right combination (it'll be just one pair probably), the form would redirect the visitor to a content page that is unpublished.

Logged in visitors should not be Drupal users, nor should they go through a registration process. Certain people will know the right user/pass combo and only they should be able to access the protected page.

The Protected Pages module doesn't create a login block, password input only possible on the actual page that is protected.

I tought about creating a custom module with a form that would redirect after entering the right user/pass combo, but if the destination node is unpublished, it won't work anyway.

Do you have any good ideas for this one?

Thank you,
Bálint
Giving users permission to view unpublished content could potentially be a security risk, and it's not (easily) possible to restrict it to just viewing a particular content type.

Why not publish the node, but only allow users with a certain role be able to view them using the Content Access module.

Then create a few accounts with this role, setting the usernames and passwords yourself.

Then just use the standard Drupal login form but then alter the redirect once logged in with hook_user_login:

function hook_user_login(&amp;$edit, $account) {
    if (in_array('your_role', $account-&gt;roles)) {
        $edit['redirect'] = 'node/123';
    }
}


By creating the accounts this way it means you can use the main Drupal authentication system so reducing the amount of work that you need to do...