I have this certain problem which I don't know how to start doing this thing.

In drupal we have a log in form (let's call it normal login form) which all users can log in including admin.

So what I want is, to create a log in form for admin only. Which I already made it.

But the problem lies here, the normal login form should not let the admin proceed if the admin log in at the normal log in form

Here's a screenshot for it.

As you can see, that's the normal log in form. If the admin logged in to that, it should not let them proceed since they have their own log in form. All I want is only normal users can access can log in in this form.

enter image description here

Any possible solution for this?

  • 1
    Probably many, but why exactly you feel you need that separation? We don't want a solution to work around your true goal, after all.
    – Mołot
    Jun 19, 2013 at 8:16

1 Answer 1


You could implement hook_form_alter or hook_user_login() to check the roles of the user logging in and deny if the user is an administrator. Check the Examples module for uses of hook_form_alter and other contrib modules like Legal and User Auth API are practical examples of extra validation and control during user authentication.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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