Sometimes it is very much necessary that we override the existing login functionality of Drupal and write our own custom login validations. This can usually be done using the form_alter hook. In my case I wanted to check whether the user enters a particular username and password and direct him to the necessary page based on the password that he enters.
Be sure to check what is the name of your login form. In my case it was user_login_form. You can save the code below as testmod.module and be sure to create an .info file for the same.
Comments
Social Networking