Refactored user_model->login() function to use the active record. Removed unused error variable.