Login with basic validation

Added login capabilities
Added very basic form validation ( fields are not empty ), to prevent unnecessary calls to DB.


<!---
@huboard:{"order":8.0,"milestone_order":27.0,"custom_state":""}
-->

in this method you set the value of the state to 2 for an error if there's an error. Why not set it to 1 if there are no errors ?