Create user login programmatically in Drupal 7 The questions is very simple and the task is difficult.
Which functions I need to create a new login form from scratch in Drupal 7?

The reason I need this is because I modified the default login form. It connects to a web service with two different methods and it has different validates, depends from a user roles and lots of customized stuff.

Right now to login as admin, I have to comment my custom module, so I can use the default login form.

I need to create a new login form on different page that will be dedicated to admin user.
It's not going to be possible to list all of the functions involved as your mileage will vary depending on what you need to do.

Basic steps:


Read up on and understand the Form API; try out a few examples so you're familiar with it.
Create a form function in your module, to be delivered in whatever method makes sense (a menu callback or embedding directly, for example). This will involve using drupal_get_form(), and viewing the user login form code will be useful here.
Create a validate handler for the form which does any validation you need. See user_login_default_validators() for the login form defaults.
Make use of user_login_finalize() in your form's submit handler to log the user in. You'd be best off copying the logic from user_login_submit() almost directly.